IsEscaped() static private method

static private IsEscaped ( InternalPrimitiveTypeE code ) : bool
code InternalPrimitiveTypeE
return bool
示例#1
0
        internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, object value)
        {
            this.attrList.Clear();
            if ((typeNameInfo.NItype != null) && (memberNameInfo.NItransmitTypeOnMember || (memberNameInfo.NItransmitTypeOnObject && !memberNameInfo.NIisArrayItem)))
            {
                this.attrList.Put("xsi:type", this.TypeNameTagResolver(typeNameInfo, true));
            }
            string str = null;

            if (value != null)
            {
                if (typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.QName)
                {
                    SoapQName name = (SoapQName)value;
                    if ((name.Key == null) || (name.Key.Length == 0))
                    {
                        this.attrList.Put("xmlns", "");
                    }
                    else
                    {
                        this.attrList.Put("xmlns:" + name.Key, name.Namespace);
                    }
                    str = name.ToString();
                }
                else if (value is string)
                {
                    str = (string)value;
                }
                else
                {
                    str = Converter.SoapToString(value, typeNameInfo.NIprimitiveTypeEnum);
                }
            }
            NameInfo info = null;

            if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
            {
                info = typeNameInfo;
            }
            string str2 = this.MemberElementName(memberNameInfo, info);

            this.NamespaceAttribute();
            this.Write(InternalElementTypeE.Member, str2, this.attrList, str, true, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
        }
示例#2
0
        internal void WriteObjectString(NameInfo nameInfo, string value)
        {
            this.attrList.Clear();
            if (nameInfo.NIobjectId == this.topId)
            {
                this.Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", this.attrList, null, false, false);
            }
            if (nameInfo.NIobjectId > 0L)
            {
                this.attrList.Put("id", this.IdToString((int)nameInfo.NIobjectId));
            }
            string name = null;

            if (nameInfo.NIobjectId > 0L)
            {
                name           = "SOAP-ENC:string";
                this.isUsedEnc = true;
            }
            else
            {
                name = "xsd:string";
            }
            this.Write(InternalElementTypeE.Member, name, this.attrList, value, false, Converter.IsEscaped(nameInfo.NIprimitiveTypeEnum));
        }
示例#3
0
        internal void WriteMemberString(NameInfo memberNameInfo, NameInfo typeNameInfo, string value)
        {
            int nIobjectId = (int)typeNameInfo.NIobjectId;

            this.attrList.Clear();
            if (nIobjectId > 0)
            {
                this.attrList.Put("id", this.IdToString((int)typeNameInfo.NIobjectId));
            }
            if ((typeNameInfo.NItype != null) && (memberNameInfo.NItransmitTypeOnMember || (memberNameInfo.NItransmitTypeOnObject && !memberNameInfo.NIisArrayItem)))
            {
                if (typeNameInfo.NIobjectId > 0L)
                {
                    this.attrList.Put("xsi:type", "SOAP-ENC:string");
                    this.isUsedEnc = true;
                }
                else
                {
                    this.attrList.Put("xsi:type", "xsd:string");
                }
            }
            NameInfo info = null;

            if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
            {
                info = typeNameInfo;
            }
            string name = this.MemberElementName(memberNameInfo, info);

            this.NamespaceAttribute();
            this.Write(InternalElementTypeE.Member, name, this.attrList, value, true, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
        }
示例#4
0
 internal void WriteItemString(NameInfo itemNameInfo, NameInfo typeNameInfo, string value)
 {
     this.attrList.Clear();
     if (typeNameInfo.NIobjectId > 0L)
     {
         this.attrList.Put("id", this.IdToString((int)typeNameInfo.NIobjectId));
     }
     if (itemNameInfo.NItransmitTypeOnMember)
     {
         if (typeNameInfo.NItype == SoapUtil.typeofString)
         {
             if (typeNameInfo.NIobjectId > 0L)
             {
                 this.attrList.Put("xsi:type", "SOAP-ENC:string");
                 this.isUsedEnc = true;
             }
             else
             {
                 this.attrList.Put("xsi:type", "xsd:string");
             }
         }
         else
         {
             this.attrList.Put("xsi:type", this.TypeNameTagResolver(typeNameInfo, true));
         }
     }
     this.NamespaceAttribute();
     this.Write(InternalElementTypeE.Member, "item", this.attrList, value, false, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
 }