public void AddOverlayPolys(string SqlWhereClause) { int idFld = m_OverlayPolysFC.FindField("OverlayPolys_ID"); int unitFld = m_OverlayPolysFC.FindField("MapUnit"); int idConfFld = m_OverlayPolysFC.FindField("IdentityConfidence"); int lblFld = m_OverlayPolysFC.FindField("Label"); int notesFld = m_OverlayPolysFC.FindField("Notes"); int dsFld = m_OverlayPolysFC.FindField("DataSourceID"); int symFld = m_OverlayPolysFC.FindField("Symbol"); IQueryFilter QF = new QueryFilterClass(); QF.WhereClause = SqlWhereClause; IFeatureCursor theCursor = m_OverlayPolysFC.Search(QF, false); IFeature theFeature = theCursor.NextFeature(); while (theFeature != null) { OverlayPoly anOverlayPoly = new OverlayPoly(); anOverlayPoly.OverlayPolys_ID = theFeature.get_Value(idFld).ToString(); anOverlayPoly.MapUnit = theFeature.get_Value(unitFld).ToString(); anOverlayPoly.IdentityConfidence = theFeature.get_Value(idConfFld).ToString(); anOverlayPoly.Label = theFeature.get_Value(lblFld).ToString(); anOverlayPoly.Notes = theFeature.get_Value(notesFld).ToString(); anOverlayPoly.DataSourceID = theFeature.get_Value(dsFld).ToString(); anOverlayPoly.Symbol = theFeature.get_Value(symFld).ToString(); anOverlayPoly.Shape = (IPolygon)theFeature.Shape; anOverlayPoly.RequiresUpdate = true; m_OverlayPolysDictionary.Add(anOverlayPoly.OverlayPolys_ID, anOverlayPoly); theFeature = theCursor.NextFeature(); } }
public void DeleteOverlayPolys(OverlayPoly theOverlayPoly) { try { m_OverlayPolysDictionary.Remove(theOverlayPoly.OverlayPolys_ID); } catch { } IEditor theEditor = ArcMap.Editor; if (theEditor.EditState == esriEditState.esriStateNotEditing) { theEditor.StartEditing(m_theWorkspace); } theEditor.StartOperation(); try { IQueryFilter QF = new QueryFilterClass(); QF.WhereClause = "OverlayPolys_ID = '" + theOverlayPoly.OverlayPolys_ID + "'"; ITable OverlayPolysTable = m_OverlayPolysFC as ITable; OverlayPolysTable.DeleteSearchedRows(QF); theEditor.StopOperation("Delete OverlayPolys"); } catch (Exception e) { theEditor.StopOperation("OverlayPolys Management Failure"); } }
public void UpdateOverlayPoly(OverlayPoly theOverlayPoly) { try { m_OverlayPolysDictionary.Remove(theOverlayPoly.OverlayPolys_ID); } catch { } theOverlayPoly.RequiresUpdate = true; m_OverlayPolysDictionary.Add(theOverlayPoly.OverlayPolys_ID, theOverlayPoly); }
public string NewOverlayPoly(string MapUnit, string IdentityConfidence, string Label, string Notes, string DataSourceID, string Symbol, IPolygon Shape) { OverlayPoly newOverlayPoly = new OverlayPoly(); sysInfo SysInfoTable = new sysInfo(m_theWorkspace); newOverlayPoly.OverlayPolys_ID = SysInfoTable.ProjAbbr + ".OverlayPolys." + SysInfoTable.GetNextIdValue("OverlayPolys"); newOverlayPoly.MapUnit = MapUnit; newOverlayPoly.IdentityConfidence = IdentityConfidence; newOverlayPoly.Label = Label; newOverlayPoly.Notes = Notes; newOverlayPoly.DataSourceID = DataSourceID; newOverlayPoly.Symbol = Symbol; newOverlayPoly.Shape = Shape; newOverlayPoly.RequiresUpdate = false; m_OverlayPolysDictionary.Add(newOverlayPoly.OverlayPolys_ID, newOverlayPoly); return newOverlayPoly.OverlayPolys_ID; }