/// <summary> /// Отключение палитры свойств интеллектуальных примитивов от палитры ModPlus /// </summary> /// <param name="fromSettings">True - метод запущен из окна настроек палитры</param> public static void RemoveFromMpPalette(bool fromSettings) { var mpPaletteSet = MpPalette.MpPaletteSet; if (mpPaletteSet != null) { var num = 0; while (num < mpPaletteSet.Count) { if (!mpPaletteSet[num].Name.Equals(Language.GetItem("h11"))) { num++; } else { mpPaletteSet.Remove(num); break; } } } if (PropertiesPaletteFunction.PaletteSet != null) { PropertiesPaletteFunction.PaletteSet.Visible = true; } else if (fromSettings) { if (AcApp.DocumentManager.MdiActiveDocument != null) { PropertiesPaletteFunction.Start(); } } }
private void AcAppOnSystemVariableChanged(object sender, SystemVariableChangedEventArgs e) { if (e.Name.Equals("WSCURRENT") && MainSettings.Instance.AutoLoad & !MainSettings.Instance.AddToMpPalette) { PropertiesPaletteFunction.Start(); } }
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { if (!args.Name.Contains("ModPlus_")) { return(null); } AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; PropertiesPaletteFunction.Start(); return(null); }
/// <inheritdoc /> public void Initialize() { StartUpInitialize(); // Functions Init TypeFactory.Instance.GetEntityFunctionTypes().ForEach(f => f.Initialize()); Overrule.Overruling = true; // ribbon build for Autodesk.Windows.ComponentManager.ItemInitialized += ComponentManager_ItemInitialized; // palette var loadPropertiesPalette = MainSettings.Instance.AutoLoad; var addPropertiesPaletteToMpPalette = MainSettings.Instance.AddToMpPalette; if (loadPropertiesPalette & !addPropertiesPaletteToMpPalette) { PropertiesPaletteFunction.Start(); } else if (loadPropertiesPalette & addPropertiesPaletteToMpPalette) { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; } AcApp.SystemVariableChanged += AcAppOnSystemVariableChanged; // bedit watcher BeditCommandWatcher.Initialize(); AcApp.BeginDoubleClick += AcApp_BeginDoubleClick; AcadUtils.Documents.DocumentCreated += Documents_DocumentCreated; AcadUtils.Documents.DocumentActivated += Documents_DocumentActivated; foreach (Document document in AcadUtils.Documents) { document.ImpliedSelectionChanged += Document_ImpliedSelectionChanged; } }