本文整理汇总了C#中Processor.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.Execute方法的具体用法?C# Processor.Execute怎么用?C# Processor.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Processor
的用法示例。
在下文中一共展示了Processor.Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute()
{
var referenceCopyLocalPaths = ReferenceCopyLocalPaths.Select(x => x.ItemSpec).ToList();
var defineConstants = DefineConstants.GetConstants();
processor = new Processor
{
Logger = new BuildLogger
{
BuildEngine = BuildEngine,
},
AssemblyFilePath = AssemblyPath,
IntermediateDirectory = IntermediateDir,
KeyFilePath = KeyFilePath,
SignAssembly = SignAssembly,
ProjectDirectory = ProjectDirectory,
References = References,
SolutionDirectory = SolutionDir,
ReferenceCopyLocalPaths = referenceCopyLocalPaths,
DefineConstants = defineConstants,
NuGetPackageRoot = NuGetPackageRoot
};
var success = processor.Execute();
if (success)
{
var weavers = processor.Weavers.Select(x => x.AssemblyName);
ExecutedWeavers = string.Join(";", weavers) + ";";
}
return success;
}
示例2: EmptyScript
public void EmptyScript()
{
var processor = new Processor();
processor.Execute("//Nothing but a comment");
var result = processor.Evaluate("//Nothing but a comment");
Assert.IsNull(result);
}
示例3: EmptyModuleDeclaration
public void EmptyModuleDeclaration()
{
var processor = new Processor();
processor.Execute("module TestModule 1.0.0 { }");
dynamic result = processor.Evaluate("return Modules");
Assert.AreEqual(2, result.Count);
}
示例4: ParallelTasks
private static void ParallelTasks()
{
Console.WriteLine("BP Console: running tasks.\n");
Processor proc = new Processor(PARALLEL_PROCESSING,
ConfigReader.GetTaskList("ParallelTasks.config")
);
proc.Execute();
}
示例5: TearDownTasks
private static void TearDownTasks()
{
Console.WriteLine("BP Console: running tear down tasks.\n");
Processor proc = new Processor(SERIAL_PROCESSING,
ConfigReader.GetTaskList("TearDownTasks.config")
);
proc.Execute();
}
示例6: SetupTasks
private static void SetupTasks()
{
Console.WriteLine("BP Console: running set up tasks.\n");
Processor proc = new Processor(SERIAL_PROCESSING,
ConfigReader.GetTaskList("SetupTasks.config")
);
proc.Execute();
Console.WriteLine("BP Console: setup complete.\n");
}
示例7: InitializeProvider
public void InitializeProvider()
{
string moduleCode;
using (var reader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("Ancestry.QueryProcessor.Sql.Test.Module.dql")))
moduleCode = reader.ReadToEnd();
var settings = new ProcessorSettings();
settings.RepositoryFactory = new SqlFactory("System.Data.SqlServerCe.4.0", "Data Source=TestDB.sdf;Persist Security Info=False;");
_processor = new Processor(settings);
_processor.Execute(moduleCode);
}
示例8: doWork
public void doWork(string[] args)
{
GeneticAPI.JsonFileReader<City> importer = new GeneticAPI.JsonFileReader<City>();
List<City> lo_data = importer.Import(args[0]);
for (int i = 0; i < lo_data.Count; i++)
{
Console.WriteLine(lo_data[i].id);
}
Processor<City> lo_processor = new Processor<City>();
lo_processor.Changed += new ChangedEventHandler(Changed);
lo_processor.Execute(lo_data, 30, 200000, 0.001, 0.5, GeneticAPI.Selection.Selectors.Tournament,GeneticAPI.Recombination.Recombinators.TwoPointCrossoverPMX, GeneticAPI.Shared.Util.Randoms.Advanced, 2, 4);
}
示例9: Run
/// <summary>
/// Runs the compiled code
/// </summary>
public void Run()
{
Console.WriteLine("Delabeled code:");
Console.WriteLine(Utils.PrintCode(compiler.code));
Console.WriteLine("\nInstructions:");
Console.WriteLine(Utils.PrintInstructions(compiler.instructions));
Console.WriteLine("Press enter to execute.");
Console.ReadLine();
Processor processor = new Processor(compiler.instructions);
processor.Execute();
Console.WriteLine("\nPress enter to exit.");
Console.ReadLine();
}
示例10: Execute
public override bool Execute()
{
var referenceCopyLocalPaths = ReferenceCopyLocalPaths.Select(x => x.ItemSpec).ToList();
var defineConstants = DefineConstants.GetConstants();
processor = new Processor
{
Logger = new BuildLogger
{
BuildEngine = BuildEngine,
},
AssemblyFilePath = AssemblyPath,
IntermediateDirectory = IntermediateDir,
KeyFilePath = KeyFilePath,
SignAssembly = SignAssembly,
ProjectDirectory = ProjectDirectory,
References = References,
SolutionDirectory = SolutionDir,
ReferenceCopyLocalPaths = referenceCopyLocalPaths,
DefineConstants = defineConstants
};
return processor.Execute();
}
示例11: Execute
public void Execute()
{
var processor = new Processor();
processor.Execute("//Do nothing");
}
示例12: ModuleSelfReferencing
public void ModuleSelfReferencing()
{
// TODO: FIX const values - cannot compile builders into a dynamic method
var processor = new Processor();
processor.Execute
(
@"
module TestModule 1.0.0
{
ForwardTypedef: Int,
ForwardEnum: Color,
//ForwardEnumValue: const Red,
//ForwardConst: const Five,
Int: typedef Int32,
Color: enum { Red Green },
Five: const 5,
BackwardTypedef: { x: Int },
BackwardEnum: Color,
//BackwardEnumValue: const Green,
//BackwardConst: const Five
}
"
);
}
示例13: SimpleModuleFunctionVar
public void SimpleModuleFunctionVar()
{
var processor = new Processor();
processor.Execute("module TestModule 1.0.0 { MyFunc: (x: Int32) : Int32 }");
dynamic result =
processor.Evaluate
(
@"
using TestModule 1.0.0
set MyFunc := (x: Int32) return x + 1
return MyFunc(5)
"
);
Assert.AreEqual(6, result.Result);
}
示例14: SimpleModuleEnum
public void SimpleModuleEnum()
{
var processor = new Processor();
processor.Execute("module TestModule 1.0.0 { MyEnum: enum { Red Green } }");
dynamic result = processor.Evaluate("using TestModule 1.0.0 return Green");
Assert.AreEqual("Green", result.ToString());
}
示例15: Index
public void Index(string e, string a = null)
{
var service = new Processor(QueryConfig.Settings);
service.Execute(e, a == null ? null : JsonInterop.JsonArgsToNative(JObject.Parse(a)));
}