Application specific runtime settings
Inheritance: ICloneable
Example #1
0
        public object Clone()
        {
            ExecuteOptions clone = new ExecuteOptions();

            clone.processFile    = this.processFile;
            clone.scriptFileName = this.scriptFileName;
            // clone.noLogo = this.noLogo;
            clone.useCompiled = this.useCompiled;
            clone.suppressTimestampAltering = this.suppressTimestampAltering;
            clone.useSmartCaching           = this.useSmartCaching;
            clone.DLLExtension      = this.DLLExtension;
            clone.forceCompile      = this.forceCompile;
            clone.suppressExecution = this.suppressExecution;
            clone.syntaxCheck       = this.syntaxCheck;
            clone.DBG                        = this.DBG;
            clone.TargetFramework            = this.TargetFramework;
            clone.verbose                    = this.verbose;
            clone.startDebugger              = this.startDebugger;
            clone.local                      = this.local;
            clone.buildExecutable            = this.buildExecutable;
            clone.refAssemblies              = new List <string>(this.refAssemblies).ToArray();
            clone.searchDirs                 = new List <string>(this.searchDirs).ToArray();
            clone.buildWinExecutable         = this.buildWinExecutable;
            clone.useSurrogateHostingProcess = this.useSurrogateHostingProcess;
            clone.altCompiler                = this.altCompiler;
            clone.roslynDir                  = this.roslynDir;
            clone.consoleEncoding            = this.consoleEncoding;
            clone.resolveAutogenFilesRefs    = this.resolveAutogenFilesRefs;
            clone.preCompilers               = this.preCompilers;
            clone.postProcessor              = this.postProcessor;
            clone.compilerOptions            = this.compilerOptions;
            clone.reportDetailedErrorInfo    = this.reportDetailedErrorInfo;
            clone.hideCompilerWarnings       = this.hideCompilerWarnings;
            clone.apartmentState             = this.apartmentState;
            clone.openEndDirectiveSyntax     = this.openEndDirectiveSyntax;
            clone.forceOutputAssembly        = this.forceOutputAssembly;
            clone.cleanupShellCommand        = this.cleanupShellCommand;
            clone.versionOnly                = this.versionOnly;
            clone.noConfig                   = this.noConfig;
            //clone.suppressExternalHosting = this.suppressExternalHosting;
            clone.altConfig                  = this.altConfig;
            clone.defaultRefAssemblies       = this.defaultRefAssemblies;
            clone.hideTemp                   = this.hideTemp;
            clone.autoClass                  = this.autoClass;
            clone.autoClass_InjectBreakPoint = this.autoClass_InjectBreakPoint;
            clone.decorateAutoClassAsCS6     = this.decorateAutoClassAsCS6;
            clone.enableDbgPrint             = this.enableDbgPrint;
            clone.initContext                = this.initContext;
            clone.nonExecuteOpRquest         = this.nonExecuteOpRquest;
            clone.customHashing              = this.customHashing;
            clone.compilationContext         = this.compilationContext;
            clone.useScriptConfig            = this.useScriptConfig;
            clone.customConfigFileName       = this.customConfigFileName;
            clone.scriptFileNamePrimary      = this.scriptFileNamePrimary;
            clone.doCleanupAfterNumberOfRuns = this.doCleanupAfterNumberOfRuns;
            clone.inMemoryAsm                = this.inMemoryAsm;
            clone.concurrencyControl         = this.concurrencyControl;
            clone.shareHostRefAssemblies     = this.shareHostRefAssemblies;
            return(clone);
        }
Example #2
0
        public object Derive()
        {
            ExecuteOptions clone = new ExecuteOptions();

            clone.processFile = this.processFile;
            //some props will be further set by the caller
            //clone.scriptFileName = this.scriptFileName;
            //clone.noLogo = this.noLogo;
            //clone.useCompiled = this.useCompiled;
            clone.useSmartCaching = this.useSmartCaching;
            //clone.DLLExtension = this.DLLExtension;
            //clone.forceCompile = this.forceCompile;
            clone.supressExecution = this.supressExecution;
            clone.InjectScriptAssemblyAttribute = this.InjectScriptAssemblyAttribute;
            clone.resolveAutogenFilesRefs       = this.resolveAutogenFilesRefs;
            clone.DBG             = this.DBG;
            clone.TargetFramework = this.TargetFramework;
            clone.verbose         = this.verbose;
            clone.local           = this.local;
            clone.buildExecutable = this.buildExecutable;
#if net1
            clone.refAssemblies = (string[])new ArrayList(this.refAssemblies).ToArray(typeof(string));
            clone.searchDirs    = (string[])new ArrayList(this.searchDirs).ToArray(typeof(string));
#else
            clone.refAssemblies = new List <string>(this.refAssemblies).ToArray();
            clone.searchDirs    = new List <string>(this.searchDirs).ToArray();
#endif
            clone.buildWinExecutable      = this.buildWinExecutable;
            clone.altCompiler             = this.altCompiler;
            clone.preCompilers            = this.preCompilers;
            clone.defaultRefAssemblies    = this.defaultRefAssemblies;
            clone.postProcessor           = this.postProcessor;
            clone.compilerOptions         = this.compilerOptions;
            clone.reportDetailedErrorInfo = this.reportDetailedErrorInfo;
            clone.hideCompilerWarnings    = this.hideCompilerWarnings;
            clone.openEndDirectiveSyntax  = this.openEndDirectiveSyntax;
            clone.apartmentState          = this.apartmentState;
            clone.forceOutputAssembly     = this.forceOutputAssembly;
            clone.versionOnly             = this.versionOnly;
            clone.cleanupShellCommand     = this.cleanupShellCommand;
            clone.noConfig = this.noConfig;
            //clone.suppressExternalHosting = this.suppressExternalHosting;
            clone.compilationContext         = this.compilationContext;
            clone.autoClass                  = this.autoClass;
            clone.autoClass_InjectBreakPoint = this.autoClass_InjectBreakPoint;
            clone.decorateAutoClassAsCS6     = this.decorateAutoClassAsCS6;
            clone.enableDbgPrint             = this.enableDbgPrint;
            clone.customHashing              = this.customHashing;
            clone.altConfig                  = this.altConfig;
            clone.hideTemp                   = this.hideTemp;
            clone.nonExecuteOpRquest         = this.nonExecuteOpRquest;
            clone.initContext                = this.initContext;
            clone.scriptFileNamePrimary      = this.scriptFileNamePrimary;
            clone.doCleanupAfterNumberOfRuns = this.doCleanupAfterNumberOfRuns;
            clone.shareHostRefAssemblies     = this.shareHostRefAssemblies;
            clone.concurrencyControl         = this.concurrencyControl;
            clone.inMemoryAsm                = this.inMemoryAsm;

            return(clone);
        }
Example #3
0
        public object Clone()
        {
            ExecuteOptions clone = new ExecuteOptions();

            clone.processFile      = this.processFile;
            clone.scriptFileName   = this.scriptFileName;
            clone.noLogo           = this.noLogo;
            clone.useCompiled      = this.useCompiled;
            clone.useSmartCaching  = this.useSmartCaching;
            clone.DLLExtension     = this.DLLExtension;
            clone.forceCompile     = this.forceCompile;
            clone.supressExecution = this.supressExecution;
            clone.DBG             = this.DBG;
            clone.TargetFramework = this.TargetFramework;
            clone.verbose         = this.verbose;
            clone.startDebugger   = this.startDebugger;
            clone.local           = this.local;
            clone.buildExecutable = this.buildExecutable;
#if net1
            clone.refAssemblies = (string[])new ArrayList(this.refAssemblies).ToArray(typeof(string));
            clone.searchDirs    = (string[])new ArrayList(this.searchDirs).ToArray(typeof(string));
#else
            clone.refAssemblies = new List <string>(this.refAssemblies).ToArray();
            clone.searchDirs    = new List <string>(this.searchDirs).ToArray();
#endif

            clone.buildWinExecutable         = this.buildWinExecutable;
            clone.useSurrogateHostingProcess = this.useSurrogateHostingProcess;
            clone.altCompiler             = this.altCompiler;
            clone.consoleEncoding         = this.consoleEncoding;
            clone.preCompilers            = this.preCompilers;
            clone.postProcessor           = this.postProcessor;
            clone.compilerOptions         = this.compilerOptions;
            clone.reportDetailedErrorInfo = this.reportDetailedErrorInfo;
            clone.hideCompilerWarnings    = this.hideCompilerWarnings;
            clone.apartmentState          = this.apartmentState;
            clone.openEndDirectiveSyntax  = this.openEndDirectiveSyntax;
            clone.forceOutputAssembly     = this.forceOutputAssembly;
            clone.cleanupShellCommand     = this.cleanupShellCommand;
            clone.versionOnly             = this.versionOnly;
            clone.noConfig = this.noConfig;
            //clone.suppressExternalHosting = this.suppressExternalHosting;
            clone.altConfig                  = this.altConfig;
            clone.defaultRefAssemblies       = this.defaultRefAssemblies;
            clone.hideTemp                   = this.hideTemp;
            clone.autoClass                  = this.autoClass;
            clone.initContext                = this.initContext;
            clone.customHashing              = this.customHashing;
            clone.compilationContext         = this.compilationContext;
            clone.useScriptConfig            = this.useScriptConfig;
            clone.customConfigFileName       = this.customConfigFileName;
            clone.scriptFileNamePrimary      = this.scriptFileNamePrimary;
            clone.doCleanupAfterNumberOfRuns = this.doCleanupAfterNumberOfRuns;
            clone.inMemoryAsm                = this.inMemoryAsm;
            clone.shareHostRefAssemblies     = this.shareHostRefAssemblies;
            return(clone);
        }
Example #4
0
        public object Clone()
        {
            ExecuteOptions clone = new ExecuteOptions();
            clone.processFile = this.processFile;
            clone.scriptFileName = this.scriptFileName;
            clone.noLogo = this.noLogo;
            clone.useCompiled = this.useCompiled;
            clone.useSmartCaching = this.useSmartCaching;
            clone.DLLExtension = this.DLLExtension;
            clone.forceCompile = this.forceCompile;
            clone.supressExecution = this.supressExecution;
            clone.DBG = this.DBG;
            clone.TargetFramework = this.TargetFramework;
            clone.verbose = this.verbose;
            clone.startDebugger = this.startDebugger;
            clone.local = this.local;
            clone.buildExecutable = this.buildExecutable;
#if net1
                clone.refAssemblies = (string[])new ArrayList(this.refAssemblies).ToArray(typeof(string));
                clone.searchDirs = (string[])new ArrayList(this.searchDirs).ToArray(typeof(string));

#else
            clone.refAssemblies = new List<string>(this.refAssemblies).ToArray();
            clone.searchDirs = new List<string>(this.searchDirs).ToArray();
#endif

            clone.buildWinExecutable = this.buildWinExecutable;
            clone.useSurrogateHostingProcess = this.useSurrogateHostingProcess;
            clone.altCompiler = this.altCompiler;
            clone.preCompilers = this.preCompilers;
            clone.postProcessor = this.postProcessor;
            clone.compilerOptions = this.compilerOptions;
            clone.reportDetailedErrorInfo = this.reportDetailedErrorInfo;
            clone.hideCompilerWarnings = this.hideCompilerWarnings;
            clone.apartmentState = this.apartmentState;
            clone.openEndDirectiveSyntax = this.openEndDirectiveSyntax;
            clone.forceOutputAssembly = this.forceOutputAssembly;
            clone.cleanupShellCommand = this.cleanupShellCommand;
            clone.versionOnly = this.versionOnly;
            clone.noConfig = this.noConfig;
            //clone.suppressExternalHosting = this.suppressExternalHosting;
            clone.altConfig = this.altConfig;
            clone.defaultRefAssemblies = this.defaultRefAssemblies;
            clone.hideTemp = this.hideTemp;
            clone.autoClass = this.autoClass;
            clone.compilationContext = this.compilationContext;
            clone.useScriptConfig = this.useScriptConfig;
            clone.customConfigFileName = this.customConfigFileName;
            clone.scriptFileNamePrimary = this.scriptFileNamePrimary;
            clone.doCleanupAfterNumberOfRuns = this.doCleanupAfterNumberOfRuns;
            clone.inMemoryAsm = this.inMemoryAsm;
            clone.shareHostRefAssemblies = this.shareHostRefAssemblies;
            return clone;
        }
Example #5
0
 public ExecuteOptions()
 {
     options = this;
 }
Example #6
0
 public ExecuteOptions()
 {
     options = this;
 }
Example #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        public CSExecutor(bool rethrow, ExecuteOptions optionsBase)
        {
            this.rethrow = rethrow;
            options = new ExecuteOptions();

            //force to read all relative options data from the config file
            options.noConfig = optionsBase.noConfig;
            options.altConfig = optionsBase.altConfig;
        }
Example #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 public CSExecutor()
 {
     rethrow = false;
     options = new ExecuteOptions();
 }
Example #9
0
			public object Derive()
			{
				ExecuteOptions clone = new ExecuteOptions();
				clone.processFile = this.processFile;
				//clone.scriptFileName = this.scriptFileName;
				//clone.noLogo = this.noLogo;
				//clone.useCompiled = this.useCompiled;
				clone.useSmartCaching = this.useSmartCaching;
				//clone.DLLExtension = this.DLLExtension;
				//clone.forceCompile = this.forceCompile;
				clone.supressExecution = this.supressExecution;
				clone.DBG = this.DBG;
				clone.local = this.local;
				clone.buildExecutable = this.buildExecutable;
				clone.refAssemblies = (string[])new ArrayList(this.refAssemblies).ToArray(typeof(string));
				clone.searchDirs = (string[])new ArrayList(this.searchDirs).ToArray(typeof(string));
				clone.buildWinExecutable = this.buildWinExecutable;
				clone.altCompiler = this.altCompiler;
				clone.compilerOptions = this.compilerOptions;
				clone.reportDetailedErrorInfo = this.reportDetailedErrorInfo;
				clone.hideCompilerWarnings = this.hideCompilerWarnings;
				clone.apartmentState = this.apartmentState;
				clone.forceOutputAssembly = this.forceOutputAssembly;
				clone.cleanupShellCommand = this.cleanupShellCommand;
				clone.noConfig = this.noConfig;
				clone.altConfig = this.altConfig;
				clone.hideTemp = this.hideTemp;
				clone.scriptFileNamePrimary = this.scriptFileNamePrimary;
				clone.doCleanupAfterNumberOfRuns = this.doCleanupAfterNumberOfRuns;
				return clone; 
			}
Example #10
0
        public static string ShowHelp(string helpType, params object[] context)
        {
            switch (helpType)
            {
            case AppArgs.dir:
            {
                ExecuteOptions options  = (ExecuteOptions)context[0];
                Settings       settings = CSExecutor.LoadSettings(options);

                StringBuilder builder = new StringBuilder();
                builder.Append(string.Format("{0}\n", Environment.CurrentDirectory));

                foreach (string dir in Environment.ExpandEnvironmentVariables(settings.SearchDirs).Split(",;".ToCharArray()))
                {
                    if (dir.Trim() != "")
                    {
                        builder.Append(string.Format("{0}\n", dir));
                    }
                }

                builder.Append(string.Format("{0}\n", typeof(HelpProvider).Assembly.GetAssemblyDirectoryName()));
                return(builder.ToString());
            }

            case AppArgs.syntax: return(AppArgs.syntaxHelp);

            case AppArgs.cmd:
            case AppArgs.commands:
            {
                Dictionary <string, string> map = new Dictionary <string, string>();
                int longestArg = 0;
                foreach (FieldInfo info in typeof(AppArgs).GetFields())
                {
                    if (info.IsPublic && info.IsLiteral && info.IsStatic && info.FieldType == typeof(string))
                    {
                        string arg         = (string)info.GetValue(null);
                        string description = "";

                        if (AppArgs.switch1Help.ContainsKey(arg))
                        {
                            description = AppArgs.switch1Help[arg].Description;
                        }
                        if (AppArgs.switch2Help.ContainsKey(arg))
                        {
                            description = AppArgs.switch2Help[arg].Description;
                        }

                        if (map.ContainsKey(description))
                        {
                            string capturedArg = map[description];
                            if (capturedArg.Length > arg.Length)
                            {
                                map[description] = capturedArg + "|" + arg;
                            }
                            else
                            {
                                map[description] = arg + "|" + capturedArg;
                            }
                        }
                        else
                        {
                            map[description] = arg;
                        }

                        longestArg = Math.Max(map[description].Length, longestArg);
                    }
                }


                StringBuilder builder = new StringBuilder();
                foreach (string key in map.Keys)
                {
                    string arg = map[key].Trim();
                    arg = String.Format("{0,-" + longestArg + "}", arg);
                    builder.Append(string.Format("{0}   {1}\n", arg, key));
                }
                return(builder.ToString());
            }

            default:
                return("<unknown command>");
            }
        }