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); }
public void Change (GadgetTest alias) { if (alias.NotNull ()) { base.Change (alias); Content.CopyFrom (alias.Content); } }
public void CopyFrom (GadgetTest alias) { if (alias.NotNull ()) { base.CopyFrom (alias); Content.CopyFrom (alias.Content.Clone ()); } }
void UpdateContent (GadgetTest gadgetTest) { foreach (var gadget in TestCollection) { if (gadget.Id.Equals (gadgetTest.Id)) { gadget.UpdateFrom (gadgetTest); break; } } }
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); }
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)); }
public void AddContent (GadgetTest gadget) { Content.Add (gadget); }
internal bool Remove (GadgetTest gadget) { return (gadget.NotNull () ? Remove (gadget.Id) : false); }
public bool UpdateValue (GadgetTest gadget) { return (Content.UpdateValue (gadget)); }
public bool RemoveContent (GadgetTest gadget) { return (Content.Remove (gadget)); }
public bool AddContent (GadgetTest gadget) { return (Content.Add (gadget)); }
public GadgetTest (GadgetTest alias) : this () { CopyFrom (alias); }