예제 #1
0
      public bool UpdateFrom (GadgetTest gadgetContent)
      {
        bool res = false;

        if (gadgetContent.NotNull ()) {
          if (gadgetContent.ValidateId) {
            // Test
            if (HasContentTest && gadgetContent.HasContentTest) {
              if (Contains (gadgetContent.Id)) {
                if (RequestTest (gadgetContent.Id) is GadgetTest gadgetItem) {
                  gadgetItem.ChangeFrom (gadgetContent);

                  // Target
                  if (gadgetItem.HasContentTarget) {
                    var list = new Collection<GadgetTarget> ();
                    gadgetItem.RequestContent (list);

                    foreach (var item in list) {
                      if (gadgetContent.RequestContentTarget (item.Id) is GadgetTarget gadget) {
                        item.ChangeFrom (gadget);
                        res = true;
                      }
                    }
                  }

                  // Test
                  if (gadgetItem.HasContentTest) {
                    var list = new Collection<GadgetTest> ();
                    gadgetItem.RequestContent (list);

                    foreach (var item in list) {
                      if (gadgetContent.RequestContentTest (item.Id) is GadgetTest gadget) {
                        item.UpdateFrom (gadget);
                        res = true;
                      }
                    }
                  }
                }
              }
            }

            // Target
            if (HasContentTarget && gadgetContent.HasContentTarget) {
              if (gadgetContent.HasContent) {
                var gadgetTargetList = new Collection<GadgetTarget> ();
                gadgetContent.RequestContent (gadgetTargetList);

                foreach (var gadgetTarget in gadgetTargetList) {
                  if (RequestTarget (gadgetTarget.Id) is GadgetTarget gadgetItem) {
                    gadgetItem.ChangeFrom (gadgetTarget);
                    res = true;
                  }
                }
              }
            }
          }
        }

        return (res);
      }
예제 #2
0
    public void Change (GadgetTest alias)
    {
      if (alias.NotNull ()) {
        base.Change (alias);

        Content.CopyFrom (alias.Content);
      }
    }
예제 #3
0
    public void CopyFrom (GadgetTest alias)
    {
      if (alias.NotNull ()) {
        base.CopyFrom (alias);

        Content.CopyFrom (alias.Content.Clone ());
      }
    }
예제 #4
0
 void UpdateContent (GadgetTest gadgetTest)
 {
   foreach (var gadget in TestCollection) {
     if (gadget.Id.Equals (gadgetTest.Id)) {
       gadget.UpdateFrom (gadgetTest);
       break;
     }
   }
 }
예제 #5
0
      internal bool Add (GadgetTest gadget)
      {
        var res = false;

        if (gadget.NotNull ()) {
          if (Contains (gadget.Id).IsFalse ()) {
            IdCollection.Add (gadget.Id);
            TestCollection.Add (gadget);

            res = true;
          }
        }

        return (res);
      }
예제 #6
0
    public bool UpdateFrom (GadgetTest gadget)
    {
      if (gadget.NotNull ()) {
        if (Contains (gadget.Id)) {
          if (string.IsNullOrEmpty (Description)) {
            Description = gadget.Description;
          }

          if (HasMaterial.IsFalse ()) {
            MaterialId = gadget.MaterialId;
            Material = gadget.Material;
            SetImage (gadget.GetImage ());
          }
        }
      }

      return (Content.UpdateFrom (gadget));
    }
예제 #7
0
 public void AddContent (GadgetTest gadget)
 {
   Content.Add (gadget);
 }
예제 #8
0
 internal bool Remove (GadgetTest gadget)
 {
   return (gadget.NotNull () ? Remove (gadget.Id) : false);
 }
예제 #9
0
 public bool UpdateValue (GadgetTest gadget)
 {
   return (Content.UpdateValue (gadget));
 }
예제 #10
0
 public bool RemoveContent (GadgetTest gadget)
 {
   return (Content.Remove (gadget));
 }
예제 #11
0
 public bool AddContent (GadgetTest gadget)
 {
   return (Content.Add (gadget));
 }
예제 #12
0
 public GadgetTest (GadgetTest alias)
   : this ()
 {
   CopyFrom (alias);
 }