This class hide the underlying network components to the upper layer. It provide a set of logic function to call, and each call will trigger a network request to call the same function in Java ACP under ACPLogic class. Author: Loke Yan Hao
        private int paragraphSpace = 2; // to store each additional paragraph space cost range value of 1

        #endregion Fields

        #region Constructors

        public ExtensionMode(Client logic)
        {
            this.logic = logic;
        }
Example #2
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;

            SetKeyboardHook();
            SetMouseHook();

            // Track the handle ID for the text editor (Microsoft Word)
            int handle = (int) GetActiveWindow();
            currentSelection = Application.Selection;

            // Initialize forms and set Microsoft Word as the parent window
            autoCompleteForm = new AutoCompleteForm();
            notificationForm = new Notification();
            extendSuggestionForm = new ExtendSuggestionHint();

            Application.WindowActivate += new Word.ApplicationEvents4_WindowActivateEventHandler(Application_WindowActivate);
            Application.WindowDeactivate += new Word.ApplicationEvents4_WindowDeactivateEventHandler(Application_WindowDeactivate);
            Application.WindowSize += new Microsoft.Office.Interop.Word.ApplicationEvents4_WindowSizeEventHandler(OnWindowSizeChange);

            //Convert Words DPI based Height and Width
            System.Drawing.Graphics g = notificationForm.CreateGraphics();
            dpi = g.DpiX;

            updateApplicationSizeDetail();

            logic = new Client();

            bool serverStatus = initConfiguration();
            extMode = new ExtensionMode(logic);

            if (serverStatus)
            {
                tourForm = new Tour(this.config, configurationFilePath);
                if (tourEnabled)
                {
                    tourForm.ShowDialog();
                }
            }
            else
            {
                // Setting this to true allow ACP to inform user that ACP is not been running
                isDisablePopUp = true;
            }

            // for user testing
            startTestTime = "START TIME," + DateTime.Now.ToString("HH:mm:ss") + "\r";
        }