/// <summary> /// populates folders reculsivelly. /// </summary> /// <param name="dr"></param> private void Read(SqlDataReader dr) { while (dr.Read()) { // create a folder for current dr record: Folder f = new Folder(Database, dr); // if owner is a Database, or parentID is 0, then it's a root: if ((mOwner is Database) && (f.ParentID == 0)) { Add(f); } // if current folder is the new folder's parent, add it to it: else if (((Folder)Owner).ID == f.ParentID) { Add(f); } else { // search for the parent: ICollectionOwner parent = ((Folder)Owner).FindParent(f.ParentID); if (parent is Database) { ((Database)parent).Folders.Add(f); } else if (parent is Folder) { ((Folder)parent).SubFolders.Add(f); } } // call reculsivelly: f.SubFolders.Read(dr); } }
// Token: 0x060016BE RID: 5822 RVA: 0x00027CD8 File Offset: 0x00026CD8 public static WorkflowRunner Construct(string workflow, InternalCollection collection) { WorkflowElement workflowElement = Activator.CreateInstance <WorkflowElement>(workflow); if (workflowElement != null) { ICollectionOwner collectionOwner = workflowElement as ICollectionOwner; if (collectionOwner != null) { collectionOwner.Bind(collection); } return(new WorkflowRunner(workflowElement)); } return(null); }
/// <summary> /// 构造函数 /// </summary> /// <param name="owner">集合所属ui对象</param> /// <param name="items">绑定集合[Winform:BindingListEx;WPF:ObservableCollection或是其子类]</param> public BindingCollection(ICollectionOwner owner, Collection <T> items) : base() { if (owner == null) { throw new ArgumentNullException(nameof(owner)); } if (items == null) { throw new ArgumentNullException(nameof(items)); } this._owner = owner; this._items = items; }
public ICollectionOwner FindParent(int parentID) { ICollectionOwner parent = mParent; while ((parent != null) && !(parent is Database)) { if (((Folder)parent).ID == parentID) { break; } else { parent = ((Folder)parent).FindParent(parentID); } } return(parent); }
public FoldersCollection(ICollectionOwner owner) : base(typeof(Folder)) { mOwner = owner; }
/// <summary> /// 构造函数 /// </summary> /// <param name="owner">集合所属ui对象</param> public BindingCollection(ICollectionOwner owner) : this(owner, CreateCollectionByOwner(owner)) { }
/// <summary> /// 构造函数 /// </summary> /// <param name="owner">绑定列表所属控件</param> public BindingListEx_bk(ICollectionOwner owner = null) : base() { this._isRingStruct = false; this._owner = owner; }