Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            string examplePath = CodeExampleDemoUtils.GetExamplePath("CodeExamples");

            //string examplePath = "D:\\VB\\CS\\SpreadsheetMainDemo\\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);
            RearrangeExamples();
            MergeGroups();
            ShowExamplesInTreeList(treeList1, examples);

            this.codeEditor        = new ExampleCodeEditor(richEditControlCS, richEditControlVB);
            CurrentExampleLanguage = CodeExampleDemoUtils.DetectExampleLanguage("SpreadsheetChartAPISamples");
            this.evaluator         = new SpreadsheetExampleEvaluatorByTimer(); //this.components

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

            ShowFirstExample();
            this.xtraTabControl1.SelectedPageChanged += new TabPageChangedEventHandler(this.xtraTabControl1_SelectedPageChanged);
        }
Ejemplo n.º 2
0
        public void OnCompileExampleTimerTick(object sender, EventArgs e)
        {
            ExampleEvaluatorByTimer module = (ExampleEvaluatorByTimer)weakControlRef.Target;

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