本文整理汇总了C#中DataCollection.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# DataCollection.Contains方法的具体用法?C# DataCollection.Contains怎么用?C# DataCollection.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataCollection
的用法示例。
在下文中一共展示了DataCollection.Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: foreach
public DataCollection<StandBildMappingFull> GetCorrectOrderedStandBildMappingFull
(Guid? RootID, Guid? TypID, String TargetTableName)
{
DataCollection<StandBildMappingFull> Result = new DataCollection<StandBildMappingFull>();
if ((!String.IsNullOrEmpty (TargetTableName))
&& (TargetTableName != "*"))
{
foreach (StandBildMappingFull Entry in AllStandBildMappingFull.Values)
{
if (Entry.TargetTable == "*")
continue;
if (Entry.TargetTable != TargetTableName)
continue;
Result.Add(Entry);
}
if (Result.Count > 0)
return Result;
}
foreach (StandBildMappingFull Entry in AllStandBildMappingFull.Values)
{
if (Entry.RootFormat != RootID)
continue;
if ((!String.IsNullOrEmpty(Entry.ItemContent))
&& (Guid.Parse(Entry.ItemContent) != Entry.RootFormat)
&& (Entry.TypID != Guid.Empty))
continue;
Result.Add(Entry);
}
foreach (StandBildMappingFull Entry in AllStandBildMappingFull.Values)
{
if (Result.Contains(Entry))
continue;
if (Entry.TypID != TypID)
continue;
Result.Add(Entry);
}
return Result;
}
示例2: op_Contains_string_stringMissing
public void op_Contains_string_stringMissing()
{
var obj = new DataCollection
{
{
"name", "value"
}
};
Assert.False(obj.Contains("name", "???"));
}
示例3: op_Contains_string_string
public void op_Contains_string_string()
{
var obj = new DataCollection
{
{
"name", string.Empty
},
{
"name", "value"
}
};
Assert.True(obj.Contains("name", "value"));
}