Ejemplo n.º 1
0
        public static void ToString(this StreamedResource resource, StringBuilder buf, int depth)
        {
            string tab    = "\t";
            string indent = "";

            for (int i = 0; i < depth; i++)
            {
                indent += tab;
            }

            buf.Append("StreamedResource { ").Append(Environment.NewLine);
            buf.Append(indent).Append(tab).AppendFormat("Source : {0},", resource.Source).Append(Environment.NewLine);
            buf.Append(indent).Append(tab).AppendFormat("Offset : {0},", resource.Offset).Append(Environment.NewLine);
            buf.Append(indent).Append(tab).AppendFormat("Size : {0},", resource.Size).Append(Environment.NewLine);
            buf.Append(indent).Append("}");
        }
Ejemplo n.º 2
0
 public static void ToString(this object obj, StringBuilder buf, int depth)
 {
     if (obj is DynamicObject)
     {
         ((DynamicObject)obj).ToString(buf, depth);
     }
     else if (obj is string)
     {
         buf.AppendFormat("\"{0}\"", obj);
     }
     else if (obj is Matrix4x4)
     {
         Matrix4x4 mat = (Matrix4x4)obj;
         mat.ToString(buf, depth);
     }
     else if (obj is StreamedResource)
     {
         StreamedResource resource = (StreamedResource)obj;
         resource.ToString(buf, depth);
     }
     //else if (obj is Collection)
     //{
     //    Collection list = obj as Collection;
     //    list.ToString(buf, depth);
     //}
     else if (obj is Map)
     {
         Map dict = obj as Map;
         dict.ToString(buf, depth);
     }
     else if (obj is IList)
     {
         IList list = obj as IList;
         list.ToString(buf, depth);
     }
     else if (obj is IDictionary)
     {
         IDictionary dict = obj as IDictionary;
         dict.ToString(buf, depth);
     }
     else
     {
         buf.Append(obj);
     }
 }