次の方法で共有


HostedControl Class

Definition

This control makes it easier to create WinForm applications by wrapping the most common operations into a base class.

public ref class HostedControl : System::Windows::Forms::UserControl, Microsoft::Uii::Csr::IHostedApplication4
[Microsoft.Practices.CompositeUI.SmartParts.SmartPart]
public class HostedControl : System.Windows.Forms.UserControl, Microsoft.Uii.Csr.IHostedApplication4
[<Microsoft.Practices.CompositeUI.SmartParts.SmartPart>]
type HostedControl = class
    inherit UserControl
    interface IHostedApplication4
    interface IHostedApplication3
    interface IHostedApplication2
    interface IHostedApplication
Public Class HostedControl
Inherits UserControl
Implements IHostedApplication4
Inheritance
HostedControl
Derived
Attributes
Implements

Remarks

It would be better to make this an abstract class and have the DoAction( Action ) method also be abstract. However doing so causes the VS 2003 UI designer to not allow drag-n-drop layout which most people will want. Thus, the obvious abstract-ness of this class is not being coded.

Constructors

HostedControl()

Hosted Control constructor

HostedControl(Guid, String, String)

Hosted Control constructor

Fields

actions

Dictionary of actions

actionsByID

Dictionary of actions

Properties

AgentID

Useful for management apps that need to know who is logged into them. This is used for apps supporting the IHostedApplication2 interface.

AppHostWorkItem

For CAB integration purposes only; allows injection of current WorkItem

ApplicationHost

Intended to provide access to the containing ApplicationHost instance to support advanced hosting senarios. Usage may increase coupling between AIF hosted applications, running counter to the architectural intent of AIF. Setter is for internal use only, it will have no effect.

ApplicationID

Returns the unique id for this hosted application.

ApplicationName

Returns the name of the hosted application as given in the database.

CanEmbed

Returns true if the application can be hosted within the UII panels. False if the application can only be integrated with UII via scripts.

ConfigurationReader

Gets or set the hosted controls Configuration Value reader object.

Context

Contains session-wide context. Modifying this also notifies other applications of the context change.

DisplayGroup

The name of the UII panel this application is hosted within. This is taken from the database Application table initialization XML.

EnableAutoSignOn

Get the value of private member variable enableAutoSignOn.

Icon

Used for hosted WinForm apps that want a simple way to set their icons.

ImplementedAsCcf20

Allows system to run certain routines as CCF 2.0 or prior

IsAdapterSessionController

Gets a boolean indicating whether the adapter is a SessionController.

IsDynamic

Gets or sets a value indicating whether this instance is dynamic.

IsGlobal

Tells whether the hosted application is global

IsListed

Allows to be seen but not listed in SessionExplorer or CurrentSessionUI

IsNavigating

Could be used to indicate an application is changing its state.

IsTagged

When true, application is dependent on workflow

OptimumSize

The size that the applications's window will initially be if it is a floating window.

SessionManager

Allows hosted apps to have access to sessions

Text

Sets/Gets the text for the window or tab control containing this application.

TopLevelWindow

Returns a control for the owning window of this hosted app. If this is an external application, then null is returned.

Methods

AddAction(Int32, String, String)

Adds an action for use from one application or the UII core to this application. An action with id of 1 is the default action and is called when initing the application. There is no requirement to have a default action though.

AddImplicitAction(String)

Adds implicit action . Action Id will use the maximum available int .

Close()

Called when the app is closed.

DoAction(Action, String)
Obsolete.

Method to override in the implemention to handle the action.

DoAction(Int32, String)
Obsolete.

Called to perform the action configured in the database. Do not override this method! To handle DoAction in your implementation override DoAction(RequestActionEventArgs) instead.

DoAction(RequestActionEventArgs)

Method to override in the implementation to handle the action.

DoAction(String, String)
Obsolete.

Called to perform the action configured in the database.

DoDefaultAction()

Performs this hosted application's default action, if there is one. The default action is the one with an id of 1, but it is not required.

ErrorMsg(String, String)

So hosted winform applications can use this and have the same error message style as the rest of the desktop.

FireChangeContext(ContextEventArgs)

Informs all the other applications that the context has changed.

FireRequestAction(RequestActionEventArgs)

Sends a request to perform some action to another application. If the RequestActionEventArgs has a target of *, then all apps get the action.

GetIconList()

Gets the icon images

GetStateData()

Gets the application state data for the windows application For now we retrieve only the InputText value

HandleRequestAction(Object, RequestActionEventArgs)

This is for internal UII use only. Please do not use directly. Public visibility necessary for CAB integration.

HandleRequestDefaultAction(Object, DataEventArgs<ApplicationProperties>)

This is for internal UII use only. Please do not use directly. Public visibility necessary for CAB integration.

Initialize()

Called when the application should initialize its internal state

NotifyContextChange(Context)

Event which happens whenever the context is changed.

NotifyContextChange(String)
Obsolete.

Event which happens whenever the context is changed. This is called by the applicationHost

SessionChange(Boolean, Guid)

Called for global applications when the session is activated or deactivated Not called for non-global applications.

SetContext(Context)
Obsolete.

This is used to set the context from applicationhost without causing further notifications. It exists so that context can be updated quietly before doing the 'real' context notification because some applications fire actions onto other apps when the context changes and some actions are designed to depend upon context. In otherwords, a race condition.

SetContext(String)
Obsolete.

This is used to set the context from applicationhost without causing further notifications. It exists so that context can be updated quietly before doing the 'real' context notification because some applications fire actions onto other apps when the context changes and some actions are designed to depend upon context. In otherwords, a race condition.

SetStateData(String)

Sets the StateData to the controls

Events

ActionCompleted
Obsolete.

For internal use

ActionCompletedEvent

Event to notify ApplicationHost that an action has completed. Using CAB's EventBroker to publish the event topic.

ChangeContext

This event is for internal UII use only and should not be used directly. If your hosted control wants to recieve context change notification, you should be overriding NotifyContextChange method in your implementation.

RequestAction
Obsolete.

For internal use

RequestActionEvent

Event to request an action of another application to be invoked. Using CAB's EventBroker to publish the event topic.

RequestActionStatusEvent

Event to notify ApplicationHost of action status.

Applies to