简体   繁体   English

WorkflowDesigner - 如何指定表达式应该在C#中?

[英]WorkflowDesigner - How do I specify expressions should be in C#?

I'm looking into the Workflow Designer for Windows Workflow Foundation and I've got a little application running hosting the designer, toolbox and property inspector as per the instructions on MSDN: http://msdn.microsoft.com/en-us/library/dd489407.aspx 我正在研究Windows Workflow Foundation的工作流设计器,我有一个小应用程序运行托管设计器,工具箱和属性检查器,按照MSDN上的说明: http//msdn.microsoft.com/en-us/库/ dd489407.aspx

When adding a statement such as Assign for example, the expression boxes state that VB should be used for the expressions; 例如,在添加诸如Assign之类的语句时,表达式框表明VB应该用于表达式; however, using the workflow designer within a C# workflow project in Visual Studio they allow C# expressions. 但是,在Visual Studio中的C#工作流项目中使用工作流设计器,它们允许使用C#表达式。

How do I specify to the designer / statements / toolbox entries that C# should be used? 如何向designer / statements / toolbox条目指定应该使用C#?

Thanks. 谢谢。

When using WF 4.5 with VS11 if you create a C# project, your expressions will be in C#, if you create a VB project they will be in VB. 如果你创建一个C#项目使用WF 4.5和VS11,你的表达式将在C#中,如果你创建一个VB项目,它们将在VB中。

You can add existing workflows with VB expressions to a C# project if you like. 如果愿意,可以使用VB表达式将现有工作流添加到C#项目中。

How do I specify to the designer / statements / toolbox entries that C# should be used? 如何向designer / statements / toolbox条目指定应该使用C#?

You do not. 你不。 Ever since Workflow FOundation started as a COM based component for SQL Server IITC... VB Script was the syntax. 自从Workflow FOundation作为基于COM的SQL Server IITC组件开始以来...... VB Script就是语法。

4.5 allows you to use C# syntax in C# projects. 4.5允许您在C#项目中使用C#语法。 But 4.0 is stuck to vb script. 但4.0坚持vb脚本。 Yes, life is unfair - I personally think this is tTHE issue. 是的,生活是不公平的 - 我个人认为这是个问题。 Last project we did a LOT with workflows, a whole team all C# people and then regularly the "what is the syntax to define an array" or "how do I get a reference to a type" (ie typeof equivalent) was running around ;) 最后一个项目我们做了很多工作流程,整个团队都是C#人员,然后经常“定义一个数组的语法是什么”或“我如何得到一个类型的引用”(即类型等价)正在运行; )

4.5. 4.5。 Depending on timeline of the projet I would use that anyway. 根据项目的时间表,无论如何我都会使用它。 It is a 4.0 replacement and will be pushed by October... 它是4.0的替代品,将在10月推出......

C# expressions are not supported in the rehosted designer. 重新托管的设计器不支持C#表达式。

You can see the "details" here . 你可以在这里看到“细节”。

xaml的唯一区别似乎如下:

sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM