Esempio n. 1
0
        internal void Write(InternalElementTypeE use, string name, AttributeList attrList, string value, bool isNameEscape, bool isValueEscape)
        {
            string s = name;

            if (isNameEscape)
            {
                s = this.NameEscape(name);
            }
            if (use == InternalElementTypeE.ObjectEnd)
            {
                this.instanceIndent--;
            }
            this.InternalWrite("<");
            if (use == InternalElementTypeE.ObjectEnd)
            {
                this.InternalWrite("/");
            }
            this.InternalWrite(s);
            this.WriteAttributeList(attrList);
            switch (use)
            {
            case InternalElementTypeE.ObjectBegin:
                this.InternalWrite(">");
                this.instanceIndent++;
                break;

            case InternalElementTypeE.ObjectEnd:
                this.InternalWrite(">");
                break;

            case InternalElementTypeE.Member:
                if (value != null)
                {
                    this.InternalWrite(">");
                    if (isValueEscape)
                    {
                        this.InternalWrite(this.Escape(value));
                    }
                    else
                    {
                        this.InternalWrite(value);
                    }
                    this.InternalWrite("</");
                    this.InternalWrite(s);
                    this.InternalWrite(">");
                    break;
                }
                this.InternalWrite("/>");
                break;

            default:
                throw new SerializationException(string.Format(CultureInfo.CurrentCulture, SoapUtil.GetResourceString("Serialization_UseCode"), new object[] { use.ToString() }));
            }
            this.EmitLine();
        }
Esempio n. 2
0
 private void WriteAttributeList(AttributeList attrList)
 {
     for (int i = 0; i < attrList.Count; i++)
     {
         string str;
         string str2;
         attrList.Get(i, out str, out str2);
         this.InternalWrite(" ");
         this.InternalWrite(str);
         this.InternalWrite("=");
         this.InternalWrite("\"");
         this.InternalWrite(str2);
         this.InternalWrite("\"");
     }
 }
 private void WriteAttributeList(AttributeList attrList)
 {
     for (int i = 0; i < attrList.Count; i++)
     {
         string str;
         string str2;
         attrList.Get(i, out str, out str2);
         this.InternalWrite(" ");
         this.InternalWrite(str);
         this.InternalWrite("=");
         this.InternalWrite("\"");
         this.InternalWrite(str2);
         this.InternalWrite("\"");
     }
 }
        internal void Write(InternalElementTypeE use, string name, AttributeList attrList, string value, bool isNameEscape, bool isValueEscape)
        {
            string s = name;
            if (isNameEscape)
            {
                s = this.NameEscape(name);
            }
            if (use == InternalElementTypeE.ObjectEnd)
            {
                this.instanceIndent--;
            }
            this.InternalWrite("<");
            if (use == InternalElementTypeE.ObjectEnd)
            {
                this.InternalWrite("/");
            }
            this.InternalWrite(s);
            this.WriteAttributeList(attrList);
            switch (use)
            {
                case InternalElementTypeE.ObjectBegin:
                    this.InternalWrite(">");
                    this.instanceIndent++;
                    break;

                case InternalElementTypeE.ObjectEnd:
                    this.InternalWrite(">");
                    break;

                case InternalElementTypeE.Member:
                    if (value != null)
                    {
                        this.InternalWrite(">");
                        if (isValueEscape)
                        {
                            this.InternalWrite(this.Escape(value));
                        }
                        else
                        {
                            this.InternalWrite(value);
                        }
                        this.InternalWrite("</");
                        this.InternalWrite(s);
                        this.InternalWrite(">");
                        break;
                    }
                    this.InternalWrite("/>");
                    break;

                default:
                    throw new SerializationException(string.Format(CultureInfo.CurrentCulture, SoapUtil.GetResourceString("Serialization_UseCode"), new object[] { use.ToString() }));
            }
            this.EmitLine();
        }
Esempio n. 5
0
 void WriteAttributeList(AttributeList attrList)
 {
     for (int i=0; i<attrList.Count; i++)
     {
         String aName;
         String aValue;
         attrList.Get(i, out aName, out aValue);
         InternalWrite(" ");
         InternalWrite(aName);
         InternalWrite("=");
         InternalWrite("\"");
         //InternalWrite(Escape(aValue));
         InternalWrite(aValue);
         InternalWrite("\"");
     }
 } // WriteAttributeList
Esempio n. 6
0
		// Write an XML element
		internal void Write(InternalElementTypeE use, String name, AttributeList attrList, String value, bool isNameEscape, bool isValueEscape)
		{
			InternalST.Soap( this,"Write ",((Enum)use).ToString(),", name "+name+", value ",value, " isNameEscape ",isNameEscape," isValueEscape ",isValueEscape);

			String elementName = name;
			if (isNameEscape)
				elementName = NameEscape(name);

			if (use == InternalElementTypeE.ObjectEnd)
				instanceIndent--;
			
			EmitIndent(instanceIndent);			

			InternalWrite("<");
			if (use == InternalElementTypeE.ObjectEnd)
				InternalWrite("/");
			InternalWrite(elementName);

			WriteAttributeList(attrList);
			
			switch(use)
			{
				case InternalElementTypeE.ObjectBegin:
					InternalWrite(">");
					instanceIndent++;
					break;
				case InternalElementTypeE.ObjectEnd:
					InternalWrite(">");
					break;
				case InternalElementTypeE.Member:
					if (value == null)
						InternalWrite("/>");
					else
					{
						InternalWrite(">");
						if (isValueEscape)
							InternalWrite(Escape(value));
						else
							InternalWrite(value);
						InternalWrite("</");
						InternalWrite(elementName);
						InternalWrite(">");					
					}
					break;
				default:
					throw new SerializationException(String.Format(SoapUtil.GetResourceString("Serialization_UseCode"),((Enum)use).ToString()));									
			}
			EmitLine();
		}