当前位置: 首页>>代码示例>>C#>>正文


C# Executor类代码示例

本文整理汇总了C#中Executor的典型用法代码示例。如果您正苦于以下问题:C# Executor类的具体用法?C# Executor怎么用?C# Executor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Executor类属于命名空间,在下文中一共展示了Executor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: If

 public static void If(Executor exec)
 {
     var code = exec.DataStack.Pop<Tokens.CodeBlock>().Value;
     var condition = exec.DataStack.Pop<Tokens.Number>().Value != 0;
     if (condition)
         exec.CodeStack.PushRange(code);
 }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Conditional.cs

示例2: Bury

        public static void Bury(Executor exec)
        {
            var count = exec.DataStack.Pop<Tokens.Number>().Value;
            var token = exec.DataStack.Pop<IToken>();

            exec.DataStack.Bury(token, (int) count);
        }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Stack.cs

示例3: Def

        public static void Def(Executor exec)
        {
            var name = exec.DataStack.Pop<Tokens.Symbol>().Value;
            var code = exec.DataStack.Pop<Tokens.CodeBlock>().Value;

            exec.Methods[name] = new Executor.CodeblockFunction(code.ToList());
        }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Runtime.cs

示例4: Swap

 public static void Swap(Executor exec)
 {
     var a = exec.DataStack.Pop<IToken>();
     var b = exec.DataStack.Pop<IToken>();
     exec.DataStack.Push(a);
     exec.DataStack.Push(b);
 }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Stack.cs

示例5: CharacterHandler

 public CharacterHandler(char toHandle, Executor Execute, bool stop)
 {
     this.toHandle = toHandle;
     this.Condition = SimpleCheck;
     this.Execute = Execute;
     this.stop = stop;
 }
开发者ID:BackupTheBerlios,项目名称:sexycodechecker-svn,代码行数:7,代码来源:Rule1Bug200804009.cs

示例6: Dig

        public static void Dig(Executor exec)
        {
            var count = exec.DataStack.Pop<Tokens.Number>().Value;
            var token = exec.DataStack.Dig<IToken>((int) count);

            exec.DataStack.Push(token);
        }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Stack.cs

示例7: Create

 public IOutputExecutor Create(Settings settings)
 {
     Executor = Executor.WithForsetiConfigurationFile(settings.ForsetiConfigurationFile, verbose: settings.VerboseOutput);
     Executor.ReportWith<Forseti.AppVeyor.Reporter>();
     Executor.RegisterWatcher<Forseti.ConsoleReporter.ConsoleHarnessWatcher>();
     return this;
 }
开发者ID:dolittle,项目名称:Forseti,代码行数:7,代码来源:OutputExecutor.cs

示例8: Compile

        /// <param name="options">Compile options</param>
        /// <param name="runInSeparateAppDomain">Should be set to true for production code, but there are issues with NUnit, so tests need to set this to false.</param>
        public bool Compile(CompilerOptions options, bool runInSeparateAppDomain)
        {
            try {
                AppDomain ad = null;
                var actualOut = Console.Out;
                try {
                    Console.SetOut(new StringWriter());	// I don't trust the third-party libs to not generate spurious random messages, so make sure that any of those messages are suppressed.

                    var er = new ErrorReporterWrapper(_errorReporter, actualOut);

                    Executor executor;
                    if (runInSeparateAppDomain) {
                        var setup = new AppDomainSetup { ApplicationBase = Path.GetDirectoryName(typeof(Executor).Assembly.Location) };
                        ad = AppDomain.CreateDomain("SCTask", null, setup);
                        executor = (Executor)ad.CreateInstanceAndUnwrap(typeof(Executor).Assembly.FullName, typeof(Executor).FullName);
                    }
                    else {
                        executor = new Executor();
                    }
                    return executor.Compile(options, er);
                }
                finally {
                    if (ad != null) {
                        AppDomain.Unload(ad);
                    }
                    if (actualOut != null) {
                        Console.SetOut(actualOut);
                    }
                }
            }
            catch (Exception ex) {
                _errorReporter.InternalError(ex, null, TextLocation.Empty);
                return false;
            }
        }
开发者ID:arnauddias,项目名称:SaltarelleCompiler,代码行数:37,代码来源:CompilerDriver.cs

示例9: WillThrowAnExceptionWithOnlyOneRetry

		public void WillThrowAnExceptionWithOnlyOneRetry()
		{
			var executor = new Executor(3, new InvalidOperationException());
			var proxy = (Executor)proxyGenerator.CreateClassProxyWithTarget(typeof(Executor), executor, new[] { new RetryInterceptor(1) });
			proxy.Execute();
			Assert.Fail();
		}
开发者ID:ewhauser,项目名称:Castle.Core,代码行数:7,代码来源:RetryInterceptorTests.cs

示例10: Redef

        public static void Redef(Executor exec)
        {
            var to = exec.DataStack.Pop<Tokens.Symbol>().Value;
            var from = exec.DataStack.Pop<Tokens.Symbol>().Value;

            exec.Methods[to] = exec.Methods[from];
        }
开发者ID:puckipedia,项目名称:StackStream,代码行数:7,代码来源:Runtime.cs

示例11: Eval

            public override void Eval(Executor exec)
            {
                string sHelpFile = Config.gsDataFolder + "\\help.html";
                StreamWriter sw = new StreamWriter(sHelpFile);
                sw.WriteLine("<html><head><title>Cat Help File</title></head><body>");

                /*
                sw.WriteLine("<h1><a name='level0prims'></a>Level 0 Primitives</h1>");
                OutputTable(sw, "level0", exec);
                sw.WriteLine("<h1><a name='level1prims'></a>Level 1 Primitives</h1>");
                OutputTable(sw, "level1", exec);               
                sw.WriteLine("<h1><a name='level2prims'></a>Level 2 Primitives</h1>");
                OutputTable(sw, "level2", exec);                
                sw.WriteLine("<h1><a name='otherprims'></a>Other Functions</h1>");
                OutputTable(sw, "", exec);
                 */

                sw.WriteLine("<h1>Instructions</h1>");
                OutputAllTable(sw, exec);

                sw.WriteLine("<h1>Definitions</h1>");
                sw.WriteLine("<pre>");
                foreach (Function f in exec.GetAllFunctions())
                {
                    sw.WriteLine(f.GetImplString(true));
                }
                sw.WriteLine("</pre>");

                sw.WriteLine("</body></html>");
                sw.Close();
                Output.WriteLine("saved help file to " + sHelpFile);
            }
开发者ID:catb0t,项目名称:cat-language,代码行数:32,代码来源:CatMetaCommands.cs

示例12: Eval

            public override void Eval(Executor exec)
            {
                string s = exec.PopString();

                Executor aux = new Executor(exec);
                aux.Execute(s);
                exec.Push(aux.GetStackAsList());
            }
开发者ID:catb0t,项目名称:cat-language,代码行数:8,代码来源:CatPrimitives.cs

示例13: Execute

 public override ICommand Execute()
 {
     using (Executor executor = new Executor(this))
     {
         executor.Execute();
         return this;
     }
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:8,代码来源:ConsoleCommand.cs

示例14: SetUp

        public void SetUp()
        {
            symbols = A.Fake<Symbols>();
              tokenizer = A.Fake<Tokenizer>();
              executor = A.Fake<Executor>();

              sut = new Interpreter(symbols, tokenizer, executor);
        }
开发者ID:zuun,项目名称:wSQL,代码行数:8,代码来源:InterpreterTests.cs

示例15: Unpack

        public static void Unpack(Executor exec)
        {
            var block = exec.DataStack.Pop<Tokens.PackedBlock>().Value;
            var count = block.Count;

            exec.DataStack.PushRange(block);
            exec.DataStack.Push(new Tokens.Number(count));
        }
开发者ID:puckipedia,项目名称:StackStream,代码行数:8,代码来源:Packed.cs


注:本文中的Executor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。