コード例 #1
0
 public PBaseObject(int id, PCollection ownerCollection, IPDataModel model)
 {
     this.Id = id;
     _attrs = new Dictionary<string, string>();
     _collects = new List<PCollection>();
     _ownerCollection = ownerCollection;
     Model = model;
     Templates = new PTemplates(this);
 }
コード例 #2
0
ファイル: PModel.cs プロジェクト: kindprojects/workstation
 public bool FillCollection(PCollection coll)
 {
     List<int> lst = this._db.ListCollectionObjects(coll.Owner.Id, coll.Name);
     foreach (int id in lst)
     {
         this.LoadNewObject(id, coll);
     }
     return true;
 }
コード例 #3
0
ファイル: PModel.cs プロジェクト: kindprojects/workstation
        private PBaseObject LoadNewObject(int id, PCollection ownerCollection)
        {
            PBaseObject obj = new PBaseObject(id, ownerCollection, this);

            if (ownerCollection != null)
                ownerCollection.InsertObject(obj);
            Dictionary<string, string> attrs = this._db.ListAttributes(id);
            foreach (KeyValuePair<string, string> p in attrs)
            {
                obj.SetAttr(p.Key, p.Value);
            }

            List<string> listColl = this._db.ListCollections(id);

            foreach (string coll in listColl)
            {
                obj.GetCollection(coll, true);
            }

            _listObjects.Add(obj.Id, obj);
            return obj;
        }
コード例 #4
0
ファイル: PModel.cs プロジェクト: kindprojects/workstation
        public PCollection NewCollection(PBaseObject owner, string name)
        {
            PCollection col = new PCollection(owner, name, this.DeferredLoad, this);
            if (!this.DeferredLoad)
            {
                this.FillCollection(col);
            }

            return col;
        }