static void Request (TContentClient rootClient, GadgetTest rootGadget) { if (rootClient.NotNull () && rootGadget.NotNull ()) { rootClient.RequestData (rootGadget); if (rootClient.ClientList.Any ()) { foreach (var client in rootClient.ClientList) { var category = TCategoryType.FromValue (client.Category); // Target if (category.Equals (TCategory.Target)) { var gadgetTarget = GadgetTarget.CreateDefault; client.RequestData (gadgetTarget); rootGadget.AddContent (gadgetTarget); } // Test if (category.Equals (TCategory.Test)) { var gadgetTest = GadgetTest.CreateDefault; Request (client, gadgetTest); rootGadget.AddContent (gadgetTest); } } } } }
TComponentControlModel (GadgetTest gadget) : this () { if (gadget.NotNull ()) { ControlModel.CopyFrom (gadget); } }
public void SelectModel (GadgetTest gadget) { if (gadget.NotNull ()) { ControlModel.GadgetName = gadget.GadgetName; ControlModel.Description = gadget.Description; ControlModel.ExternalLink = gadget.ExternalLink; if (gadget.ValidateId) { if (ControlModel.Contains (gadget.Id).IsFalse ()) { ComponentControlModels.Clear (); ControlModel.CopyFrom (gadget); if (ControlModel.HasContentTest) { var contents = new Collection<GadgetTest> (); ControlModel.RequestContent (contents); foreach (var gadgetTest in contents) { var controlModel = TComponentControlModel.CreateDefault; controlModel.ControlModel.CopyFrom (gadgetTest.Clone ()); ComponentControlModels.Add (controlModel); } } } } } }
internal void GadgetItemChecked(GadgetTest gadget, bool isChecked) { if (gadget.NotNull()) { gadget.IsChecked = isChecked; // for sure var gadgetChecked = IsChecked(gadget); if (isChecked) { if (gadgetChecked.ValidateId.IsFalse()) { AddChecked(gadget); } } else { if (gadgetChecked.ValidateId) { RemoveChecked(gadget.Id); } } } }
void SelectionChangedDispatcher (GadgetTest gadget) { if (Model.SelectionChanged (gadget)) { // to parent // Select - ById var entityAction = TEntityAction.Create ( TCategory.Test, TOperation.Select, TExtension.ById ); entityAction.Id = Model.Current.Id; var message = new TCollectionMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (entityAction); DelegateCommand.PublishInternalMessage.Execute (message); } else { // to Sibling var message = new TCollectionSiblingMessageInternal (TInternalMessageAction.Cleanup, TChild.List, TypeInfo); DelegateCommand.PublishInternalMessage.Execute (message); } }
public TContentClient (GadgetTest gadget) : this () { if (gadget.NotNull ()) { Id = gadget.Id; Category = TCategoryType.ToValue (TCategory.Test); Name = gadget.GadgetName; Info = gadget.GadgetInfo; if (gadget.HasContent) { // Target if (gadget.HasContentTarget) { var contents = new Collection<GadgetTarget> (); gadget.RequestContent (contents); foreach (var item in contents) { ClientList.Add (new TContentClient (item)); } } // Test if (gadget.HasContentTest) { var contents = new Collection<GadgetTest> (); gadget.RequestContent (contents); foreach (var item in contents) { ClientList.Add (new TContentClient (item)); } } } } }
internal bool SelectionChanged(GadgetTest gadget) { if (gadget.IsNull()) { return(false); } Current.CopyFrom(gadget); return(Current.ValidateId); }
bool RemoveCheck(GadgetTest gadget) { foreach (var item in m_TestCheckedItems) { if (item.Contains(gadget.Id)) { m_TestCheckedItems.Remove(item); return(true); } } return(false); }
bool AddCheck(GadgetTest gadget) { foreach (var item in m_TestCheckedItems) { if (item.Contains(gadget.Id)) { return(false); } } m_TestCheckedItems.Add(gadget); return(true); }
internal void ContentTestTargetChanged(GadgetTest gadget) { // content Test Target // save result foreach (var item in ContentTestItemsSource) { if (item.UpdateValue(ContentTestTargetCurrent)) { break; } } ContentTestTargetCurrent.CopyFrom(gadget); }
bool AddGadget(GadgetTest gadget) { var res = false; if (gadget.NotNull()) { if (ContainsGadget(gadget.Id).IsFalse()) { GadgetItemsSource.Add(gadget); res = true; } } return(res); }
GadgetTest IsChecked(GadgetTest gadget) { if (gadget.NotNull()) { foreach (var gadgetChecked in GadgetCheckedCollection) { if (gadgetChecked.Contains(gadget.Id)) { return(gadgetChecked); } } } return(GadgetTest.CreateDefault); }
void ItemCheckedChangedDispatcher (GadgetTest gadget) { // to parent // Select = ById (Test) var action = TEntityAction.Create ( TCategory.Test, TOperation.Select, TExtension.ById ); action.Id = gadget.Id; action.Param2 = gadget; // preserve var message = new TFactoryMessageInternal (TInternalMessageAction.Request, TChild.List, TypeInfo); message.Support.Argument.Types.Select (action); DelegateCommand.PublishInternalMessage.Execute (message); }
void AddChecked(GadgetTest gadget) { if (gadget.NotNull()) { if (ContainsChecked(gadget.Id).IsFalse()) { GadgetCheckedCollection.Add(gadget); } else { IsChecked(gadget).IsChecked = true; } var itemSource = ItemSourceById(gadget.Id); if (itemSource.ValidateId) { itemSource.IsChecked = true; // for sure } } }
public void OnGadgetItemUnchecked (GadgetTest gadget) { TDispatcher.BeginInvoke (ItemCheckedChangedDispatcher, gadget); }
public static TComponentControlModel Create (GadgetTest gadget) => new TComponentControlModel (gadget);
void ContentTargetChangedDispatcher (GadgetTest gadget) { Model.ContentTargetChanged (gadget); ApplyChanges (); }
internal void ContentTargetChanged(GadgetTest gadget) { // content target }
public void OnSelectionChanged (GadgetTest gadget) { TDispatcher.BeginInvoke (SelectionChangedDispatcher, gadget); }