コード例 #1
0
        public static VerticalAlignment ToContentVerticalAlignment(this TextAlignment alignment)
        {
            switch (alignment)
            {
            case TextAlignment.Center:
                return(VerticalAlignment.Center);

            case TextAlignment.End:
                return(VerticalAlignment.Bottom);

            case TextAlignment.Start:
                return(VerticalAlignment.Top);
            }

            throw new InvalidOperationException(alignment.ToString());
        }
コード例 #2
0
        public static HorizontalAlignment ToContentHorizontalAlignment(this TextAlignment alignment)
        {
            switch (alignment)
            {
            case TextAlignment.Center:
                return(HorizontalAlignment.Center);

            case TextAlignment.End:
                return(HorizontalAlignment.Right);

            case TextAlignment.Start:
                return(HorizontalAlignment.Left);
            }

            throw new InvalidOperationException(alignment.ToString());
        }
コード例 #3
0
        /// <summary>
        /// To the droid horizontal gravity.
        /// </summary>
        /// <param name="alignment">The alignment.</param>
        /// <returns>GravityFlags.</returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static GravityFlags ToDroidHorizontalGravity(this TextAlignment alignment)
        {
            switch (alignment)
            {
            case TextAlignment.Center:
                return(GravityFlags.CenterHorizontal);

            case TextAlignment.End:
                return(GravityFlags.Right);

            case TextAlignment.Start:
                return(GravityFlags.Left);
            }

            throw new InvalidOperationException(alignment.ToString());
        }
コード例 #4
0
        /// <summary>
        /// To the droid vertical gravity.
        /// </summary>
        /// <param name="alignment">The alignment.</param>
        /// <returns>GravityFlags.</returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static GravityFlags ToDroidVerticalGravity(this TextAlignment alignment)
        {
            switch (alignment)
            {
            case TextAlignment.Center:
                return(GravityFlags.CenterVertical);

            case TextAlignment.End:
                return(GravityFlags.Bottom);

            case TextAlignment.Start:
                return(GravityFlags.Top);
            }

            throw new InvalidOperationException(alignment.ToString());
        }
コード例 #5
0
        /// <summary>
        /// To the droid text alignment.
        /// </summary>
        /// <param name="alignment">The alignment.</param>
        /// <returns>DroidTextAlignment.</returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static DroidTextAlignment ToDroidTextAlignment(this TextAlignment alignment)
        {
            switch (alignment)
            {
            case TextAlignment.Center:
                return(DroidTextAlignment.Center);

            case TextAlignment.End:
                return(DroidTextAlignment.ViewEnd);

            case TextAlignment.Start:
                return(DroidTextAlignment.ViewStart);
            }

            throw new InvalidOperationException(alignment.ToString());
        }