void ResponseSelectByIdDispatcher (TEntityAction entityAction)
    {
      entityAction.ThrowNull ();

      if (entityAction.Param2 is GadgetTest gadget) {
        if (gadget.HasContentTarget) {
          var component = TActionComponent.Create (TCategory.Test);
          component.Models.GadgetTestModel.CopyFrom (gadget);

          TActionConverter.Select (TCategory.Test, component, entityAction);
          gadget.CopyFrom (component.Models.GadgetTestModel);

          Model.GadgetItemChecked (gadget, isChecked: gadget.IsChecked);

          // to Sibling
          var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.List, TypeInfo);
          message.Support.Argument.Args.Select (component);
          message.Support.Argument.Args.Select (gadget.IsChecked ? "GadgetAdd" : "GadgetRemove");

          if (Model.IsEditMode || Model.HasGadgetChecked) {
            message.Support.Argument.Types.ReportData.SelectLock ();
          }

          DelegateCommand.PublishInternalMessage.Execute (message);
        }

        TDispatcher.Invoke (RefreshAllDispatcher);
      }
    }
Exemple #2
0
    void RequestDesignDispatcher (TEntityAction action)
    {
      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Response, TChild.Design, TypeInfo);
      message.Support.Argument.Types.Select (action);

      DelegateCommand.PublishInternalMessage.Execute (message);
    }
    void RequestModelDispatcher (TEntityAction action)
    {
      // request from Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Request, TChild.Property, TypeInfo);
      message.Support.Argument.Types.Select (action);

      DelegateCommand.PublishInternalMessage.Execute (message);
    }
Exemple #4
0
    void CleanupDispatcher ()
    {
      Cleanup ();

      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Cleanup, TChild.Property, TypeInfo);
      DelegateCommand.PublishInternalMessage.Execute (message);
    }
Exemple #5
0
    void ResponseSelectByIdDispatcher (TEntityAction action)
    {
      // to Sibling (Select By Id)
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Select, TChild.List, TypeInfo);
      message.Support.Argument.Types.Item.CopyFrom (TComponentModelItem.Create (action));

      DelegateCommand.PublishInternalMessage.Execute (message);
    }
    void CleanupDispatcher ()
    {
      m_CanLock = false;

      Model.Cleanup ();
      TDispatcher.Invoke (RefreshAllDispatcher);

      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Back, TChild.List, TypeInfo);
      DelegateCommand.PublishInternalMessage.Execute (message);
    }
    void MaterialSelectionChangedDispatcher ()
    {
      var component = TActionComponent.Create (TCategory.Material);
      Model.Request (component);

      // to sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Select, TChild.List, TypeInfo);
      message.Support.Argument.Args.Select (component);

      DelegateCommand.PublishInternalMessage.Execute (message);
    }
    void PropertySelect (string propertyName)
    {
      if (Model.ValidateProperty (propertyName)) {
        // to Sibling
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
        message.Support.Argument.Args.Select (Model.GadgetModel);
        message.Support.Argument.Args.Select (propertyName);

        DelegateCommand.PublishInternalMessage.Execute (message);
      }

      ApplyChanges ();
    }
Exemple #9
0
    void RegistrationItemSelectedDispatcher (GadgetRegistration gadget)
    {
      Model.RegistrationCurrentSelected (gadget);

      ApplyChanges ();

      // to Sibling (PropertySelect)
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.List, TypeInfo);
      message.Support.Argument.Args.Select ("RegistrationChanged");
      message.Support.Argument.Args.Select (gadget);

      DelegateCommand.PublishInternalMessage.Execute (message);
    }
    void PropertySelect (string propertyName)
    {
      var action = TEntityAction.CreateDefault;
      Model.RequestModel (action);

      // to Sibling (PropertySelect)
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
      message.Support.Argument.Types.Select (action);
      message.Support.Argument.Args.Select (propertyName);

      DelegateCommand.PublishInternalMessage.Execute (message);

      ApplyChanges ();
    }
    void PropertySelect (string propertyName)
    {
      var component = TActionComponent.Create (TCategory.Registration);
      Model.Request (component);

      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
      message.Support.Argument.Args.Select (propertyName);
      message.Support.Argument.Args.Select (component);

      DelegateCommand.PublishInternalMessage.Execute (message);

      ApplyChanges ();
    }
Exemple #12
0
    void GadgetChangedDispatcher ()
    {
      if (Model.GadgetChanged ()) {
        // to Sibling (Select)
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Select, TChild.List, TypeInfo);
        //message.Support.Argument.Args.Select (gadgetComponent);
        // TODO: what for??
        //DelegateCommand.PublishInternalMessage.Execute (message);
      }

      else {
        // to Sibling (Cleanup)
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Cleanup, TChild.List, TypeInfo);
        DelegateCommand.PublishInternalMessage.Execute (message);
      }
    }
Exemple #13
0
    void RequestModelDispatcher (TEntityAction action)
    {
      if (action.NotNull ()) {
        var component = TActionComponent.Create (TCategory.Result);
        Model.Request (component);

        TActionConverter.Request (TCategory.Result, component, action);
        action.Param1 = component;

        // to Sibling
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Response, TChild.List, TypeInfo);
        message.Support.Argument.Types.Select (action);

        DelegateCommand.PublishInternalMessage.Execute (message);
      }
    }
Exemple #14
0
    void EditDispatcher (TActionComponent component)
    {
      // Id must exist
      if (Model.EditEnter (component)) {
        SelectViewMode (TViewMode.Edit);

        TDispatcher.Invoke (RefreshAllDispatcher);
        TDispatcher.Invoke (EditEnterDispatcher);

        // to Sibling
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
        message.Support.Argument.Args.Select (component);
        message.Support.Argument.Args.Select ("edit");

        DelegateCommand.PublishInternalMessage.Execute (message);
      }
    }
    void EditDispatcher (object param1)
    {
      if (param1 is TActionComponent model) {
        SelectViewMode (TViewMode.Edit);

        Model.SelectModel (model);

        TDispatcher.Invoke (RefreshAllDispatcher);
        TDispatcher.Invoke (EditEnterDispatcher);

        // to Sibling
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.Edit, TChild.Property, TypeInfo);
        message.Support.Argument.Args.Select (model);

        DelegateCommand.PublishInternalMessage.Execute (message);
      }
    }
Exemple #16
0
    void PropertySelect (string propertyName)
    {
      if (propertyName.Equals ("TextProperty", StringComparison.InvariantCulture)) {
        Model.ValidateProperty ();
      }

      var action = TEntityAction.Create(TCategory.Test);
      Model.RequestModel (action);

      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
      message.Support.Argument.Types.Select (action);
      message.Support.Argument.Args.Select (propertyName);

      DelegateCommand.PublishInternalMessage.Execute (message);

      ApplyChanges ();
    }
Exemple #17
0
    void EditDispatcher (TEntityAction action)
    {
      // Id must exist
      if (action.Id.NotEmpty ()) {
        SelectViewMode (TViewMode.Edit);

        Model.SelectModel (action);

        TDispatcher.Invoke (RefreshAllDispatcher);
        TDispatcher.Invoke (EditEnterDispatcher);

        // to Sibling
        var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.Property, TypeInfo);
        message.Support.Argument.Types.Select (action);
        message.Support.Argument.Args.Select ("all");

        DelegateCommand.PublishInternalMessage.Execute (message);
      }
    }
Exemple #18
0
    void ItemCheckedChangedDispatcher (GadgetTarget gadget)
    {
      Model.GadgetItemChecked (gadget);

      TDispatcher.Invoke (RefreshAllDispatcher);

      var component = TActionComponent.Create (TCategory.Target);
      component.Models.GadgetTargetModel.CopyFrom (gadget);

      Model.Request (component);

      // to Sibling
      var message = new TFactorySiblingMessageInternal (TInternalMessageAction.PropertySelect, TChild.List, TypeInfo);
      message.Support.Argument.Args.Select (component);
      message.Support.Argument.Args.Select (gadget.IsChecked ? "GadgetAdd" : "GadgetRemove");

      if (Model.IsEditMode || Model.HasGadgetChecked) {
        message.Support.Argument.Types.ReportData.SelectLock ();
      }

      DelegateCommand.PublishInternalMessage.Execute (message);
    }