public void OnCompileExampleTimerTick(object sender, EventArgs e) { ExampleEvaluatorByTimer module = (ExampleEvaluatorByTimer)weakControlRef.Target; if (module != null) { module.CompileExample(sender, e); } }
//CultureInfo defaultCulture = new CultureInfo("en-US"); public MainWindow() { InitializeComponent(); string examplePath = "CodeExamples"; Dictionary <string, FileInfo> examplesCS = CodeExampleDemoUtils.GatherExamplesFromProject(examplePath, ExampleLanguage.Csharp); Dictionary <string, FileInfo> examplesVB = CodeExampleDemoUtils.GatherExamplesFromProject(examplePath, ExampleLanguage.VB); DisableTabs(examplesCS.Count, examplesVB.Count); List <CodeExampleGroup> examples = CodeExampleDemoUtils.FindExamples(examplePath, examplesCS, examplesVB); ShowExamplesInTreeList(treeList1, examples); richEditControlCS.Loaded += richEditControlCS_Loaded; richEditControlVB.Loaded += richEditControlVB_Loaded; this.evaluator = new RichEditExampleEvaluatorByTimer(); this.evaluator.QueryEvaluate += OnExampleEvaluatorQueryEvaluate; this.evaluator.OnBeforeCompile += evaluator_OnBeforeCompile; this.evaluator.OnAfterCompile += evaluator_OnAfterCompile; }
public LeakSafeCompileEventRouter(ExampleEvaluatorByTimer module) { //Guard.ArgumentNotNull(module, "module"); this.weakControlRef = new WeakReference(module); }