Switch<T>.Expression Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the object to compare to the keys in the Cases collection.
public:
property System::Activities::InArgument<T> ^ Expression { System::Activities::InArgument<T> ^ get(); void set(System::Activities::InArgument<T> ^ value); };
[System.Activities.RequiredArgument]
public System.Activities.InArgument<T> Expression { get; set; }
[<System.Activities.RequiredArgument>]
member this.Expression : System.Activities.InArgument<'T> with get, set
Public Property Expression As InArgument(Of T)
Property Value
The object to compare to the keys in the Cases collection.
- Attributes
Examples
The following code sample demonstrates setting the Expression property of a Switch<T> activity.
// check if the number is ok...
new Switch<int>()
{
DisplayName = "Verify Value from User",
Expression = ExpressionServices.Convert<int>( env => numberFromUser.Get(env).CompareTo(numberToGuess.Get(env)) ),
Cases =
{
{ 0, new Assign<bool>()
{
To = new OutArgument<bool>(finished),
Value = true
}
},
{ 1, new WriteLine() { Text = " Try a lower number number..." } },
{ -1, new WriteLine() { Text = " Try a higher number" } }
}
}
Remarks
The comparison occurs after the expression is evaluated.
Applies to
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ