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);
            CurrentExampleLanguage = CodeExampleDemoUtils.DetectExampleLanguage("SnapServerExamples");
            this.evaluator         = new RichEditExampleEvaluatorByTimer();

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

            ShowFirstExample();
            treeList1.ExpandAll();
        }
Exemplo n.º 2
0
        void CreateCodeEditor()
        {
            System.Diagnostics.Debug.Assert(codeEditor == null);

            richEditControlCS.Tag = "Cs";
            richEditControlVB.Tag = "Vb";
            this.codeEditor       = new ExampleCodeEditor(richEditControlCS, richEditControlVB);
            this.codeEditor.CurrentExampleLanguage = CurrentExampleLanguage;

            ShowFirstExample();
        }