Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
        // 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);
        }
Exemplo n.º 3
0
        /// <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;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public FoldersCollection(ICollectionOwner owner) : base(typeof(Folder))
 {
     mOwner = owner;
 }
Exemplo n.º 6
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="owner">集合所属ui对象</param>
 public BindingCollection(ICollectionOwner owner)
     : this(owner, CreateCollectionByOwner(owner))
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="owner">绑定列表所属控件</param>
 public BindingListEx_bk(ICollectionOwner owner = null)
     : base()
 {
     this._isRingStruct = false;
     this._owner        = owner;
 }