We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is sample code:
internal static class Program { static void Main(string[] args) { var v1 = new Variable<int>(); var helloWorldActivity = new Sequence() { Variables = { v1 }, Activities = { new WriteLine { Text = new CSharpValue<string>("\"aaaa\" + \"sadas\"") } } }; CompileWorkflow(helloWorldActivity); var wfApp = new WorkflowApplication(helloWorldActivity); wfApp.Run(); Console.ReadLine(); } private static void CompileWorkflow(Activity activity) { var activityName = activity.GetType().ToString(); var activityType = activityName.Split('.').Last() + "_CompiledExpressionRoot"; var activityNamespace = string.Join(".", activityName.Split('.').Reverse().Skip(1).Reverse()); var settings = new TextExpressionCompilerSettings { Activity = activity, Language = "C#", ActivityName = activityType, ActivityNamespace = activityNamespace, RootNamespace = null, GenerateAsPartialClass = false, AlwaysGenerateSource = true, ForImplementation = false, }; TextExpressionCompilerResults results = new TextExpressionCompiler(settings).Compile(); // Any compilation errors are contained in the CompilerMessages. if (results.HasErrors) throw new Exception("Compilation failed."); // Create an instance of the new compiled expression type. var compiledExpressionRoot = Activator.CreateInstance(results.ResultType, new object[] { activity }) as ICompiledExpressionRoot; CompiledExpressionInvoker.SetCompiledExpressionRoot( activity, compiledExpressionRoot); } }
The result of running:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is sample code:
The result of running:
The text was updated successfully, but these errors were encountered: