Esempio n. 1
0
        public static SqlState Create(object obj1, object obj2, object obj3, object obj4, object obj5)
        {
            SqlState state = new SqlState(5);

            state.Append(obj1).Append(obj2).Append(obj3).Append(obj4).Append(obj5);
            return(state);
        }
Esempio n. 2
0
        public static SqlState Create(object obj1, object obj2)
        {
            SqlState state = new SqlState(2);

            state.Append(obj1).Append(obj2);
            return(state);
        }
Esempio n. 3
0
        public static SqlState Create(object obj)
        {
            SqlState state = new SqlState(1);

            state.Append(obj);
            return(state);
        }
Esempio n. 4
0
        StringBuilder InnerToSql()
        {
            StringBuilder sb = new StringBuilder();

            Stack <object> stack = new Stack <object>();

            stack.Push(this);

            do
            {
                object   obj   = stack.Pop();
                SqlState state = obj as SqlState;
                if (state != null)
                {
                    for (int i = state._sqlStorage.Count - 1; i >= 0; i--)
                    {
                        stack.Push(state._sqlStorage[i]);
                    }
                }
                else
                {
                    sb.Append(obj);
                }
            }while (stack.Count > 0);

            return(sb);
        }
Esempio n. 5
0
        public static SqlState Create(params object[] objs)
        {
            if (objs == null)
            {
                return(new SqlState());
            }

            SqlState state = new SqlState(objs.Length);

            return(state.Append(objs));
        }
Esempio n. 6
0
        public int ToSql(StringBuilder sb)
        {
            this._recursiveDepth = 0;

            for (int i = 0; i < this._sqlStorage.Count; i++)
            {
                var      obj   = this._sqlStorage[i];
                SqlState state = obj as SqlState;
                if (state != null)
                {
                    int recursiveDepth = 1;
                    recursiveDepth += state.ToSql(sb);
                    if (this._recursiveDepth < recursiveDepth)
                    {
                        this._recursiveDepth = recursiveDepth;
                    }
                    continue;
                }

                sb.Append(obj);
            }

            return(this._recursiveDepth);
        }