コード例 #1
0
            internal override int Anchor(int width)
            {
                var la = left.Anchor(width);
                var ra = right.Anchor(width);

                if (add)
                {
                    return(la + ra);
                }
                return(la - ra);
            }
コード例 #2
0
ファイル: ComboBox.cs プロジェクト: ag-csharp/gui.cs
        /// <summary>
        /// Get DimAbsolute as integer value
        /// </summary>
        /// <param name="dim"></param>
        /// <returns></returns>
        private int GetDimAsInt(Dim dim)
        {
            if (!(dim is Dim.DimAbsolute))
            {
                throw new ArgumentException("Dim must be an absolute value");
            }

            // Anchor in the case of DimAbsolute returns absolute value. No documentation on what Anchor() does so not sure if this will change in the future.
            //
            // TODO: Does Dim need:-
            //		public static implicit operator int (Dim d)
            //
            return(dim.Anchor(0));
        }