public EM_Startup() { EM_Helper emHelper = new EM_Helper(); EM_ContextMenu0.replaceTextEditContextMenu(); Layer.manageLayers("BUBBLE", 5); }
public EM_EventsDb() { m_bDone = false; m_dbsTable = new Hashtable(); collectAllDbs(); numDbEvents++; EM_Helper.StreamMessage(string.Format("DbEvent Added: {0}", numDbEvents)); }
public EM_EventsDoc() { m_bDone = false; m_docsTable = new Hashtable(); collectAllDocs(); Do(); numDocEvents++; EM_Helper.StreamMessage(string.Format("DocEvent Added: {0}", numDocEvents)); m_dbWatcher = new EM_EventsDb(); }
private void m_doc_CommandWillStart(object sender, CommandEventArgs e) { EM_Helper.StreamMessage(String.Format("CommandWillStart - {0}", e.GlobalCommandName)); Database db = m_doc.Database; EW_Storage.enData = new List <EM_EData>(); if (e.GlobalCommandName == "ERASE" || e.GlobalCommandName == "E") { m_doc.CommandEnded += m_doc_CommandEnded; m_doc.CommandFailed += m_doc_CommandEnded; m_doc.CommandCancelled += m_doc_CommandEnded; m_dbWatcher.DoADb(ref db); } else if (e.GlobalCommandName == "GRIP_STRETCH" || e.GlobalCommandName == "MOVE") { m_doc.CommandEnded += m_doc_CommandEnded; m_doc.CommandFailed += m_doc_CommandEnded; m_doc.CommandCancelled += m_doc_CommandEnded; m_dbWatcher.DoADb(ref db); } else if (e.GlobalCommandName == "AECCEDITPIPEPROPERTIES" || e.GlobalCommandName == "AECCEDITPARENTPARTPROPERTIES") { m_doc.CommandEnded += m_doc_CommandEnded; m_doc.CommandFailed += m_doc_CommandEnded; m_doc.CommandCancelled += m_doc_CommandEnded; m_dbWatcher.DoADb(ref db); } else if (e.GlobalCommandName == "SAVEAS") { m_doc.CommandEnded += m_doc_CommandEnded; } else if (e.GlobalCommandName == "QUIT") { } else if (e.GlobalCommandName == "CLOSE") { m_doc.CommandEnded += m_doc_CommandEnded; Dict.deleteDictionary("cmdBC"); } else if (e.GlobalCommandName == "OPEN") { m_doc.CommandEnded += m_doc_CommandEnded; } }
void m_doc_CommandWillStart(object sender, CommandEventArgs e) { EM_Helper.StreamMessage(String.Format("CommandWillStart - {0}", e.GlobalCommandName)); Database db = m_doc.Database; if (e.GlobalCommandName == "ERASE" || e.GlobalCommandName == "E") { m_doc.CommandEnded += m_doc_CommandEnded; m_doc.CommandFailed += m_doc_CommandEnded; m_doc.CommandCancelled += m_doc_CommandEnded; m_dbWatcher.DoADb(ref db); //m_doc.Database.ObjectOpenedForModify += dbCallback.m_db_ObjectOpenedForModify; } else if (e.GlobalCommandName == "GRIP_StrETCH" || e.GlobalCommandName == "MOVE") { m_doc.CommandEnded += m_doc_CommandEnded; m_doc.CommandFailed += m_doc_CommandEnded; m_doc.CommandCancelled += m_doc_CommandEnded; m_dbWatcher.DoADb(ref db); //m_doc.Database.ObjectOpenedForModify += dbCallback.m_db_ObjectOpenedForModify; } else if (e.GlobalCommandName == "SAVEAS") { m_doc.CommandEnded += m_doc_CommandEnded; } else if (e.GlobalCommandName == "QUIT") { } else if (e.GlobalCommandName == "CLOSE") { m_doc.CommandEnded += m_doc_CommandEnded; } else if (e.GlobalCommandName == "OPEN") { m_doc.CommandEnded += m_doc_CommandEnded; } }
internal static void m_db_ObjectOpenedForModify(object sender, ObjectEventArgs e) { EM_Helper.StreamMessage(String.Format("ObjectOpenedForModify - {0} {1}", e.DBObject.ToString(), e.DBObject.Id.ToString())); try { RXObject obj = e.DBObject; string type = obj.GetType().Name; if (!types.Contains(type)) { return; } List <EM_EData> enData = new List <EM_EData>(); ResultBuffer rb = null; ObjectId idX = ObjectId.Null; string objTypeX = string.Empty; Handle hX = "0".stringToHandle(); Point3d pnt3d = Public.pnt3dOrg; switch (type) { case "CogoPoint": CogoPoint ent = (CogoPoint)obj; rb = ent.GetXDataForApplication(null); idX = ent.ObjectId; objTypeX = type; hX = ent.Handle; break; case "DBText": case "MText": case "Leader": case "Polyline": case "Polyline3d": case "BlockReference": Entity entX = (Entity)obj; rb = entX.GetXDataForApplication(null); idX = entX.ObjectId; objTypeX = type; hX = entX.Handle; break; } if (rb == null) { return; } TypedValue[] tvsX = rb.AsArray(); List <string> nameApps = null; List <TypedValue[]> lstTVs = xData.parseXData(tvsX, out nameApps); for (int i = 0; i < lstTVs.Count; i++) { TypedValue[] tvs = lstTVs[i]; string nameApp = tvs[0].Value.ToString(); if (!Public.lstApps.Contains(nameApp)) { continue; } if (type == "MText") { MText mTxt = (MText)e.DBObject; pnt3d = mTxt.Location; } else if (type == "DBText") { DBText Txt = (DBText)e.DBObject; pnt3d = Txt.Position; } else { pnt3d = Public.pnt3dOrg; } EM_EData eData = new EM_EData(hX, idX, objTypeX, pnt3d, tvs); enData.Add(eData); EW_Storage.enData = enData; } } catch (System.Exception ex) { BaseObjs.writeDebug(ex.Message + " EM_EventsDb.cs: line: 96"); } }
void m_doc_CommandEnded(object sender, CommandEventArgs e) { EM_Helper.StreamMessage(String.Format("CommandEnded - {0}", e.GlobalCommandName)); Database db = m_doc.Database; //Document doc = (Document)sender; List <EM_EData> enData = EW_Storage.enData; if (e.GlobalCommandName == "ERASE" || e.GlobalCommandName == "E") { m_doc.CommandEnded -= m_doc_CommandEnded; m_doc.CommandFailed -= m_doc_CommandEnded; m_doc.CommandCancelled -= m_doc_CommandEnded; m_dbWatcher.UndoADb(ref db); //m_doc.Database.ObjectOpenedForModify -= dbCallback.m_db_ObjectOpenedForModify; if (enData != null) { EM_Delete.doDelete(enData); } } else if (e.GlobalCommandName == "SAVEAS") { m_doc.CommandEnded -= m_doc_CommandEnded; } else if (e.GlobalCommandName == "GRIP_StrETCH" || e.GlobalCommandName == "MOVE") { m_doc.CommandEnded -= m_doc_CommandEnded; m_doc.CommandFailed -= m_doc_CommandEnded; m_doc.CommandCancelled -= m_doc_CommandEnded; m_dbWatcher.UndoADb(ref db); //m_doc.Database.ObjectOpenedForModify -= dbCallback.m_db_ObjectOpenedForModify; if (enData != null) { EM_StretchMove.doStretchMove(enData); } } else if (e.GlobalCommandName == "QUIT") { } else if (e.GlobalCommandName == "CLOSE") { m_doc.CommandEnded -= m_doc_CommandEnded; if (!m_doc.Name.Contains("Drawing1.dwg")) { List <string> docList = EM_DocList.emDockList.docList; try { docList.Remove(m_doc.Name); } catch (System.Exception ex) { BaseObjs.writeDebug(ex.Message + " EM_EventsDoc.cs: line: 201"); } } } else if (e.GlobalCommandName == "OPEN") { m_doc.CommandEnded -= m_doc_CommandEnded; } }
private void m_doc_CommandEnded(object sender, CommandEventArgs e) { EM_Helper.StreamMessage(String.Format("CommandEnded - {0}", e.GlobalCommandName)); Database db = m_doc.Database; System.Windows.Forms.Keys mods = System.Windows.Forms.Control.ModifierKeys; btp.shiftKey = (mods & System.Windows.Forms.Keys.Shift) > 0; btp.cntrlKey = (mods & System.Windows.Forms.Keys.Control) > 0; btp.altX = (mods & System.Windows.Forms.Keys.Alt) > 0; List <EM_EData> enData = EW_Storage.enData; if (e.GlobalCommandName == "ERASE" || e.GlobalCommandName == "E") { m_doc.CommandEnded -= m_doc_CommandEnded; m_doc.CommandFailed -= m_doc_CommandEnded; m_doc.CommandCancelled -= m_doc_CommandEnded; m_dbWatcher.UndoADb(ref db); if (enData != null) { EM_Delete.doDelete(enData); } } else if (e.GlobalCommandName == "SAVEAS") { m_doc.CommandEnded -= m_doc_CommandEnded; } else if (e.GlobalCommandName == "GRIP_STRETCH" || e.GlobalCommandName == "MOVE") { m_doc.CommandEnded -= m_doc_CommandEnded; m_doc.CommandFailed -= m_doc_CommandEnded; m_doc.CommandCancelled -= m_doc_CommandEnded; m_dbWatcher.UndoADb(ref db); if (enData != null) { EM_StretchMove.doStretchMove(enData); } } else if (e.GlobalCommandName == "AECCEDITPIPEPROPERTIES" || e.GlobalCommandName == "AECCEDITPARENTPARTPROPERTIES") { m_doc.CommandEnded -= m_doc_CommandEnded; m_doc.CommandFailed -= m_doc_CommandEnded; m_doc.CommandCancelled -= m_doc_CommandEnded; m_dbWatcher.UndoADb(ref db); if (enData != null) { EM_StretchMove.doStretchMove(enData); } } else if (e.GlobalCommandName == "QUIT") { } else if (e.GlobalCommandName == "CLOSE") { m_doc.CommandEnded -= m_doc_CommandEnded; if (!m_doc.Name.Contains("Drawing1.dwg")) { List <string> docList = EM_DocList.emDockList.docList; try { docList.Remove(m_doc.Name); ObjectId idDict = Dict.dictExists("cmdFL"); if (idDict != ObjectId.Null) { Dict.setCmdDefault("cmdFL", "resBot", "FL"); } idDict = Dict.dictExists("cmdG"); if (idDict != ObjectId.Null) { Dict.setCmdDefault("cmdG", "resBot", "FL"); Dict.setCmdDefault("cmdG", "resTop", "TC"); } } catch (System.Exception ex) { BaseObjs.writeDebug(ex.Message + " EM_EventsDocument.cs: line: 295"); } } } else if (e.GlobalCommandName == "OPEN") { m_doc.CommandEnded -= m_doc_CommandEnded; } EW_Storage.enData = null; }