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; }
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); } }
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); }
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; }
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; }
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); }
public NounManager() { _repository = new NounRepository(); _emailService = new EmailService(); _nounHelper = new NounHelper(); }