Example #1
0
        public Form1()
        {
            InitializeComponent();

            string examplePath = CodeExampleDemoUtils.GetExamplePath("CodeExamples");

            Dictionary <string, FileInfo> examplesCS = CodeExampleDemoUtils.GatherExamplesFromProject(examplePath, ExampleLanguage.Csharp);
            Dictionary <string, FileInfo> examplesVB = CodeExampleDemoUtils.GatherExamplesFromProject(examplePath, ExampleLanguage.VB);

            DisableTabs(examplesCS.Count, examplesVB.Count);
            this.examples = CodeExampleDemoUtils.FindExamples(examplePath, examplesCS, examplesVB);
            ShowExamplesInTreeList(treeList1, examples);

            this.codeEditor        = new ExampleCodeEditor(richEditControlCS, richEditControlVB, richEditControlCSClass, richEditControlVBClass);
            CurrentExampleLanguage = CodeExampleDemoUtils.DetectExampleLanguage("SchedulerAPISample");
            this.evaluator         = new RichEditExampleEvaluatorByTimer();

            this.evaluator.QueryEvaluate             += OnExampleEvaluatorQueryEvaluate;
            this.evaluator.OnBeforeCompile           += evaluator_OnBeforeCompile;
            this.evaluator.OnAfterCompile            += evaluator_OnAfterCompile;
            this.xtraTabControl1.SelectedPageChanged += xtraTabControl1_SelectedPageChanged;

            ShowFirstExample("Custom Draw");
            treeList1.CollapseAll();
        }
Example #2
0
        public void OnCompileExampleTimerTick(object sender, EventArgs e)
        {
            ExampleEvaluatorByTimer module = (ExampleEvaluatorByTimer)weakControlRef.Target;

            if (module != null)
            {
                module.CompileExample(sender, e);
            }
        }
Example #3
0
 public LeakSafeCompileEventRouter(ExampleEvaluatorByTimer module)
 {
     //Guard.ArgumentNotNull(module, "module");
     this.weakControlRef = new WeakReference(module);
 }