trap() public static method

public static trap ( object self, string name ) : object
self object
name string
return object
Example #1
0
        public string toCode()
        {
            int           size = (int)this.size();
            StringBuilder s    = new StringBuilder(32 + size * 32);

            s.Append(@typeof().signature());
            s.Append('[');
            if (size == 0)
            {
                s.Append(':');
            }
            bool first = true;
            IDictionaryEnumerator en = m_map.GetEnumerator();

            while (en.MoveNext())
            {
                object key = en.Key;
                object val = en.Value;
                if (first)
                {
                    first = false;
                }
                else
                {
                    s.Append(',').Append(' ');
                }
                s.Append(FanObj.trap(key, "toCode", null))
                .Append(':')
                .Append(FanObj.trap(val, "toCode", null));
            }
            s.Append(']');
            return(s.ToString());
        }
Example #2
0
        public string toCode()
        {
            StringBuilder s = new StringBuilder(32 + m_size * 32);

            s.Append(m_of.signature());
            s.Append('[');
            if (m_size == 0)
            {
                s.Append(',');
            }
            for (int i = 0; i < m_size; ++i)
            {
                if (i > 0)
                {
                    s.Append(',').Append(' ');
                }
                s.Append(FanObj.trap(m_values[i], "toCode", null));
            }
            s.Append(']');
            return(s.ToString());
        }