Пример #1
0
        public void analyze(long max_duration_in_ms, ExceLint.FeatureConf config, Boolean forceDAGBuild, ProgBar pb)
        {
            var sw = new System.Diagnostics.Stopwatch();

            sw.Start();

            // disable screen updating during analysis to speed things up
            var initial_state = _app.ScreenUpdating;

            _app.ScreenUpdating = false;

            // Also disable alerts; e.g., Excel thinks that compute-bound plugins
            // are deadlocked and alerts the user.  ExceLint really is just compute-bound.
            _app.DisplayAlerts = false;

            // build data dependence graph
            try
            {
                // test
                Graph g = new Graph(_app, (Worksheet)_app.ActiveSheet);

                _analysis = inProcessAnalysis(max_duration_in_ms, config, g, Progress.NOPProgress());

                if (!_analysis.ranOK)
                {
                    System.Windows.Forms.MessageBox.Show("This spreadsheet contains no formulas.");
                    return;
                }
                //else
                //{
                //    var output = String.Join("\n", _analysis.model.ranking());
                //    System.Windows.Forms.Clipboard.SetText(output);
                //    System.Windows.Forms.MessageBox.Show("look in clipboard");
                //}
            }
            catch (AST.ParseException e)
            {
                // UI cleanup repeated here since the throw
                // below will cause the finally clause to be skipped
                _app.DisplayAlerts  = true;
                _app.ScreenUpdating = initial_state;

                throw e;
            }
            finally
            {
                // Re-enable alerts
                _app.DisplayAlerts = true;

                // Enable screen updating when we're done
                _app.ScreenUpdating = initial_state;
            }

            sw.Stop();
        }
Пример #2
0
 public ExceLint.EntropyModelBuilder2.EntropyModel2 NewEntropyModelForWorksheet2(Worksheet w, ExceLint.FeatureConf conf, Graph g, ProgBar pb)
 {
     // create
     return(ExceLint.ModelBuilder.initEntropyModel2(_app, conf, g, Progress.NOPProgress()));
 }