|
|
|
InfoJet POM Code Attributes |
|
|
Using InfoJet POM, the specialized DescriptionAtribute attributes should be added in the form codes to identity the class and the methods called by InfoJet Service.
|
|
|
The attribute EventType=Changed will be added on one field's XmlChangedEvent handler method, the method must be a public static method.
The MatchPath Attribute is required at the same time, the MatchPath value must be the absolute XPath of the field.
public void InternalStartup()
{
EventManager.XmlEvents["/my:myFields/my:field1"].Changed
+= new XmlChangedEventHandler(field1_Changed);
}
public void field1_Changed(object sender, XmlEventArgs e)
{
XmlFormProxy formProxy = new XmlFormProxy( this, sender, e );
On_field1_Changed( formProxy );
}
[System.ComponentModel.Description("InfoJet POM, EventType=Changed, MatchPath=/my:myFields/my:field1")]
public static void On_field1_Changed(XmlFormProxy formProxy)
{
formProxy.XmlEventSite.InnerXml = formProxy.XmlEventSite.InnerXml.ToUpper();
}
|
|
|
The attribute EventType=Clicked will be added on one button's ClickedChangedEvent handler method, the method must be a public static method.
The MatchPath value must be the control id of the button.
public void InternalStartup()
{
((ButtonEvent)EventManager.ControlEvents["CTRL2_5"]).Clicked
+= new ClickedEventHandler(CTRL2_5_Clicked);
}
public void CTRL2_5_Clicked(object sender, ClickedEventArgs e)
{
XmlFormProxy formProxy = new XmlFormProxy( this, sender, e );
On_CTRL2_5_Clicked( formProxy );
}
[System.ComponentModel.Description("InfoJet POM, EventType=Clicked, MatchPath=CTRL2_5")]
public static void On_CTRL2_5_Clicked(XmlFormProxy formProxy)
{
XPathNavigator field2 = formProxy.CreateMainDataSourceNavigator().SelectSingleNode("/my:myFields/my:field2", formProxy.NamespaceManager);
field2.InnerXml = field2.InnerXml.ToUpper();
}
|
|
|
The form loading event handler method is identitied by the EventType=Loading attribute, the method must be a public static method.
public void InternalStartup()
{
EventManager.FormEvents.Loading
+= new LoadingEventHandler(FormEvents_Loading);
}
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
XmlFormProxy formProxy = new XmlFormProxy( this, sender, e );
On_FormEvents_Loading( formProxy );
}
[System.ComponentModel.Description("InfoJet POM, EventType=Loading")]
public static void On_FormEvents_Loading(XmlFormProxy formProxy)
{
XPathNavigator field3 = formProxy.CreateMainDataSourceNavigator().SelectSingleNode("/my:myFields/my:field3", formProxy.NamespaceManager);
field3.InnerXml = field3.InnerXml.ToUpper();
}
|
|