예제 #1
0
        // Summary:
        //     Build RowView index to object and vice versa.
        protected void buildRowViewIndex()
        {
            if (rawDataSet == null || rawDataSet.Tables.Count == 0)
            {
                return;
            }

            DataTable dt = rawDataSet.Tables[0];

            rowView2Obj = new Dictionary <DataRow, DGObject>();
            foreach (DGObject obj in _objs.Values)
            {
                rowView2Obj[obj.rawData] = obj;
            }

            obj2RowView = new Dictionary <DGObject, DataRow>();
            foreach (DataRow dr in dt.Rows)
            {
                if (rowView2Obj.ContainsKey(dr))
                {
                    // get the object using the DataRow as an index
                    //
                    DGObject obj = rowView2Obj[dr];
                    obj2RowView[obj] = dr;
                }
            }
        }
예제 #2
0
        // Summary:
        //     Get object by a key
        public async Task <DGObject> QueryObjByID(int objID)
        {
            DGObjectRepository repository = DGObjectRepository.Instance(
                Globals.project.projDef.ID, parent.name, definition.Type);
            DGObject obj = await repository.Retrieve(objID);

            obj.parent = this;
            return(obj);
        }
예제 #3
0
 public string getRemovedObjsLayer3DName(string objDef)
 {
     if ((removedObjs != null) && (removedObjs.Values.Count > 0))
     {
         DGObject obj = removedObjs[objDef].FirstOrDefault();
         if (obj.parent != null)
         {
             return(obj.parent.definition.Layer3DName);
         }
     }
     return(null);
 }
예제 #4
0
 public string getAddedObjsGISLayerName(string objDef)
 {
     if ((addedObjs != null) && (addedObjs.Values.Count > 0))
     {
         DGObject obj = addedObjs[objDef].FirstOrDefault();
         if (obj.parent != null)
         {
             return(obj.parent.definition.GISLayerName);
         }
     }
     return(null);
 }
예제 #5
0
        public bool load(DbContext dbContext)
        {
            rawDataSet = new DataSet(definition.Type);

            DGObject objHelper =
                ObjectHelper.CreateDGObjectFromSubclassName(definition.Type);
            bool success = objHelper.LoadObjs(this, dbContext);

            buildIDIndex();
            buildRowViewIndex();

            return(success);
        }
예제 #6
0
 public virtual void highlightObject(DGObject obj, bool on = true)
 {
 }