Ejemplo n.º 1
0
        public InspectorWrapper(MSOutlook.Inspector Inspector, InstantLookup<MSOutlook.Inspector> InstantLookup)
        {
            inspector = Inspector;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate += InspectorWrapper_Activate;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate += InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Close += InspectorWrapper_Close;

            instantLookup = InstantLookup;
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new LookupPane(), "German Grammar", inspector);
            taskPane.Visible = Properties.Settings.Default.LookupPaneVisible;
            taskPane.Width = Properties.Settings.Default.LookupPaneWidth;
            taskPane.Control.Tag = taskPane;
            taskPane.Control.SizeChanged += Control_SizeChanged;
        }
Ejemplo n.º 2
0
        public InspectorWrapper(MSOutlook.Inspector Inspector, InstantLookup <MSOutlook.Inspector> InstantLookup)
        {
            inspector = Inspector;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate   += InspectorWrapper_Activate;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate += InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Close      += InspectorWrapper_Close;

            instantLookup = InstantLookup;
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            taskPane                      = Globals.ThisAddIn.CustomTaskPanes.Add(new LookupPane(), "German Grammar", inspector);
            taskPane.Visible              = Properties.Settings.Default.LookupPaneVisible;
            taskPane.Width                = Properties.Settings.Default.LookupPaneWidth;
            taskPane.Control.Tag          = taskPane;
            taskPane.Control.SizeChanged += Control_SizeChanged;
        }
Ejemplo n.º 3
0
        private void ThisAddIn_Startup(object sender, EventArgs e)
        {
            db   = LemmaDatabase.CreateDefaultInstance();
            repo = new NounRepository(db);

            instantLookup         = new InstantLookup <MSOutlook.Inspector>(new OutlookActiveTextStrategy(Application), 250, repo);
            instantLookup.Paused  = true; // pause it, opening a window will unpause it...
            instantLookup.Enabled = Properties.Settings.Default.InstantLookupEnabled;

            inspectors = Application.Inspectors;
            inspectors.NewInspector += Inspectors_NewInspector;

            foreach (MSOutlook.Inspector inspector in inspectors)
            {
                Inspectors_NewInspector(inspector);
            }
        }
Ejemplo n.º 4
0
        private void ThisAddIn_Startup(object sender, EventArgs e)
        {
            db   = LemmaDatabase.CreateDefaultInstance();
            repo = new NounRepository(db);

            instantLookup = new InstantLookup <MSWord.Document>(new WordActiveTextStrategy(Application), 250, repo);
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            if (taskPaneVisible)
            {
                AddAllTaskPanes();
            }
            ((MSWord.ApplicationEvents4_Event)Application).NewDocument += ThisAddIn_NewDocument;
            Application.DocumentOpen   += Application_DocumentOpen;
            Application.DocumentChange += Application_DocumentChange;

            ToggleInstantLookup(this, instantLookupEnabled, null);
        }
Ejemplo n.º 5
0
        private void InspectorWrapper_Close()
        {
            taskPane.Control.SizeChanged -= Control_SizeChanged;
            Globals.ThisAddIn.CustomTaskPanes.Remove(taskPane);
            taskPane = null;

            instantLookup.Paused = true;
            instantLookup.OnLemmaFound -= InstantLookup_OnLemmaFound;
            instantLookup = null;

            Globals.ThisAddIn.InspectorWrappers.Remove(inspector);
            ((MSOutlook.InspectorEvents_Event)inspector).Close -= InspectorWrapper_Close;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate -= InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate -= InspectorWrapper_Activate;
            inspector = null;

            Properties.Settings.Default.Save(); //need to do this here, as I can't do it in the shutdown of the addon...
        }
Ejemplo n.º 6
0
        private void InspectorWrapper_Close()
        {
            taskPane.Control.SizeChanged -= Control_SizeChanged;
            Globals.ThisAddIn.CustomTaskPanes.Remove(taskPane);
            taskPane = null;

            instantLookup.Paused        = true;
            instantLookup.OnLemmaFound -= InstantLookup_OnLemmaFound;
            instantLookup = null;

            Globals.ThisAddIn.InspectorWrappers.Remove(inspector);
            ((MSOutlook.InspectorEvents_Event)inspector).Close      -= InspectorWrapper_Close;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate -= InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate   -= InspectorWrapper_Activate;
            inspector = null;

            Properties.Settings.Default.Save(); //need to do this here, as I can't do it in the shutdown of the addon...
        }
Ejemplo n.º 7
0
        private void ThisAddIn_Startup(object sender, EventArgs e)
        {
            db = LemmaDatabase.CreateDefaultInstance();
            repo = new NounRepository(db);

            instantLookup = new InstantLookup<MSWord.Document>(new WordActiveTextStrategy(Application), 250, repo);
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            if (taskPaneVisible)
            {
                AddAllTaskPanes();
            }
            ((MSWord.ApplicationEvents4_Event)Application).NewDocument += ThisAddIn_NewDocument;
            Application.DocumentOpen += Application_DocumentOpen;
            Application.DocumentChange += Application_DocumentChange;

            ToggleInstantLookup(this, instantLookupEnabled, null);
        }