Beispiel #1
0
        private static CompilerErrorCollection CreateFeature(
            string code, out FeatureDemo featureDemo, out FeatureInfo featureInfo)
        {
            Type featureDemoType;
            CompilerErrorCollection compilerErrorCollection = FeatureCompiler.TryCompile(code, out featureDemoType);

            if (compilerErrorCollection.HasErrors)
            {
                featureInfo = null;
                featureDemo = null;
                return(compilerErrorCollection);
            }
            else
            {
                string errorMessage;
                if (FeatureLoader.TryGetFeatureInfo(
                        featureDemoType,
                        new CompilationCodeLoader(code),
                        out featureInfo,
                        out errorMessage))
                {
                    featureDemo = CreateFeature(featureInfo);
                    return(EmptyErrorCollection);
                }
                else
                {
                    featureDemo = null;
                    featureInfo = null;
                    return(FeatureCompiler.GetCustomCompilerError("!!!", errorMessage));
                }
            }
        }
Beispiel #2
0
        public void CreateAndRun(FeatureInfo featureInfo)
        {
            FeatureDemo featureDemo = CreateFeature(featureInfo);

            featureViewer.SetNewFeatureAndShowChart(
                featureInfo.FeatureName,
                featureInfo.LoadCode(),
                EmptyErrorCollection);
            RunFeature(featureDemo, featureInfo);
            lastFeatureFromAssebly = featureInfo;
        }
Beispiel #3
0
        private void RunFeature(FeatureDemo featureDemo, FeatureInfo featureInfo)
        {
            if (executingFeatureDemo != null)
            {
                executingFeatureDemo.Stop(chartControl);
                executingFeatureDemo = null;
            }

            if (featureInfo.ShouldResetViewBeforeRun)
            {
                chartControl.Reset();
            }
            if (featureInfo.RunOnSuspend)
            {
                PrimarySettings.Setup(chartControl);
                featureDemo.Do(chartControl);
            }
            else
            {
                featureDemo.Do(chartControl);
            }

            executingFeatureDemo = featureDemo;
        }
Beispiel #4
0
 public void StopAll()
 {
     executingFeatureDemo?.Stop(chartControl);
     executingFeatureDemo = null;
 }