public void SetObjectCollection(CollectionType collection, bool modified = false) { if (collection != null) { CurrentCollection = collection; list.BeginUpdate(); WizardTools.Tools.setTreeViewFromCollection(list, collection, ChildPropertyName, this); AfterObjectCollectionSet?.Invoke(this, null); if (modified) { OnCollectionModified?.Invoke(this, null); } list.EndUpdate(); } else { list.Nodes.Clear(); } updateDisplay(); }
/// <summary> /// Display collection from view. DisplayPropertyName hold the name of property containing collection to display /// </summary> /// <param name="obj">view object</param> public void SetObjectCollection(IViewFct obj = null, bool modified = false) { if (obj == null) { obj = UseCurrentViewAsDefault ? (IViewFct)CurrentContext.CurrentView : CurrentContext.CurrentFunction; } if (obj != null && ConfigurationElementCollection(obj) != null) { list.BeginUpdate(); WizardTools.Tools.setTreeViewFromCollection(list, ConfigurationElementCollection(obj), ChildPropertyName, this); AfterObjectCollectionSet?.Invoke(this, null); if (modified) { OnCollectionModified?.Invoke(this, null); } list.EndUpdate(); } else { list.Nodes.Clear(); } updateDisplay(); }