示例#1
0
        public void Init()
        {
            var config = new Configuration()
            {
                dexterHome       = "D:/Applications/dexter/0.9.2/dexter-cli_0.9.2_32/",
                projectName      = "TestData",
                type             = "PROJECT",
                sourceDir        = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" },
                headerDir        = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" },
                projectFullPath  = AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/",
                dexterServerPort = "0",
                dexterServerIp   = "dexter-server"
            };

            dexter = new Dexter(config);
        }
示例#2
0
        public void Init()
        {
            var config = new Configuration()
            {
                dexterHome = "D:/Applications/dexter/0.9.2/dexter-cli_0.9.2_32/",
                projectName = "TestData",
                type = "PROJECT",
                sourceDir = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" },
                headerDir = { AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/" },
                projectFullPath = AppDomain.CurrentDomain.BaseDirectory + "../../TestData/SampleCppProject/",
                dexterServerPort = "0",
                dexterServerIp = "dexter-server"
            };

            dexter = new Dexter(config);
        }
        /// <summary>
        /// Validates configuration and performs analysis
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        protected override void CommandClicked(object sender, EventArgs e)
        {
            Configuration config = ConfigurationProvider.Load();

            if (!ValidateConfiguration(config))
            {
                return;
            }

            OutputWindowPane outputPane = CreatePane("Dexter");
            outputPane.Clear();
            outputPane.Activate();

            System.Threading.Tasks.Task.Run(() =>
            {
                dexter = new Dexter(config);
                DataReceivedEventHandler writeToOutputPane = (s, e1) => outputPane.OutputString(e1.Data + Environment.NewLine);
                dexter.OutputDataReceived += writeToOutputPane;
                dexter.ErrorDataReceived += writeToOutputPane;
                OnAnalysisStarted(EventArgs.Empty);
                Result result = dexter.Analyse();
                OnAnalysisFinished(EventArgs.Empty);
                ReportResult(result);
            });
        }