protected virtual void Dispose(bool disposing) { if (disposing) { dbText.Dispose(); } }
protected override bool WorldDraw(Autodesk.AutoCAD.GraphicsInterface.WorldDraw draw) { DBText inMemoryText = _getMirrorClone(); draw.Geometry.Draw(inMemoryText); inMemoryText.Dispose(); return(true); }
private void EraseTransient() { if (elevTextTransient != null && elevBasePtTransient != null) { Graphics.TransientManager tm = Graphics.TransientManager.CurrentTransientManager; tm.EraseTransient(elevTextTransient, new IntegerCollection()); tm.EraseTransient(elevBasePtTransient, new IntegerCollection()); elevTextTransient.Dispose(); elevBasePtTransient.Dispose(); elevTextTransient = null; elevBasePtTransient = null; } }
// Get MS number for specified layer public static String msText(Database db, string layerName) { Regex msNo = new Regex(@"^\d{6}"); using (var tr = db.TransactionManager.StartTransaction()) { var blockTable = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead); foreach (ObjectId btrId in blockTable) { var btr = (BlockTableRecord)tr.GetObject(btrId, OpenMode.ForRead); if (btr.IsLayout) { foreach (ObjectId id in btr) { var ent = tr.GetObject(id, OpenMode.ForRead) as Entity; if (ent.Layer.Equals(layerName, System.StringComparison.CurrentCultureIgnoreCase)) { DBText dbt = tr.GetObject(id, OpenMode.ForRead) as DBText; if (dbt == null) { dbt.Dispose(); continue; } else { if (dbt.TextString.Contains("MS") || msNo.IsMatch(dbt.TextString)) { //System.Windows.Forms.MessageBox.Show("MS: " + dbt.TextString); return(" (" + dbt.TextString + ") "); } } } } } } } return(""); }