ToString() public method

Converts the Headers and Data into Gamespy ASP Format
public ToString ( ) : string
return string
Exemplo n.º 1
0
        /// <summary>
        /// Adds HeaderData to the current output
        /// </summary>
        /// <param name="Data"></param>
        public void WriteHeaderDataPair(Dictionary <string, object> Data)
        {
            if (Transpose)
            {
                if (Formatted != null)
                {
                    ResponseBody.Append(Formatted.ToString());
                }

                List <string> Params = new List <string>(Data.Count);
                foreach (KeyValuePair <string, object> Item in Data)
                {
                    Params.Add(Item.Key);
                }

                Formatted           = new FormattedOutput(Params);
                Formatted.Transpose = true;

                Params = new List <string>(Data.Count);
                foreach (KeyValuePair <string, object> Item in Data)
                {
                    Params.Add(Item.Value.ToString());
                }

                Formatted.AddRow(Params);
            }
            else
            {
                // Add Keys
                ResponseBody.Append("\nH");
                foreach (KeyValuePair <string, object> Item in Data)
                {
                    ResponseBody.Append("\t" + Item.Key);
                }

                // Add Data
                ResponseBody.Append("\nD");
                foreach (KeyValuePair <string, object> Item in Data)
                {
                    ResponseBody.Append("\t" + Item.Value);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds HeaderData to the current output
 /// </summary>
 /// <param name="Data"></param>
 public void AddData(FormattedOutput Data)
 {
     Data.Transpose = Transpose;
     ResponseBody.Append(Data.ToString().Trim());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds HeaderData to the current output
 /// </summary>
 /// <param name="Data"></param>
 public void AddData(FormattedOutput Data)
 {
     Data.Transpose = Transpose;
     ResponseBody.Append(Data.ToString().Trim());
 }