Esempio n. 1
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);
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
 private void LoadDatabase(string fileName)
 {
     updateDatabase = false;
     if (db != null)
     {
         db.CloseDatabase();
     }
     if (fileName == null)
     {
         db = LemmaDatabase.CreateDefaultInstance();
     }
     else
     {
         db = new LemmaDatabase(fileName);
     }
     db.OpenChangeSet();
     nounRepo = new NounRepository(db);
     prepRepo = new PrepositionRepository(db);
     RefreshGridView();
     updateDatabase = true;
 }