示例#1
0
        // twin method
        internal static FromChainer From(this IFrom prev, IOpenView table, DbNode node)
        {
            var cfrom = new FromChainer((Chainer)prev, table);

            cfrom.SetNode(node);
            return(cfrom);
        }
示例#2
0
        internal ElseIfChainer(Chainer prev, IOpenView openView, bool sign)
            : base(prev)
        {
            chainMethod = Text.Method.ElseIfExists;
            CheckNullAndThrow(Arg(() => openView, openView));

            IOpenView query;

            if (openView is ISemantic)
            {
                query = DbMapping.SelectFromSemantic((ISemantic)openView);
            }
            else
            {
                query = openView;
            }

            var view = new View(query);

            if (Exception != null)
            {
                Exception.Extra = String.Format("Check {0} method.", Exception.Method);
                TryThrow();
            }

            Build = BuildViewMethod(view, sign);
        }
示例#3
0
        internal View(IOpenView prev)
            : base((Chainer)prev, ObjectType.View)
        {
            CheckAndThrow();

            compiled = false;

            Build = (buildContext, buildArgs) =>
            {
                // build with own build context, but take ParamRoot and exec context (buildArgs) from the caller
                return(BuildChain(new BuildContext(this, buildContext.ParamRoot), buildArgs));
            };
        }
示例#4
0
        /// <summary>
        /// Retrieves rows from the database with all columns from the specified table.
        /// </summary>
        /// <param name="table">Is a subquery.</param>
        public static SelectChainer FromSelect(IOpenView table)
        {
            return(Call <SelectChainer>(Assembly.GetCallingAssembly(), (ca) =>
            {
                if (table == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "table", Wall.Text.Method.FromSelect);
                }

                var root = new d();
                return new FromChainer(root, table).Select();
            }));
        }
示例#5
0
        // internal ctor for open views
        //   outerQuery:
        //     one-level higher outer query whose table is this open view
        internal View(IOpenView prev, Query outerQuery)
            : base((Chainer)prev, ObjectType.View)
        {
            CheckAndThrow();

            OuterQuery = outerQuery;

            compiled = false;

            Build = (buildContext, buildArgs) =>
            {
                Query.Master = outerQuery.Master;
                Query.Level  = outerQuery.Level + 1;

                // build with own build context, but take ParamRoot and exec context (buildArgs) from the caller
                return(BuildChain(new BuildContext(this, buildContext.ParamRoot), buildArgs));
            };
        }
示例#6
0
    void Awake()
    {
        iInitView    = GetComponentInChildren <IInitView>();
        iSetupView   = GetComponentInChildren <ISetupView>();
        iOpenView    = GetComponentInChildren <IOpenView>();
        iCloseView   = GetComponentInChildren <ICloseView>();
        iExecuteView = GetComponentInChildren <IExecuteView>();
        canvasGroup  = ui.GetComponent <CanvasGroup>();

        if (hideOnAwake)
        {
            HideCanvas();
        }

        ui.anchoredPosition = Vector2.zero;
        iInitView?.InitView(this);
        if (rememberPreviouslySelected)
        {
            EventSystem.current.SetSelectedGameObject(m_PreviouslySelected);
        }
    }
示例#7
0
 internal FullJoinChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
 /// <summary>
 /// Returns TRUE if a query contains any rows.
 /// </summary>
 /// <param name="prev">Is a predecessor object.</param>
 /// <param name="openView">Is a subquery.</param>
 public static ElseIfChainer ElseIfExists(this IAny prev, IOpenView openView)
 {
     return(new ElseIfChainer((Chainer)prev, openView, true));
 }
 /// <summary>
 /// Returns TRUE if a query does not contains any rows.
 /// </summary>
 /// <param name="prev">Is a predecessor object.</param>
 /// <param name="openView">Is a subquery.</param>
 public static IfChainer IfNotExists(this IAny prev, IOpenView openView)
 {
     return(new IfChainer((Chainer)prev, openView, false));
 }
示例#10
0
 /// <summary>
 /// Retrieves rows from the database with all columns from the specified table.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is a subquery.</param>
 public static SelectChainer FromSelect(this IFrom prev, IOpenView table)
 {
     return(new FromChainer((Chainer)prev, table).Select());
 }
示例#11
0
 /// <summary>
 /// Specifies the outer apply operation between two table expressions.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static OuterApplyChainer OuterApply(this IOuterApply prev, IOpenView table)
 {
     return(new OuterApplyChainer((Chainer)prev, table));
 }
示例#12
0
 /// <summary>
 /// Specifies the tables, views, derived tables, and joined tables used in SELECT, DELETE, and UPDATE statements.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static FromChainer From(this IFrom prev, IOpenView table)
 {
     return(new FromChainer((Chainer)prev, table));
 }
示例#13
0
 /// <summary>
 /// Specifies the cross apply operation between two table expressions.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static CrossApplyChainer CrossApply(this ICrossApply prev, IOpenView table)
 {
     return(new CrossApplyChainer((Chainer)prev, table));
 }
示例#14
0
 /// <summary>
 /// Specifies the cross join (Cartesian product) operation between two tables.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static CrossJoinChainer CrossJoin(this IFullJoin prev, IOpenView table)
 {
     return(new CrossJoinChainer((Chainer)prev, table));
 }
示例#15
0
 /// <summary>
 /// Specifies the right outer join operation between two tables.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static RightOuterJoinChainer RightOuterJoin(this IRightOuterJoin prev, IOpenView table)
 {
     return(new RightOuterJoinChainer((Chainer)prev, table));
 }
示例#16
0
 internal CrossApplyChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
示例#17
0
 internal LeftOuterJoinChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
示例#18
0
 internal OuterApplyChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
示例#19
0
 internal FromChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
示例#20
0
 internal CrossJoinChainer(Chainer prev, IOpenView table)
     : base(prev, table)
 {
 }
示例#21
0
 /// <summary>
 /// Specifies the inner join operation between two tables.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static InnerJoinChainer InnerJoin(this IInnerJoin prev, IOpenView table)
 {
     return(new InnerJoinChainer((Chainer)prev, table));
 }
示例#22
0
 /// <summary>
 /// Specifies the left outer join operation between two tables.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is an open view object.</param>
 public static LeftOuterJoinChainer LeftOuterJoin(this ILeftOuterJoin prev, IOpenView table)
 {
     return(new LeftOuterJoinChainer((Chainer)prev, table));
 }
示例#23
0
        internal TableChainer(Chainer prev, IOpenView openView)
            : this(prev)
        {
            IOpenView query = null;

            // SEMQ
            if (openView is ISemantic)
            {
                SetNode(((DbNode)openView).Root);

                if (((ISemantic)openView).IsQuery)
                {
                    query = DbMapping.SelectFromSemantic((ISemantic)openView);
                }
                else if (openView is IFunction)
                {
                    ProcessTableArgument(((IFunction)openView).GetUdf());
                    return;
                }
                // table/view identifier:
                else
                {
                    if (_node.IsSynonym)
                    {
                        if (_node.SynonymQuery is IOpenView)
                        {
                            query = (IOpenView)_node.SynonymQuery;
                        }
                        else
                        {
                            ProcessTableArgument((View)_node.SynonymQuery);
                            return;
                        }
                    }
                    else
                    {
                        ProcessTableArgument(_node.Map.Name);
                        return;
                    }
                }
            }
            // SQL query:
            else
            {
                query = openView;
            }

            Query.AddTableObject(this);

            var tableArgument = query;
            CheckNullAndThrow(Arg(() => tableArgument, tableArgument));
            TryThrow(((Chainer)query).Exception);

            var view = new View(query, Query);
            _table = view;

            Query.AddArguments(view.Query.Arguments.ToArray());

            if (chainException != null)
            {
                chainException.Extra = String.Format("Check {0} method.", chainException.Method);
                TryThrow();
            }

            TableArgument = _table;
        }