// 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; } } }
// 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); }
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); }
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); }
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); }
public virtual void highlightObject(DGObject obj, bool on = true) { }