moel@345: using System; moel@345: using System.Collections.Generic; moel@345: using System.Text; moel@345: using System.Windows.Forms; moel@345: using System.Drawing; moel@345: moel@345: namespace Aga.Controls moel@345: { moel@345: public static class TextHelper moel@345: { moel@345: public static StringAlignment TranslateAligment(HorizontalAlignment alignment) moel@345: { moel@345: if (alignment == HorizontalAlignment.Left) moel@345: return StringAlignment.Near; moel@345: else if (alignment == HorizontalAlignment.Right) moel@345: return StringAlignment.Far; moel@345: else moel@345: return StringAlignment.Center; moel@345: } moel@345: moel@345: public static TextFormatFlags TranslateAligmentToFlag(HorizontalAlignment alignment) moel@345: { moel@345: if (alignment == HorizontalAlignment.Left) moel@345: return TextFormatFlags.Left; moel@345: else if (alignment == HorizontalAlignment.Right) moel@345: return TextFormatFlags.Right; moel@345: else moel@345: return TextFormatFlags.HorizontalCenter; moel@345: } moel@345: moel@345: public static TextFormatFlags TranslateTrimmingToFlag(StringTrimming trimming) moel@345: { moel@345: if (trimming == StringTrimming.EllipsisCharacter) moel@345: return TextFormatFlags.EndEllipsis; moel@345: else if (trimming == StringTrimming.EllipsisPath) moel@345: return TextFormatFlags.PathEllipsis; moel@345: if (trimming == StringTrimming.EllipsisWord) moel@345: return TextFormatFlags.WordEllipsis; moel@345: if (trimming == StringTrimming.Word) moel@345: return TextFormatFlags.WordBreak; moel@345: else moel@345: return TextFormatFlags.Default; moel@345: } moel@345: } moel@345: }