Esempio n. 1
0
    void LoadDatabaseSettings (string filePath, string fileName)
    {
      DatabaseConnection = DatabaseConnection ?? new TDatabaseConnection (filePath, fileName);

      // database
      if (DatabaseConnection.Request ()) {
        // notify factory database
        // SQL
        var message = new TShellMessage (TMessageAction.Response, TypeInfo);
        message.Support.Argument.Types.ConnectionData.CopyFrom (DatabaseConnection.Request (TAuthentication.SQL));

        DelegateCommand.PublishModuleMessage.Execute (message);

        // Windows
        message = new TShellMessage (TMessageAction.Response, TypeInfo);
        message.Support.Argument.Types.ConnectionData.CopyFrom (DatabaseConnection.Request (TAuthentication.Windows));

        DelegateCommand.PublishModuleMessage.Execute (message);

        // settings validating
        TDispatcher.Invoke (RequestServiceValidationDispatcher);
      }

      else {
        var errorMessage = new TErrorMessage (Properties.Resource.RES_ERROR, Properties.Resource.RES_LOAD_DATABASE, (string) DatabaseConnection.Result.ErrorContent)
        {
          Severity = TSeverity.Hight
        };

        TDispatcher.BeginInvoke (ShowErrorBoxDispatcher, errorMessage);
      }
    }
 public void OnContentTargetSelectionChanged (object context)
 {
   // content Target
   if (context is GadgetTest gadget) {
     TDispatcher.BeginInvoke (ContentTargetChangedDispatcher, gadget);
   }
 }
Esempio n. 3
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.Design, TypeInfo)) {
            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                var propertyName = message.Support.Argument.Args.PropertyName;

                Model.SelectModel (component);
              }

              TDispatcher.Invoke (RefreshDesignDispatcher);
            }

            // Request
            if (message.IsAction (TInternalMessageAction.Request)) {
              TDispatcher.BeginInvoke (RequestDesignDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              TDispatcher.Invoke (RefreshDesignDispatcher);
            }
          }
        }
      }
    }
Esempio n. 4
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.List)) {
            // DatabaseValidated
            if (message.IsAction (TInternalMessageAction.DatabaseValidated)) {
              TDispatcher.Invoke (RequestDataDispatcher);
            }

            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Collection-Full
              if (message.Support.Argument.Types.IsOperation (TOperation.Collection, TExtension.Full)) {
                if (message.Result.IsValid) {
                  // Gadget Material
                  if (message.Support.Argument.Types.IsOperationCategory (TCategory.Material)) {
                    var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                    TDispatcher.BeginInvoke (MaterialCollectionFullDispatcher, action);
                  }
                }
              }
            }
          }

          // from sibilig
          if (message.Node.IsSiblingToMe (TChild.List, TypeInfo)) {
            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              var propertyName = message.Support.Argument.Args.PropertyName;

              if (propertyName.Equals ("edit", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  TDispatcher.BeginInvoke (EditDispatcher, component);
                }
              }

              if (propertyName.Equals ("GadgetAdd", StringComparison.InvariantCulture) || propertyName.Equals ("GadgetRemove", StringComparison.InvariantCulture)) {
                Model.PropertyChanged (message.Support.Argument.Args.PropertyName, message.Support.Argument.Types.ReportData.Locked);

                TDispatcher.Invoke (RefreshAllDispatcher);
              }
            }

            // Reload
            if (message.IsAction (TInternalMessageAction.Reload)) {
              // to parent
              DelegateCommand.PublishInternalMessage.Execute (message);
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              Model.Cleanup ();
              TDispatcher.Invoke (RefreshAllDispatcher);
            }
          }
        }
      }
    }
Esempio n. 5
0
    void DatabaseSettingsSuccessDispatcher ()
    {
      // notify main process
      NotifyProcess (TCommandComm.Success);

      // update INI file
      var filePath = System.Environment.CurrentDirectory;
      var fileName = TNames.SettingsIniFileName;

      var data = new TDatabaseConnection (filePath, fileName);

      if (data.Request ()) {
        TDispatcher.Invoke (CloseSnackbarDispatcher);

        Model.SnackbarContent.SetMessage (Properties.Resource.RES_WELLCOME);
        TDispatcher.BeginInvoke (ShowSnackbarDispatcher, false);

        TDispatcher.Invoke (DatabaseValidateDispatcher);
      }

      else {
        var errorMessage = new TErrorMessage (Properties.Resource.RES_ERROR, Properties.Resource.RES_LOAD, (string) data.Result.ErrorContent)
        {
          Severity = TSeverity.Hight
        };

        TDispatcher.BeginInvoke (ShowErrorBoxDispatcher, errorMessage);
      }
    }
Esempio n. 6
0
    void SaveSettingsDispatcher (TDatabaseAuthentication databaseAuthentication)
    {
      var filePath = System.Environment.CurrentDirectory;
      var fileName = TNames.SettingsIniFileName;

      DatabaseConnection = DatabaseConnection ?? new TDatabaseConnection (filePath, fileName);

      if (DatabaseConnection.Save (databaseAuthentication)) {
        DatabaseConnection.Request (); // update

        // notify edit
        var message = new TShellMessage (TMessageAction.Response, TypeInfo);
        message.Support.Argument.Types.ConnectionData.CopyFrom (databaseAuthentication);

        DelegateCommand.PublishModuleMessage.Execute (message);

        // settings validating
        TDispatcher.Invoke (RequestServiceValidationDispatcher);
      }

      else {
        TDispatcher.Invoke (CloseSnackbarDispatcher);

        var errorMessage = new TErrorMessage (Properties.Resource.RES_ERROR, Properties.Resource.RES_SAVE, (string) DatabaseConnection.Result.ErrorContent)
        {
          Severity = TSeverity.Hight
        };

        TDispatcher.BeginInvoke (ShowErrorBoxDispatcher, errorMessage);
      }
    }
Esempio n. 7
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));
          }
        }
      }
    }
Esempio n. 8
0
    void ResponseModelDispatcher (TEntityAction action)
    {
      if (action.SupportAction.Rule.IsCommit ("gadget")) {
        action.SupportAction.Rule.Remove ("gadget");

        TDispatcher.BeginInvoke (ApplyDispatcher, action);
      }
    }
Esempio n. 9
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Collection)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.List)) {
            // DatabaseValidated
            if (message.IsAction (TInternalMessageAction.DatabaseValidated)) {
              TDispatcher.Invoke (RequestDataDispatcher);
            }

            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Collection-Full
              if (message.Support.Argument.Types.IsOperation (Server.Models.Infrastructure.TOperation.Collection, Server.Models.Infrastructure.TExtension.Full)) {
                if (message.Result.IsValid) {
                  // Gadget Target
                  if (message.Support.Argument.Types.IsOperationCategory (Server.Models.Infrastructure.TCategory.Target)) {
                    var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                    TDispatcher.BeginInvoke (ResponseDataDispatcher, action);
                  }

                  // Gadget Material
                  if (message.Support.Argument.Types.IsOperationCategory (Server.Models.Infrastructure.TCategory.Material)) {
                    var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                    TDispatcher.BeginInvoke (RefreshModelDispatcher, action);
                  }
                }
              }

              // Select-ById
              if (message.Support.Argument.Types.IsOperation (Server.Models.Infrastructure.TOperation.Select, Server.Models.Infrastructure.TExtension.ById)) {
                if (message.Result.IsValid) {
                  var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                  TDispatcher.BeginInvoke (ResponseModelDispatcher, action);
                }
              }
            }

            // Reload
            if (message.IsAction (TInternalMessageAction.Reload)) {
              TDispatcher.Invoke (RefreshAllDispatcher);
              TDispatcher.Invoke (RequestDataDispatcher);
            }
          }

          // from sibilig
          if (message.Node.IsSiblingToMe (TChild.List, TypeInfo)) {
            // Reload
            if (message.IsAction (TInternalMessageAction.Reload)) {
              TDispatcher.Invoke (RefreshAllDispatcher);
              TDispatcher.Invoke (RequestDataDispatcher);
              TDispatcher.Invoke (ReloadDispatcher);
            }
          }
        }
      }
    }
    void IniFileManagerDispatcher ()
    {
      Model.CleanupProcess ();

      var filePath = System.Environment.CurrentDirectory;
      var fileName = TNames.SettingsIniFileName;

      var iniFileManager = TIniFileManager.CreatDefault;
      iniFileManager.SelectPath (filePath, fileName);

      if (iniFileManager.ValidatePath ().IsValid) {
        // Process Module section
        if (iniFileManager.ContainsSection (TProcess.PROCESSMODULESSECTION)) {
          // Process Names section
          if (iniFileManager.ContainsSection (TProcess.PROCESSNAMESSECTION)) {
            // [ProcessNamesSection]
            // ProcessNames=ModuleSettings? GadgetMaterial?GadgetTarget? GadgetTest?GadgetRegistration? GadgetTests?GadgetReport                   
            
            var processNames = iniFileManager.RequestKey (TProcess.PROCESSNAMESSECTION, TProcess.PROCESSNAMES);
            var allProcessNames = processNames.Split ('?');

            for (int i = 0; i < allProcessNames.Length; i++) {
              var processNameSection = allProcessNames [i];

              if (iniFileManager.ContainsSection (processNameSection)) {
                /* 
                 [ModuleSettings]
                  ProcessIsAlive=True
                  PaletteTheme=light
                  PalettePrimary=blue
                  PaletteAccent=lime
                */
                
                var isAlive = iniFileManager.RequestKey (processNameSection, TProcess.PROCESSISALIVE);

                var baseTheme = iniFileManager.RequestKey (processNameSection, TProcess.PALETTETHEME);
                var primaryColor = iniFileManager.RequestKey (processNameSection, TProcess.PALETTEPRIMARY);
                var accentColor = iniFileManager.RequestKey (processNameSection, TProcess.PALETTEACCENT);

                var paletteInfo = TPaletteInfo.Create (baseTheme, primaryColor, accentColor);

                Model.AddProcessInfo (processNameSection, bool.Parse (isAlive), paletteInfo);
              }
            }

            if (Model.SelectProcess ()) {
              TDispatcher.BeginInvoke (ProcessSelectedDispatcher, Model.CurrentProcess);
            }
          }
        }
      }

      TDispatcher.Invoke (RefreshDispatcher);
    }
Esempio n. 11
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.Design, TypeInfo)) {
            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              var propertyName = message.Support.Argument.Args.PropertyName;

              if (propertyName.Equals ("GadgetAdd", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  Model.AddModel (component);
                }

                TDispatcher.Invoke (RefreshDesignDispatcher);
              }

              if (propertyName.Equals ("GadgetRemove", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  Model.RemoveModel (component);
                }

                TDispatcher.Invoke (RefreshDesignDispatcher);
              }

              if (propertyName.Equals ("edit", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  Model.Edit (component);
                }

                TDispatcher.Invoke (RefreshDesignDispatcher);
              }

              var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);

              if (action.NotNull ()) {
                action.Param1 = propertyName;
                TDispatcher.BeginInvoke (PropertySelectDispatcher, action);
              }
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              Model.Cleanup ();
              TDispatcher.Invoke (RefreshDesignDispatcher);
            }
          }
        }
      }
    }
Esempio n. 12
0
    void LoadSupportSettings (string filePath, string fileName)
    {
      SupportSettings = SupportSettings ?? TSupportSettings.Create (filePath, fileName);

      // supprt
      if (SupportSettings.Validate ().IsFalse ()) {
        var errorMessage = new TErrorMessage (Properties.Resource.RES_ERROR, Properties.Resource.RES_LOAD_SUPPORT, (string) SupportSettings.Result.ErrorContent)
        {
          Severity = TSeverity.Hight
        };

        TDispatcher.BeginInvoke (ShowErrorBoxDispatcher, errorMessage);
      }
    }
Esempio n. 13
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.Property)) {
            // RefreshModel
            if (message.IsAction (TInternalMessageAction.RefreshModel)) {
              TDispatcher.BeginInvoke (RefreshModelDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Edit
            if (message.IsAction (TInternalMessageAction.Edit)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                TDispatcher.BeginInvoke (EditDispatcher, component);
              }
            }

            // EditLeave
            if (message.IsAction (TInternalMessageAction.EditLeave)) {
              if (IsViewModeEdit) {
                OnCancelCommadClicked ();
              }
            }

            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Insert
              if (message.Support.Argument.Types.IsOperation (TOperation.Insert)) {
                TDispatcher.Invoke (InsertSuccessDispatcher);
              }

              // Change - Full
              if (message.Support.Argument.Types.IsOperation (TOperation.Change, TExtension.Full)) {
                TDispatcher.Invoke (ChangeSuccessDispatcher);
              }
            }
          }

          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.Property, TypeInfo)) {
            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              TDispatcher.BeginInvoke (ResponseModelDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }
          }
        }
      }
    }
Esempio n. 14
0
    public void OnApplyCommadClicked ()
    {
      Model.ShowPanels ();
      ApplyChanges ();

      var action = TEntityAction.Create (TCategory.Material, TOperation.Insert);

      if (IsViewModeEdit) {
        action = TEntityAction.Create (TCategory.Material, TOperation.Change, TExtension.Full);
      }

      Model.RequestModel (action);

      TDispatcher.BeginInvoke (ApplyDispatcher, action);
    }
Esempio n. 15
0
    public void OnApplyCommadClicked ()
    {
      Model.ShowPanels ();
      ApplyChanges ();

      // Insert
      var action = TEntityAction.Create (TCategory.Result, TOperation.Insert);

      if (IsViewModeEdit) {
        // Change-Full
        action = TEntityAction.Create (TCategory.Result, TOperation.Change, TExtension.Full);
      }

      TDispatcher.BeginInvoke (RequestModelDispatcher, action);
    }
Esempio n. 16
0
    public void OnApplyCommadClicked ()
    {
      Model.ShowPanels ();
      ApplyChanges ();

      // Insert
      var action = TEntityAction.Create (Server.Models.Infrastructure.TCategory.Report, Server.Models.Infrastructure.TOperation.Insert);

      if (IsViewModeEdit) {
        // Change-Full
        action = TEntityAction.Create (Server.Models.Infrastructure.TCategory.Report, Server.Models.Infrastructure.TOperation.Change, Server.Models.Infrastructure.TExtension.Full);
      }

      Model.RequestModel (action);

      TDispatcher.BeginInvoke (ApplyDispatcher, action);
    }
Esempio n. 17
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.List)) {
            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Change - Content
              if (message.Support.Argument.Types.IsOperation (TOperation.Change, TExtension.Content)) {
                if (message.Result.IsValid) {
                  TDispatcher.Invoke (ChangeSuccessDispatcher);
                }
              }

              // Change - Status
              if (message.Support.Argument.Types.IsOperation (TOperation.Change, TExtension.Status)) {
                if (message.Result.IsValid) {
                  TDispatcher.Invoke (CleanupDispatcher);
                }
              }
            }
          }

          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.List, TypeInfo)) {
            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              var propertyName = message.Support.Argument.Args.PropertyName;

              if (propertyName.Equals ("modify", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  TDispatcher.BeginInvoke (ModifyDispatcher, component);
                }
              }
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              Model.Cleanup ();
              TDispatcher.Invoke (RefreshAllDispatcher);
            }
          }
        }
      }
     }
Esempio n. 18
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Collection)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.Display)) {
            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Remove
              if (message.Support.Argument.Types.IsOperation (TOperation.Remove)) {
                if (message.Result.IsValid) {
                  Model.Cleanup ();
                  ApplyChanges ();

                  // notify List            
                  TDispatcher.Invoke (ReloadDispatcher);
                }
              }
            }
          }

          // from sibilig
          if (message.Node.IsSiblingToMe (TChild.Display, TypeInfo)) {
            // Select
            if (message.IsAction (TInternalMessageAction.Select)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                if (message.Support.Argument.Args.Param2 is Dictionary<Guid, GadgetMaterial> materialDictionary) {
                  var tuple = Tuple.Create (component, materialDictionary);

                  TDispatcher.BeginInvoke (SelectDispatcher, tuple);
                }
              }
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              TDispatcher.Invoke (CleanupDispatcher);
            }
          }
        }
      }
    }
Esempio n. 19
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.Design, TypeInfo)) {
            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
              var propertyName = message.Support.Argument.Args.PropertyName;

              if (propertyName.Equals ("edit", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  Model.SelectModel (component, propertyName);
                }
              }

              else {
                var component = TActionComponent.Create (TCategory.Target);
                TActionConverter.Select (TCategory.Target, component, action);

                Model.SelectModel (component, propertyName);
              }

              TDispatcher.Invoke (RefreshDesignDispatcher);
            }

            // Request
            if (message.IsAction (TInternalMessageAction.Request)) {
              TDispatcher.BeginInvoke (RequestDesignDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              Model.Cleanup ();
              TDispatcher.Invoke (RefreshDesignDispatcher);
            }
          }
        }
      }
    }
Esempio n. 20
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Collection)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.Display)) {
            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Remove
              if (message.Support.Argument.Types.IsOperation (Server.Models.Infrastructure.TOperation.Remove)) {
                if (message.Result.IsValid) {
                  Model.Cleanup ();
                  ApplyChanges ();

                  // notify List            
                  TDispatcher.Invoke (ReloadDispatcher);
                }
              }
            }
          }

          // from sibilig
          if (message.Node.IsSiblingToMe (TChild.Display, TypeInfo)) {
            // Select
            if (message.IsAction (TInternalMessageAction.Select)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                TDispatcher.BeginInvoke (SelectDispatcher, component);
              }
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              TDispatcher.Invoke (CleanupDispatcher);
            }
          }
        }
      }
    }
Esempio n. 21
0
 public void OnGadgetMaterialCommadClicked ()
 {
   TDispatcher.BeginInvoke (StartProcessDispatcher, TProcess.TName.GadgetMaterial);
 }
Esempio n. 22
0
 void ResponseModelDispatcher (TEntityAction action)
 {
   TDispatcher.BeginInvoke (ApplyDispatcher, action);  
 }
Esempio n. 23
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.Property)) {
            // RefreshModel
            if (message.IsAction (TInternalMessageAction.RefreshModel)) {
              TDispatcher.BeginInvoke (RefreshModelDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Edit
            if (message.IsAction (TInternalMessageAction.Edit)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                TDispatcher.BeginInvoke (EditDispatcher, component);
              }

            }

            // EditLeave
            if (message.IsAction (TInternalMessageAction.EditLeave)) {
              if (IsViewModeEdit) {
                OnCancelCommadClicked ();
              }
            }

            // Modify
            if (message.IsAction (TInternalMessageAction.Modify)) {
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                TDispatcher.BeginInvoke (ModifyDispatcher, component);
              }

            }

            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Insert
              if (message.Support.Argument.Types.IsOperation (TOperation.Insert)) {
                TDispatcher.Invoke (InsertSuccessDispatcher);
              }

              // Change - Full
              if (message.Support.Argument.Types.IsOperation (TOperation.Change, TExtension.Full)) {
                TDispatcher.Invoke (ChangeSuccessDispatcher);
              }
            }
          }

          // from Sibling
          if (message.Node.IsSiblingToMe (TChild.Property, TypeInfo)) {
            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              TDispatcher.BeginInvoke (ResponseModelDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Response
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              if (message.Support.Argument.Args.PropertyName.Equals ("RegistrationChanged", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is GadgetRegistration gadget) {
                  Model.Select (gadget);

                  ApplyChanges ();
                }
              }
            }

            // Back
            if (message.IsAction (TInternalMessageAction.Back)) {
              TDispatcher.Invoke (ChangeSuccessDispatcher);
            }
          }
        }
      }
    }
Esempio n. 24
0
 void ResponseModelDispatcher (TEntityAction action)
 {
   if (Model.RequestModel (action)) {
     TDispatcher.BeginInvoke (ApplyDispatcher, action);
   }
 }
Esempio n. 25
0
 public void OnResultChanged (GadgetResult gadget)
 {
   TDispatcher.BeginInvoke (ResultChangedDispatcher, gadget);
 }
Esempio n. 26
0
    public void Handle (TMessageInternal message)
    {
      if (message.NotNull ()) {
        if (message.IsModule (TResource.TModule.Factory)) {
          // from parent
          if (message.Node.IsParentToMe (TChild.List)) {
            // DatabaseValidated
            if (message.IsAction (TInternalMessageAction.DatabaseValidated)) {
              TDispatcher.Invoke (RequestDataDispatcher);
            }

            // Response
            if (message.IsAction (TInternalMessageAction.Response)) {
              // Collection - Full
              if (message.Support.Argument.Types.IsOperation (TOperation.Collection, TExtension.Full)) {
                if (message.Result.IsValid) {
                  // Gadget Test
                  if (message.Support.Argument.Types.IsOperationCategory (TCategory.Test)) {
                    var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                    TDispatcher.BeginInvoke (ResponseDataDispatcher, action);
                  }
                }
              }

              // Select - Many
              if (message.Support.Argument.Types.IsOperation (TOperation.Select, TExtension.Many)) {
                if (message.Result.IsValid) {
                  var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                  TDispatcher.BeginInvoke (ResponseSelectManyDispatcher, action);
                }
              }

              // Select - ById
              if (message.Support.Argument.Types.IsOperation (TOperation.Select, TExtension.ById)) {
                if (message.Result.IsValid) {
                  // Gadget Test
                  if (message.Support.Argument.Types.IsOperationCategory (TCategory.Test)) {
                    var action = TEntityAction.Request (message.Support.Argument.Types.EntityAction);
                    TDispatcher.BeginInvoke (ResponseSelectByIdDispatcher, action);
                  }
                }
              }
            }
          }

          // from sibilig
          if (message.Node.IsSiblingToMe (TChild.List, TypeInfo)) {
            // Select
            if (message.IsAction (TInternalMessageAction.Select)) {
              // material
              if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                Model.MaterialItemChanged (component);
              }

              TDispatcher.Invoke (RefreshAllDispatcher);
            }

            // PropertySelect
            if (message.IsAction (TInternalMessageAction.PropertySelect)) {
              if (message.Support.Argument.Args.PropertyName.Equals ("edit", StringComparison.InvariantCulture)) {
                if (message.Support.Argument.Args.Param1 is TActionComponent component) {
                  TDispatcher.BeginInvoke (EditDispatcher, component);
                }
              }
            }

            // Request
            if (message.IsAction (TInternalMessageAction.Request)) {
              TDispatcher.BeginInvoke (RequestDesignDispatcher, TEntityAction.Request (message.Support.Argument.Types.EntityAction));
            }

            // Cleanup
            if (message.IsAction (TInternalMessageAction.Cleanup)) {
              Model.Cleanup ();

              TDispatcher.Invoke (RefreshAllDispatcher);
              TDispatcher.Invoke (RequestDataDispatcher);
            }
          }
        }
      }
    }
Esempio n. 27
0
 public void OnGadgetItemUnchecked (GadgetTest gadget)
 {
   TDispatcher.BeginInvoke (ItemCheckedChangedDispatcher, gadget);
 }
Esempio n. 28
0
 public void OnTestItemUnchecked (object value)
 {
   if (value is TActionComponent component) {
     TDispatcher.BeginInvoke (TestItemUncheckedDispatcher, component);
   }
 }
Esempio n. 29
0
 public void OnGadgetReportCommadClicked ()
 {
   TDispatcher.BeginInvoke (StartProcessDispatcher, TProcess.TName.GadgetReport);
 }
Esempio n. 30
0
 public void OnGadgetRegistrationCommadClicked ()
 {
   TDispatcher.BeginInvoke (StartProcessDispatcher, TProcess.TName.GadgetRegistration);
 }