示例#1
0
        public InstantLookup(ActiveTextStrategy <T> strategy, int interval, NounRepository repo)
        {
            ActiveTextStrategy = strategy;
            enabled            = false;
            paused             = false;

            lookupTimer          = new Timer();
            lookupTimer.Interval = interval;
            lookupTimer.Tick    += LookupActiveText;

            LemmaRepository = repo;
        }
示例#2
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);
            }
        }
示例#3
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);
        }
示例#4
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;
 }
示例#5
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;
 }
示例#6
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);
        }
示例#7
0
 public NounManager()
 {
     _repository   = new NounRepository();
     _emailService = new EmailService();
     _nounHelper   = new NounHelper();
 }