コード例 #1
0
		public void FromXmlMissingSchemaAssociation()
		{
			string propertiesXml = "<SerializedNode/>";
			XmlTextReader reader = new XmlTextReader(new StringReader(propertiesXml));
			XmlFileAssociation schema = new XmlFileAssociation();
			Assert.IsNull(schema.ReadFrom (reader));
		}		
コード例 #2
0
		public void ToXml()
		{
			XmlFileAssociation schema = new XmlFileAssociation (".xml", "http://mono-project.com", null);
			schema.WriteTo(writer);
			
			string expectedXml = "<SchemaAssociation extension=\".xml\" namespace=\"http://mono-project.com\" prefix=\"\" />";
			Assert.AreEqual(expectedXml, xml.ToString());
		}
コード例 #3
0
		public void FromXml()
		{
			XmlFileAssociation expectedSchema = new XmlFileAssociation (".xml", "http://mono-project.com", null);
			expectedSchema.WriteTo(writer);

			string propertiesXml = "<SerializedNode>" + xml.ToString() + "</SerializedNode>";
			XmlTextReader reader = new XmlTextReader (new StringReader(propertiesXml));
			XmlFileAssociation schema = new XmlFileAssociation ();
			schema = (XmlFileAssociation)schema.ReadFrom (reader);
			
			Assert.AreEqual(expectedSchema.Extension, schema.Extension);
			Assert.AreEqual(expectedSchema.NamespacePrefix, schema.NamespacePrefix);
			Assert.AreEqual(expectedSchema.NamespaceUri, schema.NamespaceUri);
		}
コード例 #4
0
		public static void SetFileAssociation (XmlFileAssociation association)
		{
			Properties.Set (AssociationPrefix + association.Extension, association);
		}
コード例 #5
0
		public XmlFileAssociationChangedEventArgs (string extension, XmlFileAssociation association)
		{
			this.Extension = extension;
			this.Association = association;
		}		
コード例 #6
0
 public static void SetFileAssociation(XmlFileAssociation association)
 {
     Properties.Set(AssociationPrefix + association.Extension, association);
 }
コード例 #7
0
 public XmlFileAssociationChangedEventArgs(string extension, XmlFileAssociation association)
 {
     this.Extension   = extension;
     this.Association = association;
 }