private void OnCommandClick(Commands_e cmd) { switch (cmd) { case Commands_e.InsertNote: m_App.IActiveDoc2.ClearSelection2(true); m_Page = new PropertyManagerPageEx <InsertNotePMPageHandler, NoteData>( m_Data ?? (m_Data = new NoteData()), m_App); m_Page.Handler.Closing += (r, a) => { if (r == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay) { if (string.IsNullOrEmpty(m_Data.Text)) { a.Cancel = true; a.ErrorTitle = "Insert Note Error"; a.ErrorMessage = "Please specify the note text"; } } }; m_Page.Handler.Closed += r => { if (r == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay) { NoteHelper.InsertNote(m_App.IActiveDoc2 as IDrawingDoc, m_Data.Text, m_Data.Size, m_Data.Position.X, m_Data.Position.Y, m_Data.Position.AttachedEntity); } }; m_Page.Show(); break; } }
public void ShowTabPMP() { if (m_TabModel == null) { m_TabModel = new TabDataModel(); } m_ActiveTabPage.Show(m_TabModel); }
public void ShowPMP() { if (m_Model == null) { m_Model = new DataModel(); } m_ActivePage.Show(m_Model); }
private void OnButtonClick(Commands_e cmd) { try { switch (cmd) { case Commands_e.CreateBox: m_BoxPmPage.Show(m_CurBoxData); break; case Commands_e.CreateCylinder: m_CylPmPage.Show(m_CurCylData); break; } } catch (Exception ex) { App.SendMsgToUser2(ex.Message, (int)swMessageBoxIcon_e.swMbStop, (int)swMessageBoxBtn_e.swMbOk); } }
private void OnButtonClick(commands_enum cmd) { try { switch (cmd) { case commands_enum.CreateCylinder: mCylPAge.Show(mCylinderData); break; case commands_enum.CreateBox: // ModelDocx.CreateBox(App.IActiveDoc2, 10, 20, 50); break; } } catch (Exception e) { App.SendMsgToUser2(e.Message, (int)swMessageBoxIcon_e.swMbStop, (int)swMessageBoxBtn_e.swMbOk); } }