如何评估枚举类型的参数 [英] How to evaluate an outargument of type Enum

查看:79
本文介绍了如何评估枚举类型的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一项活动中有一个枚举类型的争论,我们可以将其称为PingValidationResult(它可以称为ValidationResult的类型).枚举中的元素之一是成功.在工作流设计器中,我希望有一个If活动评估PingValidationResult是否等于ValidationResult.Success.

如果使用表达式

typevariable
.PingValidationResult= ValidationResult.Success

我得到

没有为类型'System.Activities.OutArgument(of foo.MyActivities.ValidationResult)'和'foo.MyActivities.ValidationResult'定义运算符'='.




I have an outargument of type enum in one of my activities which we can refer to as PingValidationResult (it is of a type we can refer to as ValidationResult).  One of the elements in the enum is Success.  In the workflow designer, I'd like to have an If activity evaluate whether PingValidationResult is equal to ValidationResult.Success. 

If I use the expression

typevariable
.PingValidationResult = ValidationResult.Success

I get

Operator '=' is not defined for types 'System.Activities.OutArgument(of foo.MyActivities.ValidationResult)' and 'foo.MyActivities.ValidationResult'.


Am I simply deficient in my VB syntax or is the issue in how I have implemented the enum?

推荐答案

亲爱的安东尼,参数值可以无法直接访问.您需要使用:
Dear Anthony, the argument value can't be accessed directly. You need to use:


这篇关于如何评估枚举类型的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆