Switching from VB to C # in Workflow Designer

I am creating a library of actions in Visual Studio 11 beta (although I repeated all my steps in VS2010 with the same result), focusing on the .NET 4.0 platform.

When I started to enter arguments using the Workflow constructor, I noticed the message "Enter VB expression" in the "Default value" field. I am not sure how to change the language context from VB to C #.

To create a project, I followed these steps:

  • Go to File New and select Project ...

  • In the Installed Templates section of the New Project dialog box, select Visual C # Workflow strong> Action Library

  • Name the project as usual and click OK.

And that’s basically it. I noticed that the Activity1.xamldefault file was expecting VB to be used in the default value fields. I deleted it and then did the following to create a new action:

  • Right-click the project and select Add New Item ...

  • In the Add New Item dialog box, go to Installed Elements Visual C # Workflow Activity

  • Name the action and click OK.

It was the same result, Default Value fields expect a VB expression.

XAML, Microsoft.VisualBasic.Activities VisualBasic.Settings, , , ; , , . XAML:

<Activity mc:Ignorable="sads sap" x:Class="THINKImport.CustomerAddOrderAdd"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:local="clr-namespace:THINKImport.THINKWebReference"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:s="clr-namespace:System;assembly=System.Core"
 xmlns:s1="clr-namespace:System;assembly=System"
 xmlns:s2="clr-namespace:System;assembly=System.ServiceModel"
 xmlns:s3="clr-namespace:System;assembly=mscorlib"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:t="clr-namespace:THINKImport"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Members>
    <x:Property Name="user_login_data" Type="InArgument(local:user_login_data)" />
    <!--Removed the other properties for brevity-->
  </x:Members>
  <sap:VirtualizedContainerService.HintSize>440,440</sap:VirtualizedContainerService.HintSize>
  <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>
</Activity>
+5
2

#

Visual . .NET Framework 4.5 RC Visual Basic , Visual Basic. Visual # # . # , , IntelliSense. #, , Visual Basic .

Beta 1, # . # .

: Windows Workflow Foundation .NET 4.5

+5

.

-, . , VB.NET , #.

, , XAML, , WF, , , #. XAML.

:

<sap2010:ExpressionActivityEditor.ExpressionActivityEditor>C#</sap2010:ExpressionActivityEditor.ExpressionActivityEditor>

MSDN ExpressionActivityEditor. , .NET 4.5. , .NET 4.5 , . , , Expression Editor #. " ", , , . - , XAML:

<Activity mc:Ignorable="sap sap2010 sads" x:Class="THINKImport.CustomerAddOrderAdd"
      xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
      xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
      xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
      xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:THINKWebReference="clr-namespace:THINKImport.THINKWebReference">
  <x:Members>
  <x:Property Name="user_login_data" Type="InArgument(THINKWebReference:user_login_data)">
    <x:Property.Attributes>
      <RequiredArgumentAttribute />
        </x:Property.Attributes>
    </x:Property>
    <x:Property Name="customer_data" Type="InArgument(THINKWebReference:customer_data)" />
    <!--Remainder of Properties removed for brevity-->
  </x:Members>
  <sap2010:ExpressionActivityEditor.ExpressionActivityEditor>C#</sap2010:ExpressionActivityEditor.ExpressionActivityEditor>
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Linq</x:String>
      <x:String>System.Text</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System.ServiceModel</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <sap2010:WorkflowViewState.IdRef>
    THINKImport.CustomerAddOrderAdd_1
  </sap2010:WorkflowViewState.IdRef>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="THINKImport.CustomerAddOrderAdd_1" sap:VirtualizedContainerService.HintSize="440,440" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>

, ( , ), #, .

+5

All Articles