Exemple #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="BindingExpressionCompilerOptions"/> class from the specified set of flags.
        /// </summary>
        private static BindingExpressionCompilerOptions CreateCompilerOptions(String root, CompileExpressionsFlags flags)
        {
            var generateInMemory = (flags & CompileExpressionsFlags.GenerateInMemory) == CompileExpressionsFlags.GenerateInMemory;
            var options          = new BindingExpressionCompilerOptions()
            {
                GenerateInMemory         = generateInMemory,
                WriteErrorsToFile        = true,
                Input                    = root,
                Output                   = CompiledExpressionsAssemblyName,
                IgnoreCache              = generateInMemory || (flags & CompileExpressionsFlags.IgnoreCache) == CompileExpressionsFlags.IgnoreCache,
                WorkInTemporaryDirectory = (flags & CompileExpressionsFlags.WorkInTemporaryDirectory) == CompileExpressionsFlags.WorkInTemporaryDirectory
            };

            return(options);
        }
        /// <summary>
        /// Creates a new instance of the <see cref="BindingExpressionCompilerOptions"/> class from the specified set of flags.
        /// </summary>
        private static BindingExpressionCompilerOptions CreateCompilerOptions(String root, CompileExpressionsFlags flags)
        {
            var options = new BindingExpressionCompilerOptions()
            {
                GenerateInMemory  = flags.HasFlag(CompileExpressionsFlags.GenerateInMemory),
                WriteErrorsToFile = true,
                WriteCompiledFilesToWorkingDirectory = flags.HasFlag(CompileExpressionsFlags.WriteCompiledFilesToWorkingDirectory),
                Input       = root,
                Output      = CompiledExpressionsAssemblyName,
                IgnoreCache = flags.HasFlag(CompileExpressionsFlags.GenerateInMemory) || flags.HasFlag(CompileExpressionsFlags.IgnoreCache),
                WorkInTemporaryDirectory = flags.HasFlag(CompileExpressionsFlags.WorkInTemporaryDirectory),
            };

            return(options);
        }