开发者

How can I check the value of a Fluid Contact type?

I want to retrieve data from a fluid contact set only if the contact is from a certain type.

This is what开发者_如何学运维 i wrote:

ContactSet fcset = FcSetGridBox.Tag as ContactSet; 
foreach (Contact fc in fcset.Contacts) 
{ 
    if (fc.ContactType.Equals(oilwater)) 
    { 
        args.OilZoneContV=fc.GetZValue(); 
    } 
    else 
    if (fc.ContactType = "oilgas"') 
    { 
        args.GasZoneContV = fc.GetZValue(); 
    } 
} 

But I don't know what to compare the ContactType to.

The Ocean manual mention the contact type enumeration but i cant use them as string


I just found the answer: I need to test against the actual enumeration values.

if (fc.ContactType.Equals(ContactType.OilGas))
{ ... }

And Enumerations can safely be compared with the == operator as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜