예제 #1
0
 public void WriteRoot_Repository(object o)
 {
     WriteStartDocument();
     Mono.Addins.Setup.Repository ob = (Mono.Addins.Setup.Repository)o;
     TopLevelElement();
     WriteObject_Repository(ob, "Repository", "", true, false, true);
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        public Mono.Addins.Setup.Repository ReadObject_Repository(bool isNullable, bool checkType)
        {
            Mono.Addins.Setup.Repository ob = null;
            if (isNullable && ReadNull())
            {
                return(null);
            }

            if (checkType)
            {
                System.Xml.XmlQualifiedName t = GetXsiType();
                if (t == null)
                {
                }
                else if (t.Name != "Repository" || t.Namespace != "")
                {
                    throw CreateUnknownTypeException(t);
                }
            }

            ob = new Mono.Addins.Setup.Repository();

            Reader.MoveToElement();

            while (Reader.MoveToNextAttribute())
            {
                if (IsXmlnsAttribute(Reader.Name))
                {
                }
                else
                {
                    UnknownNode(ob);
                }
            }

            Reader.MoveToElement();
            if (Reader.IsEmptyElement)
            {
                Reader.Skip();
                return(ob);
            }

            Reader.ReadStartElement();
            Reader.MoveToContent();

            bool b0 = false, b1 = false, b2 = false, b3 = false;

            Mono.Addins.Setup.RepositoryEntryCollection o5;
            o5 = ob.@Repositories;
            Mono.Addins.Setup.RepositoryEntryCollection o7;
            o7 = ob.@Addins;
            int n4 = 0, n6 = 0;

            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element)
                {
                    if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "" && !b3)
                    {
                        if (((object)o7) == null)
                        {
                            throw CreateReadOnlyCollectionException("Mono.Addins.Setup.RepositoryEntryCollection");
                        }
                        o7.Add(ReadObject_AddinRepositoryEntry(false, true));
                        n6++;
                    }
                    else if (Reader.LocalName == "Repository" && Reader.NamespaceURI == "" && !b2)
                    {
                        if (((object)o5) == null)
                        {
                            throw CreateReadOnlyCollectionException("Mono.Addins.Setup.RepositoryEntryCollection");
                        }
                        o5.Add(ReadObject_ReferenceRepositoryEntry(false, true));
                        n4++;
                    }
                    else if (Reader.LocalName == "Name" && Reader.NamespaceURI == "" && !b0)
                    {
                        b0       = true;
                        ob.@Name = Reader.ReadElementString();
                    }
                    else if (Reader.LocalName == "Url" && Reader.NamespaceURI == "" && !b1)
                    {
                        b1      = true;
                        ob.@Url = Reader.ReadElementString();
                    }
                    else
                    {
                        UnknownNode(ob);
                    }
                }
                else
                {
                    UnknownNode(ob);
                }

                Reader.MoveToContent();
            }


            ReadEndElement();

            return(ob);
        }
		public Mono.Addins.Setup.Repository ReadObject_Repository (bool isNullable, bool checkType)
		{
			Mono.Addins.Setup.Repository ob = null;
			if (isNullable && ReadNull()) return null;

			if (checkType) 
			{
				System.Xml.XmlQualifiedName t = GetXsiType();
				if (t == null)
				{ }
				else if (t.Name != "Repository" || t.Namespace != "")
					throw CreateUnknownTypeException(t);
			}

			ob = new Mono.Addins.Setup.Repository ();

			Reader.MoveToElement();

			while (Reader.MoveToNextAttribute())
			{
				if (IsXmlnsAttribute (Reader.Name)) {
				}
				else {
					UnknownNode (ob);
				}
			}

			Reader.MoveToElement();
			if (Reader.IsEmptyElement) {
				Reader.Skip ();
				return ob;
			}

			Reader.ReadStartElement();
			Reader.MoveToContent();

			bool b0=false, b1=false, b2=false, b3=false;

			Mono.Addins.Setup.RepositoryEntryCollection o5;
			o5 = ob.@Repositories;
			Mono.Addins.Setup.RepositoryEntryCollection o7;
			o7 = ob.@Addins;
			int n4=0, n6=0;

			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
			{
				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
				{
					if (Reader.LocalName == "Addin" && Reader.NamespaceURI == "" && !b3) {
						if (((object)o7) == null)
							throw CreateReadOnlyCollectionException ("Mono.Addins.Setup.RepositoryEntryCollection");
						o7.Add (ReadObject_AddinRepositoryEntry (false, true));
						n6++;
					}
					else if (Reader.LocalName == "Repository" && Reader.NamespaceURI == "" && !b2) {
						if (((object)o5) == null)
							throw CreateReadOnlyCollectionException ("Mono.Addins.Setup.RepositoryEntryCollection");
						o5.Add (ReadObject_ReferenceRepositoryEntry (false, true));
						n4++;
					}
					else if (Reader.LocalName == "Name" && Reader.NamespaceURI == "" && !b0) {
						b0 = true;
						ob.@Name = Reader.ReadElementString ();
					}
					else if (Reader.LocalName == "Url" && Reader.NamespaceURI == "" && !b1) {
						b1 = true;
						ob.@Url = Reader.ReadElementString ();
					}
					else {
						UnknownNode (ob);
					}
				}
				else
					UnknownNode(ob);

				Reader.MoveToContent();
			}


			ReadEndElement();

			return ob;
		}