protected override void Initialize () { // to parent var message = new TFactoryMessageInternal (TInternalMessageAction.DatabaseRequest, TAuthentication.SQL, TypeInfo); message.Node.SelectRelationChild (TChild.Front); DelegateCommand.PublishInternalMessage.Execute (message); }
public void Handle (TMessageInternal message) { if (message.NotNull ()) { if (message.IsModule (TResource.TModule.Factory)) { // from child only if (message.Node.IsRelationChild) { if (message.IsAction (TInternalMessageAction.DatabaseRequest)) { var authentication = message.Support.Argument.Types.Authentication; // to sibiling var messageInternal = new TFactoryMessageInternal (TInternalMessageAction.DatabaseResponse, authentication, TypeInfo); messageInternal.Node.SelectRelationParent (TChild.Front); messageInternal.Support.Argument.Types.ConnectionData.CopyFrom (Model.Request (authentication)); DelegateCommand.PublishInternalMessage.Execute (messageInternal); } if (message.IsAction (TInternalMessageAction.Change)) { // to module var messageModule = new TFactoryMessage (TMessageAction.Changed, TypeInfo); messageModule.Support.Argument.Types.ConnectionData.CopyFrom (message.Support.Argument.Types.ConnectionData); DelegateCommand.PublishMessage.Execute (messageModule); } } } } }
void ApplyDispatcher (TEntityAction action) { // to parent var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.Property, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); }
protected override void Initialize () { // to sibiling var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TAuthentication.Windows, TypeInfo); message.Node.SelectRelationSibling (TChild.Back); DelegateCommand.PublishInternalMessage.Execute (message); }
public void OnEditCommandClicked () { // to sibiling (Windows) var message = new TFactoryMessageInternal (TInternalMessageAction.EditEnter, TAuthentication.Windows, TypeInfo); message.Node.SelectRelationSibling (TChild.None); DelegateCommand.PublishInternalMessage.Execute (message); }
void ResponseDataDispatcher () { // to sibiling back var message = new TFactoryMessageInternal (TInternalMessageAction.Select, TAuthentication.SQL, TypeInfo); message.Node.SelectRelationSibling (TChild.Front); message.Support.Argument.Types.ConnectionData.CopyFrom (Model.DatabaseAuthentication); DelegateCommand.PublishInternalMessage.Execute (message); }
void NotifyChageDispatcher () { // notify parent var message = new TFactoryMessageInternal (TInternalMessageAction.Change, TypeInfo); message.Node.SelectRelationChild (TChild.Back); message.Support.Argument.Types.ConnectionData.CopyFrom (Model.DatabaseConnectionData); DelegateCommand.PublishInternalMessage.Execute (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 OnBackCommadClicked () { Model.ClearCheck (); ApplyChanges (); // to sibiling var message = new TFactoryMessageInternal (TInternalMessageAction.EditLeave, TAuthentication.SQL, TypeInfo); message.Node.SelectRelationSibling (TChild.None); DelegateCommand.PublishInternalMessage.Execute (message); }
void EditLeaveDispatcher () { // to parent leave focus var message = new TFactoryMessageInternal (TInternalMessageAction.NavigateForm, TChild.Property, TypeInfo); message.Support.Argument.Args.Select (TWhere.Collection); DelegateCommand.PublishInternalMessage.Execute (message); // to parent var msg = new TFactoryMessageInternal (TInternalMessageAction.EditLeave, TChild.Property, TypeInfo); DelegateCommand.PublishInternalMessage.Execute (msg); }
public void OnDatabaseApplyCommadClicked () { Model.Apply (); ApplyChanges (); // to sibiling front var message = new TFactoryMessageInternal (TInternalMessageAction.Change, TAuthentication.Windows, TypeInfo); message.Node.SelectRelationSibling (TChild.Back); message.Support.Argument.Types.ConnectionData.CopyFrom (Model.DatabaseConnectionData); DelegateCommand.PublishInternalMessage.Execute (message); TDispatcher.Invoke (NotifyChageDispatcher); }
void ResponseDataDispatcher (TEntityAction entityAction) { var gadgets = new Collection<TActionComponent> (); // Collection - Full (Material - Registration - Test) // Material if (entityAction.CategoryType.IsCategory (TCategory.Material)) { TActionConverter.Collection (TCategory.Material, gadgets, entityAction); Model.SelectMaterial (gadgets); } // Registration if (entityAction.CategoryType.IsCategory (TCategory.Registration)) { TActionConverter.Collection (TCategory.Registration, gadgets, entityAction); Model.SelectRegistration (gadgets); } // Test if (entityAction.CategoryType.IsCategory (TCategory.Test)) { // request if (entityAction.IdCollection.Any ()) { // to parent // Dummy - Select - Many var action = TEntityAction.Create ( TCategory.Dummy, TOperation.Select, TExtension.Many ); foreach (var item in entityAction.IdCollection) { action.IdCollection.Add (item); } action.Param2 = entityAction; // preserve var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); } else { TActionConverter.Collection (TCategory.Test, gadgets, entityAction); Model.SelectTest (gadgets); } } TDispatcher.Invoke (RefreshAllDispatcher); }
void RequestDataDispatcher () { // to parent // Test - Collection - Full var action = TEntityAction.Create ( TCategory.Test, TOperation.Collection, TExtension.Full ); var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); }
void ItemCheckedChangedDispatcher (GadgetTest gadget) { // to parent // Select = ById (Test) var action = TEntityAction.Create ( TCategory.Test, TOperation.Select, TExtension.ById ); action.Id = gadget.Id; action.Param2 = gadget; // preserve var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); }
void ModifyCommandDispatcher () { var component = TActionComponent.Create (TCategory.Result); Model.Request (component); var gadget = component.Models.GadgetResultModel; var action = TEntityAction.Create (TCategory.Result); action.Id = gadget.Id; TActionConverter.Request (TCategory.Result, component, action); // Result - Change - Content var entityAction = TEntityAction.Create (TCategory.Result, TOperation.Change, TExtension.Content); entityAction.CollectionAction.EntityCollection.Add (gadget.Id, action); // to parent var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (entityAction); DelegateCommand.PublishInternalMessage.Execute (message); }
void ChangeSuccessDispatcher () { if (Model.CanLock && m_CanLock) { m_CanLock = false; var component = TActionComponent.Create (TCategory.Result); Model.RequestLockedStatus (component); // Result - Change - Status var entityAction = TEntityAction.Create (TCategory.Result, TOperation.Change, TExtension.Status); TActionConverter.ModifyStatus (TCategory.Result, component, entityAction); // to parent var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (entityAction); DelegateCommand.PublishInternalMessage.Execute (message); } else { TDispatcher.Invoke (CleanupDispatcher); } }
void ResponseDataDispatcher (TEntityAction entityAction) { if (entityAction.NotNull ()) { // DATA IN: // action.CollectionAction.ModelCollection (Test collection) if (entityAction.IdCollection.Any ()) { // to parent // Dummy - Select - Many var action = TEntityAction.Create ( TCategory.Dummy, TOperation.Select, TExtension.Many ); foreach (var item in entityAction.IdCollection) { action.IdCollection.Add (item); } action.Param2 = entityAction; // preserve var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); } else { var gadgets = new Collection<TActionComponent> (); TActionConverter.Collection (TCategory.Test, gadgets, entityAction); Model.Select (gadgets); } } TDispatcher.Invoke (RefreshAllDispatcher); }
void ReloadDispatcher () { // to parent var message = new TFactoryMessageInternal (TInternalMessageAction.Reload, TChild.Property, TypeInfo); DelegateCommand.PublishInternalMessage.Execute (message); }