public void Handle (TMessageModule message) { if (message.NotNull ()) { // shell if (message.IsModule (TResource.TModule.Shell)) { // SettingsValidating if (message.IsAction (TMessageAction.SettingsValidating)) { TDispatcher.Invoke (SettingsValidatingDispatcher); } // Request if (message.IsAction (TMessageAction.Request)) { TDispatcher.BeginInvoke (RequestDispatcher, TServiceRequest.Create (message)); } } // collection if (message.IsModule (TResource.TModule.Collection)) { // Request if (message.IsAction (TMessageAction.Request)) { TDispatcher.BeginInvoke (RequestDispatcher, TServiceRequest.Create (message)); } } // factory if (message.IsModule (TResource.TModule.Factory)) { // Request if (message.IsAction (TMessageAction.Request)) { TDispatcher.BeginInvoke (RequestDispatcher, TServiceRequest.Create (message)); } } } }
public override void ProcessMessage (TMessageModule message) { if (message.NotNull ()) { // services if (message.IsModule (TResource.TModule.Services)) { // SettingsValidated if (message.IsAction (TMessageAction.SettingsValidated)) { SelectAuthentication (message.Support.Argument.Types.Authentication); // sucess if (message.Support.IsActionStatus (TActionStatus.Success)) { TDispatcher.Invoke (DatabaseSettingsSuccessDispatcher); } // error if (message.Support.IsActionStatus (TActionStatus.Error)) { TDispatcher.Invoke (DatabaseSettingsErrorDispatcher); } } } // focus if (message.IsAction (TMessageAction.Focus)) { if (message.Support.Argument.Args.IsWhere (TWhere.Collection)) { OnCollectionCommadClicked (); } if (message.Support.Argument.Args.IsWhere (TWhere.Factory)) { OnFactoryCommadClicked (); } } } }
public void Handle (TMessageModule message) { if (message.NotNull ()) { // shell if (message.IsModule (TResource.TModule.Shell)) { // DatabaseValidated if (message.IsAction (TMessageAction.DatabaseValidated)) { // to child list var messageInternal = new TCollectionMessageInternal (TInternalMessageAction.DatabaseValidated, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.List); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } // RefreshProcess if (message.IsAction (TMessageAction.RefreshProcess)) { // to child list (Reload) var messageInternal = new TCollectionMessageInternal (TInternalMessageAction.Reload, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.List); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } } // services if (message.IsModule (TResource.TModule.Services)) { // Response if (message.IsAction (TMessageAction.Response)) { if (message.Node.IsModuleName (TModuleName.Collection)) { // to child var messageInternal = new TCollectionMessageInternal (message.Result, TInternalMessageAction.Response, TypeInfo); messageInternal.Node.SelectRelationParent (message.Node.Child); messageInternal.Support.Argument.Types.CopyFrom (message.Support.Argument.Types); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } } } // factory if (message.IsModule (TResource.TModule.Factory)) { // Reload if (message.IsAction (TMessageAction.Reload)) { // to child list var messageInternal = new TCollectionMessageInternal (TInternalMessageAction.Reload, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.List); DelegateCommand.PublishInternalMessage.Execute (messageInternal); // to module (Update) var messageModule = new TCollectionMessage (TMessageAction.Update, TypeInfo); messageModule.Node.SelectRelationModule (TChild.None); DelegateCommand.PublishMessage.Execute (messageModule); } } } }
public void Handle (TMessageModule message) { if (ViewModel.NotNull ()) { if (message.NotNull ()) { if (message.IsModule (TResource.TModule.Shell).IsFalse ()) { ((IShellViewModel) ViewModel).Message (message); } } } }
public void Handle (TMessageModule message) { if (message.NotNull ()) { // shell if (message.IsModule (TResource.TModule.Shell)) { // RefreshProcess if (message.IsAction (TMessageAction.RefreshProcess)) { // to child property (Edit Leave) var messageInternal = new TFactoryMessageInternal (TInternalMessageAction.EditLeave, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.Property); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } } // services if (message.IsModule (TResource.TModule.Services)) { // Response if (message.IsAction (TMessageAction.Response)) { if (message.Node.IsModuleName (TModuleName.Factory)) { // to child var messageInternal = new TFactoryMessageInternal (TInternalMessageAction.Response, TypeInfo); messageInternal.Node.SelectRelationParent (message.Node.Child); messageInternal.Support.Argument.Types.CopyFrom (message.Support.Argument.Types); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } } } //collection if (message.IsModule (TResource.TModule.Collection)) { // Edit if (message.IsAction (TMessageAction.Edit)) { // to child var messageInternal = new TFactoryMessageInternal (TInternalMessageAction.Edit, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.Property); messageInternal.Support.Argument.Args.Select (message.Support.Argument.Args.Param1); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } // RefreshModel if (message.IsAction (TMessageAction.RefreshModel)) { // to child var messageInternal = new TFactoryMessageInternal (TInternalMessageAction.RefreshModel, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.Property); messageInternal.Support.Argument.Types.CopyFrom (message.Support.Argument.Types); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } } } }
public void Handle (TMessageModule message) { // shell if (message.NotNull ()) { if (message.IsModule (TResource.TModule.Shell)) { if (message.IsAction (TMessageAction.Response)) { Model.Select (message.Support.Argument.Types.ConnectionData); } } } }
public void Handle (TMessageModule message) { if (message.NotNull ()) { // shell if (message.IsModule (TResource.TModule.Shell)) { if (message.IsAction (TMessageAction.DatabaseValidated)) { TDispatcher.Invoke (IniFileManagerDispatcher); } } } }
public void Handle (TMessageModule message) { if (message.NotNull ()) { // shell if (message.IsModule (TResource.TModule.Shell)) { if (message.IsAction (TMessageAction.DatabaseValidated)) { if (message.Support.Argument.Types.EntityAction.Param1 is TComponentModelItem item) { Model.Select (item); ApplyChanges (); } } } } }
internal void PublishModuleMessageHandler (TMessageModule message) { PublishInvoke (message); }
public void Message (TMessageModule message) { if (message.NotNull ()) { // error if (message.IsAction (TMessageAction.Error)) { TDispatcher.BeginInvoke (ShowErrorBoxDispatcher, message.Support.ErrorMessage); } // modal enter if (message.IsAction (TMessageAction.ModalEnter)) { if (m_ModalCount.Equals (0)) { Model.ModalEnter (); Model.ShowPanels (); ApplyChanges (); } m_ModalCount++; } // modal leave if (message.IsAction (TMessageAction.ModalLeave)) { if (m_ModalCount > 0) { m_ModalCount--; if (m_ModalCount.Equals (0)) { Model.ModalLeave (); Model.ClearPanels (); ApplyChanges (); } } } // edit enter if (message.IsAction (TMessageAction.EditEnter)) { Model.EditEnter (); ApplyChanges (); } // edit leave if (message.IsAction (TMessageAction.EditLeave)) { Model.EditLeave (); ApplyChanges (); } // show service report if (message.IsAction (TMessageAction.ReportShow)) { Model.ServiceReportShow (message.Support.Argument.Types.ReportData.Message); ApplyChanges (); } // clear service report if (message.IsAction (TMessageAction.ReportClear)) { Model.ServiceReportClear (); ApplyChanges (); } // Update if (message.IsAction (TMessageAction.Update)) { NotifyProcess (TCommandComm.Refresh); } ProcessMessage (message); } }
public virtual void ProcessMessage (TMessageModule message) { }
public override void ProcessMessage (TMessageModule message) { if (message.NotNull ()) { // services if (message.IsModule (TResource.TModule.Services)) { SelectAuthentication (message.Support.Argument.Types.Authentication); // SettingsValidated if (message.IsAction (TMessageAction.SettingsValidated)) { // Success if (message.Support.IsActionStatus (TActionStatus.Success)) { TDispatcher.Invoke (DatabaseSettingsSuccessDispatcher); } // Error if (message.Support.IsActionStatus (TActionStatus.Error)) { TDispatcher.Invoke (DatabaseSettingsErrorDispatcher); } } // Response if (message.IsAction (TMessageAction.Response)) { // (Select - Settings) if (message.Support.Argument.Types.IsOperation (TOperation.Select, TExtension.Settings)) { var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction); TDispatcher.BeginInvoke (SelectSettingsDispatcher, action); } // (Change - Settings) if (message.Support.Argument.Types.IsOperation (TOperation.Change, TExtension.Settings)) { var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction); TDispatcher.BeginInvoke (SelectSettingsDispatcher, action); } } } // factory if (message.IsModule (TResource.TModule.Factory)) { // Changed if (message.IsAction (TMessageAction.Changed)) { Model.Lock (); Model.ShowPanels (); Model.SnackbarContent.SetMessage (Properties.Resource.RES_VALIDATING); ApplyChanges (); TDispatcher.Invoke (OpenSnackbarDispatcher); TDispatcher.BeginInvoke (SaveSettingsDispatcher, message.Support.Argument.Types.ConnectionData); } // Authentication if (message.IsAction (TMessageAction.Authentication)) { Model.Lock (); Model.ShowPanels (); Model.SnackbarContent.SetMessage (Properties.Resource.RES_VALIDATING); ApplyChanges (); TDispatcher.Invoke (OpenSnackbarDispatcher); TDispatcher.BeginInvoke (ChangeAuthenticationDispatcher, message.Support.Argument.Types.Authentication); } // Request if (message.IsAction (TMessageAction.Request)) { Model.Lock (); Model.ShowPanels (); Model.SnackbarContent.SetMessage (Properties.Resource.RES_VALIDATING); ApplyChanges (); TDispatcher.Invoke (OpenSnackbarDispatcher); var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction); var msg = new TShellMessage (TMessageAction.Request, TypeInfo); msg.Support.Argument.Types.Select (action); DelegateCommand.PublishModuleMessage.Execute (msg); } } } }