void WriteObject_AddinSystemConfiguration (Mono.Addins.Setup.AddinSystemConfiguration ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.AddinSystemConfiguration))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("AddinSystemConfiguration", "");

			if (ob.@Repositories != null) {
				WriteStartElement ("Repositories", "", ob.@Repositories);
				for (int n22 = 0; n22 < [email protected]; n22++) {
					WriteObject_RepositoryRecord (((Mono.Addins.Setup.RepositoryRecord) ob.@Repositories[n22]), "Repository", "", false, false, true);
				}
				WriteEndElement (ob.@Repositories);
			}
			WriteElementString ("RepositoryIdCount", "", [email protected](CultureInfo.InvariantCulture));
			if (ob.@DisabledAddins != null) {
				WriteStartElement ("DisabledAddins", "", ob.@DisabledAddins);
				for (int n23 = 0; n23 < [email protected]; n23++) {
					WriteElementString ("Addin", "", ob.@DisabledAddins[n23]);
				}
				WriteEndElement (ob.@DisabledAddins);
			}
			if (ob.@AddinPaths != null) {
				WriteStartElement ("AddinPaths", "", ob.@AddinPaths);
				for (int n24 = 0; n24 < [email protected]; n24++) {
					WriteElementString ("Addin", "", ob.@AddinPaths[n24]);
				}
				WriteEndElement (ob.@AddinPaths);
			}
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_RepositoryRecord (Mono.Addins.Setup.RepositoryRecord ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.RepositoryRecord))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("RepositoryRecord", "");

			WriteAttribute ("id", "", ob.@Id);

			WriteElementString ("IsReference", "", (ob.@IsReference?"true":"false"));
			WriteElementString ("File", "", ob.@File);
			WriteElementString ("Url", "", ob.@Url);
			WriteElementString ("Name", "", ob.@Name);
			WriteElementString ("LastModified", "", XmlConvert.ToString (ob.@LastModified, XmlDateTimeSerializationMode.RoundtripKind));
			if (ob.@Enabled != true) {
				WriteElementString ("Enabled", "", (ob.@Enabled?"true":"false"));
			}
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_AssemblyDependency (Mono.Addins.Description.AssemblyDependency ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Description.AssemblyDependency))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("AssemblyDependency", "");

			WriteElementString ("FullName", "", ob.@FullName);
			WriteElementString ("Package", "", ob.@Package);
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_AddinReference (Mono.Addins.Description.AddinDependency ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Description.AddinDependency))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("AddinReference", "");

			WriteElementString ("AddinId", "", ob.@AddinId);
			WriteElementString ("Version", "", ob.@Version);
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_AddinRepositoryEntry (Mono.Addins.Setup.PackageRepositoryEntry ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.PackageRepositoryEntry))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("PackageRepositoryEntry", "");

			WriteElementString ("Url", "", ob.@Url);
			WriteObject_AddinInfo (ob.@Addin, "Addin", "", false, false, true);
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_AddinInfo (Mono.Addins.Setup.AddinInfo ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.AddinInfo))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("AddinInfo", "");

			WriteElementString ("Id", "", ob.@LocalId);
			WriteElementString ("Namespace", "", ob.@Namespace);
			WriteElementString ("Name", "", ob.@Name);
			WriteElementString ("Version", "", ob.@Version);
			WriteElementString ("BaseVersion", "", ob.@BaseVersion);
			WriteElementString ("Author", "", ob.@Author);
			WriteElementString ("Copyright", "", ob.@Copyright);
			WriteElementString ("Url", "", ob.@Url);
			WriteElementString ("Description", "", ob.@Description);
			WriteElementString ("Category", "", ob.@Category);
			if (ob.@Dependencies != null) {
				WriteStartElement ("Dependencies", "", ob.@Dependencies);
				for (int n32 = 0; n32 < [email protected]; n32++) {
					if (((object)ob.@Dependencies[n32]) == null) { }
					else if (ob.@Dependencies[n32].GetType() == typeof(Mono.Addins.Description.AssemblyDependency)) {
						WriteObject_AssemblyDependency (((Mono.Addins.Description.AssemblyDependency) ob.@Dependencies[n32]), "AssemblyDependency", "", false, false, true);
					}
					else if (ob.@Dependencies[n32].GetType() == typeof(Mono.Addins.Description.NativeDependency)) {
						WriteObject_NativeReference (((Mono.Addins.Description.NativeDependency) ob.@Dependencies[n32]), "NativeDependency", "", false, false, true);
					}
					else if (ob.@Dependencies[n32].GetType() == typeof(Mono.Addins.Description.AddinDependency)) {
						WriteObject_AddinReference (((Mono.Addins.Description.AddinDependency) ob.@Dependencies[n32]), "AddinDependency", "", false, false, true);
					}
					else throw CreateUnknownTypeException (ob.@Dependencies[n32]);
				}
				WriteEndElement (ob.@Dependencies);
			}
			if (ob.@OptionalDependencies != null) {
				WriteStartElement ("OptionalDependencies", "", ob.@OptionalDependencies);
				for (int n33 = 0; n33 < [email protected]; n33++) {
					if (((object)ob.@OptionalDependencies[n33]) == null) { }
					else if (ob.@OptionalDependencies[n33].GetType() == typeof(Mono.Addins.Description.AssemblyDependency)) {
						WriteObject_AssemblyDependency (((Mono.Addins.Description.AssemblyDependency) ob.@OptionalDependencies[n33]), "AssemblyDependency", "", false, false, true);
					}
					else if (ob.@OptionalDependencies[n33].GetType() == typeof(Mono.Addins.Description.NativeDependency)) {
						WriteObject_NativeReference (((Mono.Addins.Description.NativeDependency) ob.@OptionalDependencies[n33]), "NativeDependency", "", false, false, true);
					}
					else if (ob.@OptionalDependencies[n33].GetType() == typeof(Mono.Addins.Description.AddinDependency)) {
						WriteObject_AddinReference (((Mono.Addins.Description.AddinDependency) ob.@OptionalDependencies[n33]), "AddinDependency", "", false, false, true);
					}
					else throw CreateUnknownTypeException (ob.@OptionalDependencies[n33]);
				}
				WriteEndElement (ob.@OptionalDependencies);
			}
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_ReferenceRepositoryEntry (Mono.Addins.Setup.ReferenceRepositoryEntry ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.ReferenceRepositoryEntry))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("ReferenceRepositoryEntry", "");

			WriteElementString ("Url", "", ob.@Url);
			WriteElementString ("LastModified", "", [email protected]("yyyy-MM-ddTHH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture));
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_Repository (Mono.Addins.Setup.Repository ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.Repository))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("Repository", "");

			WriteElementString ("Name", "", ob.@Name);
			WriteElementString ("Url", "", ob.@Url);
			if (ob.@Repositories != null) {
				for (int n30 = 0; n30 < [email protected]; n30++) {
					WriteObject_ReferenceRepositoryEntry (((Mono.Addins.Setup.ReferenceRepositoryEntry) ob.@Repositories[n30]), "Repository", "", false, false, true);
				}
			}
			if (ob.@Addins != null) {
				for (int n31 = 0; n31 < [email protected]; n31++) {
					WriteObject_AddinRepositoryEntry (((Mono.Addins.Setup.PackageRepositoryEntry) ob.@Addins[n31]), "Addin", "", false, false, true);
				}
			}
			if (writeWrappingElem) WriteEndElement (ob);
		}
 static bool Matches (Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object @object, Action<QueryVisitor> query)
 {
     var match = false;
     query (new ObjectQueryVisitor (new ObjectQueryContext (@object.GetType ()), @object, result => {
         if (match) {
             Assert.Fail ("Multiple matches for a single input.");
         }
         match = true;
     }));
     return match;
 }
		void WriteObject_AddinProperty (Mono.Addins.Description.AddinProperty ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Description.AddinProperty))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("AddinProperty", "");

			WriteAttribute ("name", "", ob.@Name);
			WriteAttribute ("locale", "", ob.@Locale);

			WriteValue (ob.@Value);
			if (writeWrappingElem) WriteEndElement (ob);
		}
		void WriteObject_ReferenceRepositoryEntry (Mono.Addins.Setup.ReferenceRepositoryEntry ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
		{
			if (((object)ob) == null)
			{
				if (isNullable)
					WriteNullTagLiteral(element, namesp);
				return;
			}

			System.Type type = ob.GetType ();
			if (type == typeof(Mono.Addins.Setup.ReferenceRepositoryEntry))
			{ }
			else {
				throw CreateUnknownTypeException (ob);
			}

			if (writeWrappingElem) {
				WriteStartElement (element, namesp, ob);
			}

			if (needType) WriteXsiType("ReferenceRepositoryEntry", "");

			WriteElementString ("Url", "", ob.@Url);
			WriteElementString ("LastModified", "", XmlConvert.ToString (ob.@LastModified, XmlDateTimeSerializationMode.RoundtripKind));
			if (writeWrappingElem) WriteEndElement (ob);
		}