示例#1
0
    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));
          }
        }
      }
    }
示例#2
0
    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);
          }
        }
      }
    }
示例#3
0
    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);
          }
        }
      }
    }
示例#4
0
    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 ();
          }
        }
      }
    }
示例#5
0
 public void Handle (TMessageModule message)
 {
   if (ViewModel.NotNull ()) {
     if (message.NotNull ()) {
       if (message.IsModule (TResource.TModule.Shell).IsFalse ()) {
         ((IShellViewModel) ViewModel).Message (message);
       }
     }
   }
 }
示例#6
0
 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);
       }
     }
   }
 }
示例#8
0
    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 ();
            }
          }
        }
      }
    }
示例#9
0
    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);
          }
        }
      }
    }