Esempio n. 1
0
    public JSONInStream List(int idx, Action <int, JSONInStream> callback)
    {
        JSONListFieldValue fieldValue = (JSONListFieldValue)node.GetField(idx);
        int i = 0;

        foreach (IJSONFieldValue val in fieldValue.value)
        {
            JSONNode     n      = new JSONNode(val);
            JSONInStream stream = new JSONInStream(n);

            try
            {
                JSONObjectFieldValue valObject = (JSONObjectFieldValue)val;
                if (valObject != null)
                {
                    stream = stream.Start(0);
                }
            }
            catch (Exception e) {}


            callback(i++, stream);
        }
        return(this);
    }
Esempio n. 2
0
    public JSONInStream List(string tag, Action <int, JSONInStream> callback)
    {
        JSONListFieldValue jSONListFieldValue = null;

        try
        {
            jSONListFieldValue = (JSONListFieldValue)node.GetField(tag);
        }
        catch (Exception ex)
        {
            Debug.LogError((object)ex);
            Debug.LogError((object)tag);
        }
        int num = 0;

        foreach (IJSONFieldValue item in jSONListFieldValue.value)
        {
            JSONNode     jSONNode     = new JSONNode(item);
            JSONInStream jSONInStream = new JSONInStream(jSONNode);
            try
            {
                JSONObjectFieldValue jSONObjectFieldValue = (JSONObjectFieldValue)item;
                if (jSONObjectFieldValue != null)
                {
                    jSONInStream = jSONInStream.Start(0);
                }
            }
            catch
            {
            }
            callback(num++, jSONInStream);
        }
        return(this);
    }
Esempio n. 3
0
    //---------------------------------------------------------------------------------
    // List
    //---------------------------------------------------------------------------------
    public JSONInStream List(string tag, Action <int, JSONInStream> callback)
    {
        JSONListFieldValue fieldValue = null;

        try{
            fieldValue = (JSONListFieldValue)node.GetField(tag);
        }
        catch (System.Exception e) {
            Debug.LogError(e);
            Debug.LogError(tag);
        }

        int i = 0;

        foreach (IJSONFieldValue val in fieldValue.value)
        {
            JSONNode     n      = new JSONNode(val);
            JSONInStream stream = new JSONInStream(n);

            try
            {
                JSONObjectFieldValue valObject = (JSONObjectFieldValue)val;
                if (valObject != null)
                {
                    stream = stream.Start(0);
                }
            }
            catch {}

            callback(i++, stream);
        }
        return(this);
    }
Esempio n. 4
0
    public JSONInStream List(int idx, Action <int, JSONInStream> callback)
    {
        JSONListFieldValue fieldValue = (JSONListFieldValue)node.GetField(idx);
        int i = 0;

        foreach (IJSONFieldValue val in fieldValue.value)
        {
            JSONNode     n      = new JSONNode(val);
            JSONInStream stream = new JSONInStream(n);
            callback(i++, stream);
        }
        return(this);
    }
Esempio n. 5
0
    public JSONInStream List(int idx, Action <int, JSONInStream> callback)
    {
        JSONListFieldValue jSONListFieldValue = (JSONListFieldValue)node.GetField(idx);
        int num = 0;

        foreach (IJSONFieldValue item in jSONListFieldValue.value)
        {
            JSONNode     jSONNode     = new JSONNode(item);
            JSONInStream jSONInStream = new JSONInStream(jSONNode);
            try
            {
                JSONObjectFieldValue jSONObjectFieldValue = (JSONObjectFieldValue)item;
                if (jSONObjectFieldValue != null)
                {
                    jSONInStream = jSONInStream.Start(0);
                }
            }
            catch
            {
            }
            callback(num++, jSONInStream);
        }
        return(this);
    }