public void AddXmlSchemaListItemAddsItemToListBox() { XmlSchemaListItem newItem = new XmlSchemaListItem("new"); int index = schemasPanel.AddXmlSchemaListItem(newItem); Assert.AreSame(newItem, schemaListBox.Items[index]); }
public void ScrollIntoViewXmlSchemaListItemIsSaved() { XmlSchemaListItem item = new XmlSchemaListItem("a"); panel.ScrollXmlSchemaListItemIntoView(item); Assert.AreSame(item, panel.XmlSchemaListItemScrolledIntoView); }
public void XmlSchemaListItemCanBeRetrievedAfterAddingToPanel() { XmlSchemaListItem item = new XmlSchemaListItem("namespace", true); panel.AddXmlSchemaListItem(item); Assert.AreSame(item, panel.GetXmlSchemaListItem(0)); }
public void SettingXmlSchemaListSelectedIndexChangesSelectedXmlSchemaListItem() { XmlSchemaListItem item = new XmlSchemaListItem("namespace", true); panel.AddXmlSchemaListItem(item); panel.SelectedXmlSchemaListItemIndex = 0; Assert.AreEqual("namespace", panel.GetSelectedXmlSchemaListItem().ToString()); }
public void RemoveSchemaListItem() { XmlSchemaListItem itemToRemove = new XmlSchemaListItem("b"); panel.AddXmlSchemaListItem(itemToRemove); panel.AddXmlSchemaListItem(new XmlSchemaListItem("a")); panel.RemoveXmlSchemaListItem(itemToRemove); Assert.AreEqual(1, panel.XmlSchemaListItemCount); }
public void SelectXmlSchemaByNamespace() { panel.AddXmlSchemaListItem(new XmlSchemaListItem("a")); XmlSchemaListItem listItemToBeSelected = new XmlSchemaListItem("b"); panel.AddXmlSchemaListItem(listItemToBeSelected); panel.SelectSchemaListItem("b"); Assert.AreSame(listItemToBeSelected, panel.GetSelectedXmlSchemaListItem()); }
public void SelectSchemaListItem(string namespaceUri) { for (int index = 0; index < schemaListBox.Items.Count; ++index) { XmlSchemaListItem item = schemaListBox.Items[index] as XmlSchemaListItem; if (item.NamespaceUri == namespaceUri) { schemaListBox.SelectedIndex = index; return; } } schemaListBox.SelectedIndex = -1; }
public void Init() { factory = new MockXmlSchemaCompletionDataFactory(); registeredXmlSchemas = new RegisteredXmlSchemas(new string[0], String.Empty, null, factory); properties = new Properties(); DefaultXmlSchemaFileAssociations defaultAssociations = new DefaultXmlSchemaFileAssociations(new AddInTreeNode()); associations = new XmlSchemaFileAssociations(properties, defaultAssociations, new XmlSchemaCompletionCollection()); schemasPanel = new XmlSchemasPanel(registeredXmlSchemas, new string[0], associations, factory); schemaListBox = schemasPanel.FindName("schemaListBox") as ListBox; fileExtensionComboBox = schemasPanel.FindName("fileExtensionComboBox") as ComboBox; removeSchemaButton = schemasPanel.FindName("removeSchemaButton") as Button; namespacePrefixTextBox = schemasPanel.FindName("namespacePrefixTextBox") as TextBox; schemaNamespaceTextBox = schemasPanel.FindName("schemaNamespaceTextBox") as TextBox; schemaListItem = new XmlSchemaListItem("a"); schemaListBox.Items.Add(schemaListItem); fileAssociationItem = new XmlSchemaFileAssociationListItem(".xsd", "ns", "a"); schemasPanel.AddXmlSchemaFileAssociationListItem(fileAssociationItem); }
public void RemoveXmlSchemaListItem(XmlSchemaListItem schema) { schemaListBox.Items.Remove(schema); }
public int AddXmlSchemaListItem(XmlSchemaListItem schema) { return(schemaListBox.Items.Add(schema)); }
public void ScrollXmlSchemaListItemIntoView(XmlSchemaListItem schemaListItem) { xmlSchemaListItemScrolledIntoView = schemaListItem; }