Пример #1
0
 public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     object[]           args = new object[] { this.dwDataLen };
     type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwDataLen]", "{0:d}", args);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         if (0x100000 < this.dwDataLen)
         {
             return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
         }
         type = TdrBufUtil.printArray(ref destBuf, indent, separator, "[szData]", (long)this.dwDataLen);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         for (int i = 0; i < this.dwDataLen; i++)
         {
             object[] objArray2 = new object[] { this.szData[i] };
             type = destBuf.sprintf("0x{0:x2}", objArray2);
             if (type != TdrError.ErrorType.TDR_NO_ERROR)
             {
                 return(type);
             }
         }
         object[] objArray3 = new object[] { separator };
         type = destBuf.sprintf("{0}", objArray3);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
     }
     return(type);
 }
Пример #2
0
        /* set indent = -1 to disable indent , default: separator = '\n' */
        public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
        {
            TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR;

            /* visualize member: this.iId */
            ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iId]", "{0:d}", this.iId);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                TdrDebug.tdrTrace();
#endif
                return(ret);
            }

            /* visualize member: this.iCount */
            ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iCount]", "{0:d}", this.iCount);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                TdrDebug.tdrTrace();
#endif
                return(ret);
            }

            return(ret);
        }
Пример #3
0
 public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
 {
     TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stResponseStatus]", true);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     if (0 > indent)
     {
         errorType = this.stResponseStatus.visualize(ref destBuf, indent, separator);
     }
     else
     {
         errorType = this.stResponseStatus.visualize(ref destBuf, indent + 1, separator);
     }
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stHttpHeaders]", true);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     if (0 > indent)
     {
         errorType = this.stHttpHeaders.visualize(ref destBuf, indent, separator);
     }
     else
     {
         errorType = this.stHttpHeaders.visualize(ref destBuf, indent + 1, separator);
     }
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stResponseContent]", true);
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     if (0 > indent)
     {
         errorType = this.stResponseContent.visualize(ref destBuf, indent, separator);
     }
     else
     {
         errorType = this.stResponseContent.visualize(ref destBuf, indent + 1, separator);
     }
     if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
     {
         return(errorType);
     }
     return(errorType);
 }
Пример #4
0
 public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stRequestLine]", true);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         if (0 > indent)
         {
             type = this.stRequestLine.visualize(ref destBuf, indent, separator);
         }
         else
         {
             type = this.stRequestLine.visualize(ref destBuf, indent + 1, separator);
         }
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stHttpHeaders]", true);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (0 > indent)
         {
             type = this.stHttpHeaders.visualize(ref destBuf, indent, separator);
         }
         else
         {
             type = this.stHttpHeaders.visualize(ref destBuf, indent + 1, separator);
         }
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stRequestContent]", true);
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
         if (0 > indent)
         {
             type = this.stRequestContent.visualize(ref destBuf, indent, separator);
         }
         else
         {
             type = this.stRequestContent.visualize(ref destBuf, indent + 1, separator);
         }
         if (type != TdrError.ErrorType.TDR_NO_ERROR)
         {
             return(type);
         }
     }
     return(type);
 }
Пример #5
0
        public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
        {
            TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwDataLen]", "{0:d}", new object[]
            {
                this.dwDataLen
            });
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (1048576u < this.dwDataLen)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            errorType = TdrBufUtil.printArray(ref destBuf, indent, separator, "[szData]", (long)((ulong)this.dwDataLen));
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            int num = 0;

            while ((long)num < (long)((ulong)this.dwDataLen))
            {
                errorType = destBuf.sprintf("0x{0:x2}", new object[]
                {
                    this.szData[num]
                });
                if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                {
                    return(errorType);
                }
                num++;
            }
            errorType = destBuf.sprintf("{0}", new object[]
            {
                separator
            });
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            return(errorType);
        }
        public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
        {
            TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwHeaderCount]", "{0:d}", new object[]
            {
                this.dwHeaderCount
            });
            if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(errorType);
            }
            if (32u < this.dwHeaderCount)
            {
                return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
            }
            int num = 0;

            while ((long)num < (long)((ulong)this.dwHeaderCount))
            {
                if (this.astHeaderUnit[num] != null)
                {
                    errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[astHeaderUnit]", num, true);
                    if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(errorType);
                    }
                    if (0 > indent)
                    {
                        errorType = this.astHeaderUnit[num].visualize(ref destBuf, indent, separator);
                    }
                    else
                    {
                        errorType = this.astHeaderUnit[num].visualize(ref destBuf, indent + 1, separator);
                    }
                    if (errorType != TdrError.ErrorType.TDR_NO_ERROR)
                    {
                        return(errorType);
                    }
                }
                num++;
            }
            return(errorType);
        }
Пример #7
0
 public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
 {
     TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR;
     object[]           args = new object[] { this.dwHeaderCount };
     type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwHeaderCount]", "{0:d}", args);
     if (type == TdrError.ErrorType.TDR_NO_ERROR)
     {
         if (0x20 < this.dwHeaderCount)
         {
             return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT);
         }
         for (int i = 0; i < this.dwHeaderCount; i++)
         {
             if (this.astHeaderUnit[i] != null)
             {
                 type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[astHeaderUnit]", i, true);
                 if (type != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(type);
                 }
                 if (0 > indent)
                 {
                     type = this.astHeaderUnit[i].visualize(ref destBuf, indent, separator);
                 }
                 else
                 {
                     type = this.astHeaderUnit[i].visualize(ref destBuf, indent + 1, separator);
                 }
                 if (type != TdrError.ErrorType.TDR_NO_ERROR)
                 {
                     return(type);
                 }
             }
         }
     }
     return(type);
 }
Пример #8
0
        /* set indent = -1 to disable indent , default: separator = '\n' */
        public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
        {
            TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR;

            /* visualize member: this.iMaxOnline */
            ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iMaxOnline]", "{0:d}", this.iMaxOnline);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                StackTrace st = new StackTrace(true);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    if (null != st.GetFrame(i).GetFileName())
                    {
                        Console.WriteLine("TSF4G_TRACE:  " + st.GetFrame(i).ToString());
                    }
                }
#endif
                return(ret);
            }

            /* visualize member: this.iCurrentOnline */
            ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iCurrentOnline]", "{0:d}", this.iCurrentOnline);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                StackTrace st = new StackTrace(true);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    if (null != st.GetFrame(i).GetFileName())
                    {
                        Console.WriteLine("TSF4G_TRACE:  " + st.GetFrame(i).ToString());
                    }
                }
#endif
                return(ret);
            }

            /* visualize member: this.szConnectUrl */
            ret = TdrBufUtil.printString(ref destBuf, indent, separator, "[szConnectUrl]", this.szConnectUrl);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                StackTrace st = new StackTrace(true);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    if (null != st.GetFrame(i).GetFileName())
                    {
                        Console.WriteLine("TSF4G_TRACE:  " + st.GetFrame(i).ToString());
                    }
                }
#endif
                return(ret);
            }

            /* visualize member: this.szPingUrl */
            ret = TdrBufUtil.printString(ref destBuf, indent, separator, "[szPingUrl]", this.szPingUrl);
            if (TdrError.ErrorType.TDR_NO_ERROR != ret)
            {
#if (DEBUG)
                StackTrace st = new StackTrace(true);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    if (null != st.GetFrame(i).GetFileName())
                    {
                        Console.WriteLine("TSF4G_TRACE:  " + st.GetFrame(i).ToString());
                    }
                }
#endif
                return(ret);
            }

            return(ret);
        }