示例#1
0
 /// <summary>
 /// Allows the user to change the schema associated with an xml file
 /// extension.
 /// </summary>
 void ChangeSchemaButtonClick(object source, EventArgs e)
 {
     string[] namespaces = GetSchemaListBoxNamespaces();
     using (SelectXmlSchemaForm form = new SelectXmlSchemaForm(namespaces)) {
         form.SelectedNamespaceUri = schemaTextBox.Text;
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             schemaTextBox.Text = form.SelectedNamespaceUri;
             XmlSchemaAssociationListBoxItem item = (XmlSchemaAssociationListBoxItem)fileExtensionComboBox.SelectedItem;
             item.NamespaceUri = form.SelectedNamespaceUri;
             item.IsDirty      = true;
         }
     }
 }
 /// <summary>
 /// Allows the user to change the schema associated with an xml file 
 /// extension.
 /// </summary>
 void ChangeSchemaButtonClick(object source, EventArgs e)
 {
     string[] namespaces = GetSchemaListBoxNamespaces();
     using (SelectXmlSchemaForm form = new SelectXmlSchemaForm(namespaces)) {
         form.SelectedNamespaceUri = schemaTextBox.Text;
         if (form.ShowDialog(this) == DialogResult.OK) {
             schemaTextBox.Text = form.SelectedNamespaceUri;
             XmlSchemaAssociationListBoxItem item = (XmlSchemaAssociationListBoxItem)fileExtensionComboBox.SelectedItem;
             item.NamespaceUri = form.SelectedNamespaceUri;
             item.IsDirty = true;
         }
     }
 }