Welcome
Guest
, you are in:
<root>
EnterpriseLibrary
FDOT Security STS
FDOT_Application_Model
GisFramework
•
Login
FDOT Wiki
GisFramework
¶
Gis Framework
Fdot Wiki
Random Page
All Pages
Categories
Search the wiki
»
Back
IInitialMessageProvider
Modified on Monday, 11 July 2011 08:08 AM
by 156.75.200.64
Categorized as
Startup Actions
The '''IInitialMessageProvider''' is an interface that allows custom messages to be provided to the [InitialMessagesAction]. The implemented '''IInitialMessageProvider''' is then configured for the [InitialMessagesAction]. To be usable the '''IInitialMessageProvider''' must be exportable from MEF as typeof(IInitialMessageProvider). {toc} ==Members== Here is the methods,properties, and events that need to be implemented on the interface. =====Events===== {| class = "tablesorter" ! Name !! Description |- | MessagesLoaded || '''This event must be raised to signal to the startupAction the messages are loaded by the provider.''' Failure to do this will hang the application at the point of message loading. |} =====Methods===== {| class = "tablesorter" ! Name !! Return Type !! Description |- | LoadMessages() || void || This method is called by the [InitialMessagesAction] to have the provider initiate the loading of messages. The logic of loading messages should be located inside this method. |} =====Properties===== {| class = "tablesorter" ! Name !! Type !! Description |- | InitialMessages || IEnumerable<[IInitialMessage]> || This is where the [IInitialMessages] that are loaded are set for reading by the [InitialMessagesAction]. |} ==Implemented Example== (((@@ [Export(typeof(IInitialMessageProvider))] public class OvpInitialMessageProvider:IInitialMessageProvider { private readonly List<IInitialMessage> _initialMessages = new List<IInitialMessage>(); public IEnumerable<IInitialMessage> InitialMessages { get { return _initialMessages; } } public void LoadMessages() { var binding = new BasicHttpBinding(); var address = new EndpointAddress(new Uri("http://localhost/ovpcomponents/OvpGisService.svc")); var svs = new OvpGisService.OvpGisServiceClient(binding, address); svs.GetGeneralMessagesCompleted += SvsGetGeneralMessagesCompleted; svs.GetGeneralMessagesAsync(); } void SvsGetGeneralMessagesCompleted(object sender, OvpGisService.GetGeneralMessagesCompletedEventArgs e) { _initialMessages.Add(new InitialMessage { HeadingText="General Messages", Messages=e.Result.OrderBy(o=>o.MessageOrder).Select(s=>s.MessageText) }); MessagesLoaded(this, null); } public event EventHandler MessagesLoaded; }@@))) ==See Also== {incoming}
Meta Keywords:
Meta Description:
Change Comment:
Any Questions or Comments? Email
GIS Framework Development Team
Some of the icons created by
FamFamFam
.