本文整理汇总了C#中XmlCompletionItemCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# XmlCompletionItemCollection.Add方法的具体用法?C# XmlCompletionItemCollection.Add怎么用?C# XmlCompletionItemCollection.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlCompletionItemCollection
的用法示例。
在下文中一共展示了XmlCompletionItemCollection.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LinkElementHasAddressAndXlinkHrefAttribute
public void LinkElementHasAddressAndXlinkHrefAttribute()
{
XmlCompletionItemCollection expectedAttributes = new XmlCompletionItemCollection();
expectedAttributes.Add(new XmlCompletionItem("address", XmlCompletionItemType.XmlAttribute));
expectedAttributes.Add(new XmlCompletionItem("xlink:href", XmlCompletionItemType.XmlAttribute));
Assert.AreEqual(expectedAttributes.ToArray(), linkElementAttributes.ToArray());
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:SimpleContentExtensionBaseTypeWithAttributeTestFixture.cs
示例2: ExpectedCompletionDataItems
public void ExpectedCompletionDataItems()
{
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("a", XmlCompletionItemType.NamespaceUri));
expectedItems.Add(new XmlCompletionItem("b", XmlCompletionItemType.NamespaceUri));
expectedItems.Add(new XmlCompletionItem("c", XmlCompletionItemType.NamespaceUri));
Assert.AreEqual(expectedItems.ToArray(), textEditor.CompletionItemsDisplayedToArray());
}
示例3: Init
public void Init()
{
firstItem = new XmlCompletionItem("text", "desc-1", XmlCompletionItemType.XmlElement);
secondItem = new XmlCompletionItem("text2", "desc-2", XmlCompletionItemType.XmlAttribute);
itemCollection = new XmlCompletionItemCollection();
itemCollection.Add(firstItem);
itemCollection.Add(secondItem);
}
示例4: Init
public void Init()
{
XmlCompletionItem lastItem = new XmlCompletionItem("cc", XmlCompletionItemType.XmlElement);
XmlCompletionItem secondItem = new XmlCompletionItem("bb", XmlCompletionItemType.XmlElement);
XmlCompletionItem firstItem = new XmlCompletionItem("aa", XmlCompletionItemType.XmlElement);
XmlCompletionItemCollection collection = new XmlCompletionItemCollection();
collection.Add(lastItem);
collection.Add(secondItem);
collection.Add(firstItem);
expectedCompletionItems = new XmlCompletionItem[] { firstItem, secondItem, lastItem };
completionItems = new XmlCompletionItemCollection(collection);
completionItems.Sort();
}
示例5: CanGetCompletionItemsUsedAsShowCompletionMethodParameters
public void CanGetCompletionItemsUsedAsShowCompletionMethodParameters()
{
XmlCompletionItemCollection list = new XmlCompletionItemCollection();
list.Add(new XmlCompletionItem("a"));
editor.ShowCompletionWindow(list);
Assert.AreSame(list, editor.CompletionItemsDisplayed);
}
示例6: CanCheckCompletionWindowFromShowCompletionHasWidthPropertyModified
public void CanCheckCompletionWindowFromShowCompletionHasWidthPropertyModified()
{
XmlCompletionItemCollection list = new XmlCompletionItemCollection();
list.Add(new XmlCompletionItem("a"));
ICompletionListWindow window = editor.ShowCompletionWindow(list);
window.Width = double.NaN;
Assert.AreEqual(double.NaN, editor.CompletionWindowDisplayed.Width);
}
示例7: GetAttributeValueCompletionReturnsValuesForDuplicateFooSchema
public void GetAttributeValueCompletionReturnsValuesForDuplicateFooSchema()
{
string xml =
"<duplicate-foo-note xmlns='foo'>\r\n" +
" <duplicate-foo-text duplicate-foo-text-attribute='f'";
string xmlUpToCursor = xml.Substring(0, xml.Length - 1);
XmlCompletionItemCollection items = schemas.GetAttributeValueCompletion('f', xmlUpToCursor, null);
items.Sort();
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("first", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("fourth", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("second", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("third", XmlCompletionItemType.XmlAttributeValue));
Assert.AreEqual(expectedItems, items);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:19,代码来源:DuplicateSchemaNamespaceAddedToCollectionTestFixture.cs
示例8: CanConvertCompletionItemsUsedAsShowCompletionMethodParametersToArray
public void CanConvertCompletionItemsUsedAsShowCompletionMethodParametersToArray()
{
XmlCompletionItem item = new XmlCompletionItem("a");
List<XmlCompletionItem> expectedArray = new List<XmlCompletionItem>();
expectedArray.Add(item);
XmlCompletionItemCollection list = new XmlCompletionItemCollection();
list.Add(item);
editor.ShowCompletionWindow(list);
Assert.AreEqual(expectedArray.ToArray(), editor.CompletionItemsDisplayedToArray());
}
示例9: GetAttributeCompletionReturnsAttributesFromDuplicateFooSchema
public void GetAttributeCompletionReturnsAttributesFromDuplicateFooSchema()
{
string xml =
"<duplicate-foo-note xmlns='foo'>\r\n" +
" <duplicate-foo-text ";
XmlCompletionItemCollection items = schemas.GetAttributeCompletion(xml, null);
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("duplicate-foo-text-attribute", XmlCompletionItemType.XmlAttribute));
Assert.AreEqual(expectedItems, items);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:13,代码来源:DuplicateSchemaNamespaceAddedToCollectionTestFixture.cs
示例10: FooSchemaElementAndBarElementInXml
public void FooSchemaElementAndBarElementInXml()
{
string xml =
"<foo-note xmlns='foo' xmlns:b='bar'>\r\n" +
" <b:bar-note>\r\n" +
" <";
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("b:bar-text", XmlCompletionItemType.XmlElement));
expectedItems.Add(new XmlCompletionItem("foo-text", XmlCompletionItemType.XmlElement));
XmlCompletionItemCollection items = schemas.GetElementCompletion(xml, null);
items.Sort();
Assert.AreEqual(expectedItems, items);
}
示例11: FooSchemaRootElementAndBarRootElementInPath
public void FooSchemaRootElementAndBarRootElementInPath()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("foo-note", "foo"));
path.AddElement(new QualifiedName("bar-note", "bar", "b"));
XmlCompletionItemCollection items = schemas.GetElementCompletionForAllNamespaces(path, null);
items.Sort();
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("b:bar-text", XmlCompletionItemType.XmlElement));
expectedItems.Add(new XmlCompletionItem("foo-text", XmlCompletionItemType.XmlElement));
Assert.AreEqual(expectedItems, items);
}
示例12: CorrectAttributeValuesReturnedForElementWhenTwoNamespacesInXml
public void CorrectAttributeValuesReturnedForElementWhenTwoNamespacesInXml()
{
string xml =
"<b:bar-note xmlns='foo' xmlns:b='bar'>\r\n" +
" <foo-note>\r\n" +
" <b:bar-text/>\r\n" +
" <foo-text foo-text-attribute='f'";
string xmlUpToCursor = xml.Substring(0, xml.Length - 1);
XmlCompletionItemCollection items = schemas.GetAttributeValueCompletion('f', xmlUpToCursor, null);
items.Sort();
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("first", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("fourth", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("second", XmlCompletionItemType.XmlAttributeValue));
expectedItems.Add(new XmlCompletionItem("third", XmlCompletionItemType.XmlAttributeValue));
Assert.AreEqual(expectedItems, items);
}
示例13: CorrectAttributesReturnedForElementWhenTwoNamespacesInXml
public void CorrectAttributesReturnedForElementWhenTwoNamespacesInXml()
{
string xml =
"<b:bar-note xmlns='foo' xmlns:b='bar'>\r\n" +
" <foo-note>\r\n" +
" <b:bar-text/>\r\n" +
" <foo-text ";
XmlCompletionItemCollection items = schemas.GetAttributeCompletion(xml, null);
XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
expectedItems.Add(new XmlCompletionItem("foo-text-attribute", XmlCompletionItemType.XmlAttribute));
Assert.AreEqual(expectedItems, items);
}
示例14: 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);
}
}
}
示例15: AddAttributeValue
/// <summary>
/// Adds an attribute value to the completion data collection.
/// </summary>
static void AddAttributeValue(XmlCompletionItemCollection completionItems, string valueText, string description)
{
XmlCompletionItem item = new XmlCompletionItem(valueText, description, XmlCompletionItemType.XmlAttributeValue);
completionItems.Add(item);
}