/// <summary> /// Загрузка основного меню в зависимости от настроек /// </summary> public static void LoadMainMenu() { try { if (Variables.FloatMenu) { if (MpMainMenuWin == null) { MpMainMenuWin = new MpFloatMenu(); MpMainMenuWin.Closed += mpMainMenuWin_Closed; } if (MpMainMenuWin.IsLoaded) { return; } Application.ShowModelessWindow(Application.MainWindow.Handle, MpMainMenuWin); } else { MpMainMenuWin?.Close(); } } catch (Exception exception) { ExceptionBox.Show(exception); } }
private bool SelectService() { bool result; try { this.btnCancel.IsEnabled = false; this.btnNext.IsEnabled = false; base.IsEnabled = false; AGSConnection aGSConnection = this.lbConnections.SelectedItem as AGSConnection; if (aGSConnection.ConnectionFailed) { this.RefreshConnection(aGSConnection); } if (!aGSConnection.ConnectionFailed) { if (this.PopulateConnection(aGSConnection)) { base.Close(); SelectService selectService = new SelectService(aGSConnection); if (selectService.IsValid) { this.ClearProgressBar(); Application.ShowModelessWindow(selectService); base.Close(); result = true; return(result); } } else { this.btnCancel.IsEnabled = true; this.btnNext.IsEnabled = true; base.IsEnabled = true; SelectConnection.WindowOpen = false; string text = aGSConnection.ErrorMessage; if (string.IsNullOrEmpty(text)) { text = "Populating Connection failed"; } ErrorReport.ShowErrorMessage(text); aGSConnection.ErrorMessage = ""; } } result = false; } catch { result = false; } return(result); }
public static void ShowLast() { if (LastErrors?.Any() != true) { return; } var errVM = new ErrorsVM(LastErrors) { IsDialog = false }; var errView = new ErrorsView(errVM); Application.ShowModelessWindow(errView); }
public static void Show([NotNull] List <IError> errors) { try { var errVM = new ErrorsVM(errors) { IsDialog = false }; var errView = new ErrorsView(errVM); Application.ShowModelessWindow(errView); } catch (Exception ex) { Logger.Log.Error(ex); } }
public void StartFunction() { Statistic.SendCommandStarting(new ModPlusConnector()); if (_mpDimJustif == null) { _mpDimJustif = new MpDimJustif(); _mpDimJustif.Closed += win_Closed; } if (_mpDimJustif.IsLoaded) { _mpDimJustif.Activate(); } else { AcApp.ShowModelessWindow(AcApp.MainWindow.Handle, _mpDimJustif); } }
/// <summary> /// Загрузка основного меню в зависимости от настроек /// </summary> public static void LoadMainMenu() { if (Variables.DrawingsFloatMenu) { if (MpDrawingsWin == null) { MpDrawingsWin = new MpDrawings(); MpDrawingsWin.Closed += MpDrawingsWinClosed; } if (MpDrawingsWin.IsLoaded) { return; } AcApp.ShowModelessWindow( AcApp.MainWindow.Handle, MpDrawingsWin); } else { MpDrawingsWin?.Close(); } }
public void Main() { Statistic.SendCommandStarting(new ModPlusConnector()); if (_mainWindow == null) { _mainWindow = new MainWindow(); var context = new MainViewModel(_mainWindow); context.FillData(); _mainWindow.DataContext = context; _mainWindow.Closed += (sender, args) => _mainWindow = null; } if (_mainWindow.IsLoaded) { _mainWindow.Activate(); } else { AcApp.ShowModelessWindow(AcApp.MainWindow.Handle, _mainWindow); } }
public void Start() { #if !DEBUG ModPlusAPI.Statistic.SendCommandStarting(new ModPlusConnector()); #endif if (Window == null) { Window = new MainWindow(); Window.Closed += (sender, args) => { Window = null; Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView(); }; } if (Window.IsLoaded) { Window.Activate(); } else { AcApp.ShowModelessWindow(AcApp.MainWindow.Handle, Window); } }
public void TestColors() { var testColors = new TestColors(new TestColorsVM()); Application.ShowModelessWindow(testColors); }
public void Start(Document doc) { view = new Window1(); Application.ShowModelessWindow(view); doc.Editor.Drag(this); }
executeCLKS(SelectionSet ss0 = null) { hLnkAdds = new List <Handle>(); hLnkFixs = new List <Handle>(); winResults wResults = FormHandler.fHandler.wResults; Application.ShowModelessWindow(wResults); ListBox lbxAdd = wResults.lbxAdd; lbxAdd.Items.Clear(); lbxAdd.Height = 220; ListBox lbxFix = wResults.lbxFix; lbxFix.Items.Clear(); lbxFix.Height = 220; wResults.Height = 565; bool exists; string nameDict = ""; ObjectId idDict = ObjectId.Null; ObjectId idPnt = ObjectId.Null; List <ObjectId> ids = getBlockRefs(); List <ObjectId> idsPnt = getPoints(); List <ObjectId> idsLdr = getLeaders(); Handle hPntX = new Handle(); if (ids != null && ids.Count > 0) { wResults.pBar1.Maximum = ids.Count; int i = 0; Point3d pnt3dIns; ObjectId idGradeTagDict = Dict.getNamedDictionary("GradeTagDict", out exists); List <DBDictionaryEntry> entriesGradeTagDict = idGradeTagDict.getEntries(); ObjectId idFlTagDict = Dict.getNamedDictionary("FlTagDict", out exists); List <DBDictionaryEntry> entriesFlTagDict = idFlTagDict.getEntries(); List <DBDictionaryEntry> entries = null; using (Transaction tr = BaseObjs.startTransactionDb()) { foreach (ObjectId idBlkRef in ids) { ++i; Debug.Print(i.ToString()); string nameBlkRef = Blocks.getBlockRefName(idBlkRef).ToUpper(); switch (nameBlkRef) { case "GRADETAG": entries = entriesGradeTagDict; nameDict = "GradeTagDict"; idDict = idGradeTagDict; break; case "FLTAG": entries = entriesFlTagDict; nameDict = "FlTagDict"; idDict = idFlTagDict; break; } bool fix; bool isValid = utility1.isValidObjInDictionary(idBlkRef, entries, nameDict, idDict, out fix, out hPntX); if (isValid) { if (fix) { hLnkFixs.Add(hPntX); } } else { using (BaseObjs._acadDoc.LockDocument()) { try { BlockReference br = (BlockReference)tr.GetObject(idBlkRef, OpenMode.ForRead); pnt3dIns = br.Position; //Debug.Print(string.Format("{0:F3},{1:F3},{2:F3}", pnt3dIns.X, pnt3dIns.Y, pnt3dIns.Z)); ObjectId idLdr = findLeader(pnt3dIns, idsLdr); if (idLdr == ObjectId.Null) { continue; } Point3d pnt3dLdrBeg = idLdr.getBegPnt(); Point3d pnt3dPnt = Point3d.Origin; bool found = false; try { foreach (ObjectId id in idsPnt) { pnt3dPnt = id.getCogoPntCoordinates(); if ((pnt3dPnt - pnt3dLdrBeg) == v3d0) { found = true; idPnt = id; break; } else if (System.Math.Round(pnt3dPnt.getDistance(pnt3dLdrBeg)) < .001) { found = true; idPnt = id; break; } } } catch (System.Exception ex) { Application.ShowAlertDialog(string.Format("{0} line 149", ex.Message)); } if (!found) { continue; } string desc = string.Empty; try { switch (nameBlkRef) { case "GRADETAG": desc = Blocks.getBlockRefAttributeValue(idBlkRef, "TOPTXT"); desc = desc.Replace(")", ""); desc = desc.Replace("(", ""); if (desc == "") { idBlkRef.delete(); continue; } switch (desc) { case "FF": utility1.checkFF(idBlkRef, pnt3dPnt); addOrphanToDicts("GradeTagDict", idPnt.getHandle(), idBlkRef.getHandle(), idLdr.getHandle()); //Debug.Print(idPnt.getHandle().ToString()); break; case "TC": utility1.checkTC(idBlkRef, pnt3dPnt); addOrphanToDicts("GradeTagDict", idPnt.getHandle(), idBlkRef.getHandle(), idLdr.getHandle()); //Debug.Print(idPnt.getHandle().ToString()); break; } break; case "FLTAG": desc = Blocks.getBlockRefAttributeValue(idBlkRef, "BOTTXT"); desc = desc.Replace(")", ""); desc = desc.Replace("(", ""); if (desc == "") { idBlkRef.delete(); continue; } utility1.checkFL(idBlkRef, pnt3dPnt); addOrphanToDicts("FlTagDict", idPnt.getHandle(), idBlkRef.getHandle(), idLdr.getHandle()); //Debug.Print(idPnt.getHandle().ToString()); break; } } catch (System.Exception ex) { Application.ShowAlertDialog(string.Format("{0} line 198", ex.Message)); } } catch (Autodesk.AutoCAD.Runtime.Exception ex5) { Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowAlertDialog(string.Format("{0} line 204", ex5.Message)); } } } wResults.pBar1.Value = i; } tr.Commit(); } } wResults.addControls(wResults, lbxAdd, hLnkAdds); wResults.addControls(wResults, lbxFix, hLnkFixs); using (BaseObjs._acadDoc.LockDocument()) { Dict.getNamedDictionary("CLKS", out exists); } wResults.pBar1.Value = 0; }