Beispiel #1
0
 /// <summary>
 /// 返回此实例等效的CQ码形式
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     if (this._originalString == null)
     {
         if (this._items.Count == 0)
         {
             // 特殊CQ码, 抖动窗口
             this._originalString = string.Format("[CQ:{0}]", _type.GetDescription());
         }
         else
         {
             // 普通CQ码, 带参数
             StringBuilder builder = new StringBuilder();
             builder.Append("[CQ:");
             builder.Append(this._type.GetDescription());                         // function
             foreach (KeyValuePair <string, string> item in this._items)
             {
                 builder.AppendFormat(",{0}={1}", item.Key, CQApi.CQEnCode(item.Value, true));
             }
             builder.Append("]");
             this._originalString = builder.ToString();
         }
     }
     return(this._originalString);
 }