Beispiel #1
0
        public void StartPolygonCheckSequence(Document document)
        {
            // Call End() first
            End(clearTransient: document == Document);

            // Set MapCleanService singleton instance related document.
            Document = document;

            InitializePolygonActionAgents();

            // 创建MapClean View和ViewModel.
            _actionsSettingViewModel = new ActionsSettingViewModel(this);
            _actionsSettingViewModel.ActionSelectVM.BreakCrossingObjects = false;

            ShowIntegrateCheckItem = false;
            // Action sequence palette set
            var actionSequenceVM = ActionSequenceViewModel;

            if (actionSequenceVM != null)
            {
                actionSequenceVM.Refresh();
            }

            ShowActionPalette(show: true, recordState: true);
            var displayName   = "多边形拓扑检查";
            var sequencePanel = AllPaletteSets.GetPaletteSet <ActionSequencePaletteSet>();

            sequencePanel.DisplayName = displayName;
            var resultPanel = AllPaletteSets.GetPaletteSet <MapCleanPaletteSet>();

            resultPanel.DisplayName = displayName;
        }
Beispiel #2
0
        private void OnDocumentBecameCurrent(object sender, DocumentCollectionEventArgs e)
        {
            // If the current document is not equal to this.Document, close the map clean panel.
            if (e.Document == Document)
            {
                if (_panelPreviousVisible != null && _panelPreviousVisible.Value)
                {
                    ShowMapCleanPanel(show: true, recordState: false);
                }

                if (_actionPalettePreviousVisible != null && _actionPalettePreviousVisible.Value)
                {
                    ShowActionPalette(show: true, recordState: false);
                }
            }
            else
            {
                // If the current document is equal to this.Document, show the map clean panel.
                if (AllPaletteSets.IsPaletteSetVisible(PaletteSetType.MapClean))
                {
                    _panelPreviousVisible = true;
                    ShowMapCleanPanel(show: false, recordState: false);
                }

                if (AllPaletteSets.IsPaletteSetVisible(PaletteSetType.ActionSequence))
                {
                    _actionPalettePreviousVisible = true;
                    ShowActionPalette(show: false, recordState: false);
                }
            }
        }
Beispiel #3
0
 static void OnDocumentDestroyed(object sender, DocumentDestroyedEventArgs args)
 {
     // If there are many documents, and one of them is about to be closed, the MdiActiveDocument is null.
     // We should test the Count, if the value is 1, that means the last document is going to close.
     if (Application.DocumentManager.Count == 1)
     {
         AllPaletteSets.ClosePalettes();
     }
 }
Beispiel #4
0
        private void RegisterPalettesetEvents()
        {
            var palette = AllPaletteSets.GetPaletteSet(PaletteSetType.MapClean);

            palette.VisibilityChanged += OnPanelVisibilityChanged;
            var actionPalette = AllPaletteSets.GetPaletteSet(PaletteSetType.ActionSequence);

            actionPalette.VisibilityChanged += OnActionPaletteVisibilityChanged;
        }
Beispiel #5
0
 static void OnDocumentBecameCurrent(object sender, DocumentCollectionEventArgs args)
 {
     if (args.Document != null)
     {
         var paletteSetTypes = new PaletteSetType[] { PaletteSetType.MapClean };
         AllPaletteSets.RestoreVisibility(paletteSetTypes, args.Document);
     }
     else
     {
         AllPaletteSets.ClosePalettes();
     }
 }
Beispiel #6
0
 public void ShowActionPalette(bool show, bool recordState)
 {
     using (var switcher = new RecordActionPalettePreviousStateSwitcher(this, recordState))
     {
         if (show)
         {
             AllPaletteSets.DisplayPaletteSet(PaletteSetType.ActionSequence, Document);
         }
         else
         {
             AllPaletteSets.ClosePaletteSet(PaletteSetType.ActionSequence);
         }
     }
 }
Beispiel #7
0
 public void ShowMapCleanPanel(bool show, bool recordState)
 {
     using (var switcher = new RecordPanelPreviousStateSwitcher(this, recordState))
     {
         if (show)
         {
             AllPaletteSets.DisplayPaletteSet(PaletteSetType.MapClean, Document);
         }
         else
         {
             AllPaletteSets.ClosePaletteSet(PaletteSetType.MapClean);
         }
     }
 }
Beispiel #8
0
        public void StartPolygonCheckConsole(Document document, ActionType actionType)
        {
            // Call End() first
            End(clearTransient: document == Document, hideResultPanel: false);

            // Set MapCleanService singleton instance related document.
            Document = document;

            // Intialize action agents
            _actionAgents.Clear();
            AddActionAgent(actionType, new ActionType[0], ActionStatus.Pending);
            var resultPanel = AllPaletteSets.GetPaletteSet <MapCleanPaletteSet>();

            var displayName = "多边形拓扑检查";

            resultPanel.DisplayName = displayName;
        }
Beispiel #9
0
        public void Initialize()
        {
            // Set single instance
            _instance = this;

            DialogService.Instance.MainHandle =
                Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Handle;
            try
            {
                AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);

                // WL: 这里有点问题,会有exception
                // Initialize the state of all palette sets.
                AllPaletteSets.InitPaletteSets();
            }
            catch (System.Exception ex)
            {
            }
        }
Beispiel #10
0
 public void Terminate()
 {
     AllPaletteSets.DisposePaletteSets();
 }