LitDev.vars.getValue C# (CSharp) Method

getValue() public method

public getValue ( ) : Primitive
return Primitive
        public Primitive getValue()
        {
            if (null != FormDebug.stackTrace)
            {
                StackFrame frame = FormDebug.stackTrace.GetFrame(FormDebug.stackTrace.FrameCount - 1);
                MethodBase method = frame.GetMethod();
                Type type = method.DeclaringType;
                FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
                Primitive var = (Primitive)fields[i].GetValue(null);
                if (indices.Count == 0) return var;
                else if (indices.Count == 1) return var[indices[0]];
                else if (indices.Count == 2) return var[indices[0]][indices[1]];
                else if (indices.Count == 3) return var[indices[0]][indices[1]][indices[2]];
            }
            return "";
        }