예제 #1
0
        public IRowCol NewRowCol(
            int RowNum = -1, int ColNum = -1, ScreenContent ScreenContent = null,
            bool ForceParentRelative = false)
        {
            IRowCol rowCol = null;

            if (RowNum == -1)
            {
                RowNum = this.RowNum;
            }
            if (ColNum == -1)
            {
                ColNum = this.ColNum;
            }

            if (ScreenContent == null)
            {
                if (ForceParentRelative == true)
                {
                    rowCol = new OneRowCol(
                        RowNum, ColNum, this.Dim, RowColRelative.Parent, null);
                }
                else
                {
                    rowCol = new OneRowCol(
                        RowNum, ColNum, this.Dim, this.RowColRelative, this.ContentStart);
                }
            }
            else
            {
                rowCol = new OneRowCol(RowNum, ColNum, ScreenContent);
            }
            return(rowCol);
        }
예제 #2
0
        /// <summary>
        /// create a new RowCol from component parts. Either a ZeroRowCol or OneRowCol,
        /// depending on LocationFrame.
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="RowNum"></param>
        /// <param name="ColNum"></param>
        /// <param name="Height"></param>
        /// <param name="Width"></param>
        /// <returns></returns>
        public static IRowCol Factory(LocationFrame frame, int RowNum, int ColNum, int Height, int Width)
        {
            IRowCol rc = null;

            if (frame == LocationFrame.OneBased)
            {
                rc = new OneRowCol(RowNum, ColNum, new ScreenDim(Height, Width));
            }
            else
            {
                rc = new ZeroRowCol(RowNum, ColNum, new ScreenDim(Height, Width));
            }
            return(rc);
        }