本文整理汇总了C#中XmlCompletionItemCollection.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# XmlCompletionItemCollection.Contains方法的具体用法?C# XmlCompletionItemCollection.Contains怎么用?C# XmlCompletionItemCollection.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlCompletionItemCollection
的用法示例。
在下文中一共展示了XmlCompletionItemCollection.Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddElements
/// <summary>
/// Adds elements to the collection if it does not already exist.
/// </summary>
static void AddElements(XmlCompletionItemCollection lhs, XmlCompletionItemCollection rhs)
{
foreach (XmlCompletionItem item in rhs) {
if (!lhs.Contains(item.Text)) {
lhs.Add(item);
}
}
}
示例2: AddElement
/// <summary>
/// Adds an element completion data to the collection if it does not
/// already exist.
/// </summary>
static void AddElement(XmlCompletionItemCollection completionItems, string name, string prefix, string documentation)
{
if (!completionItems.Contains(name)) {
if (prefix.Length > 0) {
name = String.Concat(prefix, ":", name);
}
XmlCompletionItem item = new XmlCompletionItem(name, documentation);
completionItems.Add(item);
}
}