Activate() публичный Метод

public Activate ( ) : void
Результат void
Пример #1
0
        void UpdateCurrentDocumentController()
        {
            var activeDocument = GetActiveDocument();

            if (activeDocument == null)
            {
                Debug.WriteLine("UpdateCurrentDocumentController(): No active Document.");
                currentDocumentController = null;
                addinModule.UpdateState(null);
                return;
            }

            Debug.WriteLine("WindowCount=" + wordApp.Application.Windows.Count);

            Debug.WriteLine("UpdateCurrentDocumentController(): Updating current");
            currentDocumentController = GetControllerForDocument(activeDocument);
            currentDocumentController.Activate();

            currentDocumentController.Document.Application.ScreenUpdating = false;
            try
            {
                addinModule.SetSelectedStyle(currentDocumentController.Style ?? DefaultStyle);

                addinModule.UpdateState(new SelectionManager(currentDocumentController));
            }
            finally
            {
                currentDocumentController.Document.Application.ScreenUpdating = true;
            }
        }
Пример #2
0
        void UpdateCurrentDocumentController()
        {
            var activeDocument = GetActiveDocument();
            if (activeDocument == null)
            {
                Debug.WriteLine("UpdateCurrentDocumentController(): No active Document.");
                currentDocumentController = null;
                addinModule.UpdateState(null);
                return;
            }

            Debug.WriteLine("WindowCount=" + wordApp.Application.Windows.Count);

            Debug.WriteLine("UpdateCurrentDocumentController(): Updating current");
            currentDocumentController = GetControllerForDocument(activeDocument);
            currentDocumentController.Activate();

            currentDocumentController.Document.Application.ScreenUpdating = false;
            try
            {

                addinModule.SetSelectedStyle(currentDocumentController.Style ?? DefaultStyle);

                addinModule.UpdateState(new SelectionManager(currentDocumentController));
            }
            finally
            {
                currentDocumentController.Document.Application.ScreenUpdating = true;
            }
        }