public static void FormatOutput(IExportText textColumn) { if (String.IsNullOrWhiteSpace(textColumn.Text)) { return; } if (textColumn.Name == "xy") { Console.WriteLine("stop"); } if (!String.IsNullOrEmpty(textColumn.FormatString)) { if (textColumn.DataType.ToLower().Contains("timespan")) { textColumn.Text = HandleTimeSpan(textColumn.Text, textColumn.FormatString); } else { var typeCode = TypeHelper.TypeCodeFromString(textColumn.DataType); textColumn.Text = FormatItem(textColumn.Text, textColumn.FormatString, typeCode); if (textColumn.Name == "xy") { Console.WriteLine("stop {0}", textColumn.Text); } } } }
public static void FormatOutput(IExportText textColumn) { if (!String.IsNullOrEmpty(textColumn.FormatString)) { TypeCode typeCode = TypeHelper.TypeCodeFromString(textColumn.DataType); textColumn.Text = FormatItem(textColumn.Text, textColumn.FormatString, typeCode); } }
public static void FormatOutput (IExportText textColumn) { if (String.IsNullOrWhiteSpace(textColumn.Text)) { return; } if (!String.IsNullOrEmpty(textColumn.FormatString)) { TypeCode typeCode = TypeHelper.TypeCodeFromString(textColumn.DataType); textColumn.Text = FormatItem(textColumn.Text,textColumn.FormatString,typeCode); } }
public static void FormatOutput (IExportText textColumn) { if (String.IsNullOrWhiteSpace(textColumn.Text)) { return; } if (!String.IsNullOrEmpty(textColumn.FormatString)) { if (textColumn.DataType.ToLower().Contains("timespan")) { textColumn.Text = HandleTimeSpan(textColumn.Text,textColumn.FormatString); } else { var typeCode = TypeHelper.TypeCodeFromString(textColumn.DataType); textColumn.Text = FormatItem(textColumn.Text,textColumn.FormatString,typeCode); } } }
public static Size Measure (IExportText item,Graphics graphics) { if (!item.CanGrow) { return item.Size; } var sf = new StringFormat(); sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces; if (!String.IsNullOrEmpty(item.Text)) { SizeF sizeF = graphics.MeasureString(item.Text.TrimEnd(), item.Font, item.Size.Width); if (sizeF.Height < item.Size.Height) { return item.Size; } return new Size(item.Size.Width,(int)Math.Ceiling(sizeF.Height)); } return item.Size; }
static void CreateStrikeout(TextBlock textBlock, IExportText exportColumn) { if (textBlock == null) { throw new ArgumentNullException("textBlock"); } if (exportColumn == null) { throw new ArgumentNullException("exportColumn"); } var strikeOut = new TextDecoration(); strikeOut.Location = TextDecorationLocation.Strikethrough; Pen p = CreateWpfPen(exportColumn); strikeOut.Pen = p; strikeOut.PenThicknessUnit = TextDecorationUnit.FontRecommended; textBlock.TextDecorations.Add(strikeOut); }
public static Size Measure(IExportText item, Graphics graphics) { if (!item.CanGrow) { return(item.Size); } var sf = new StringFormat(); sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces; if (!String.IsNullOrEmpty(item.Text)) { SizeF sizeF = graphics.MeasureString(item.Text.TrimEnd(), item.Font, item.Size.Width); if (sizeF.Height < item.Size.Height) { return(item.Size); } return(new Size(item.Size.Width, (int)Math.Ceiling(sizeF.Height))); } return(item.Size); }
static void CreateStrikeout (TextBlock textBlock,IExportText exportColumn ){ if (textBlock == null) throw new ArgumentNullException("textBlock"); if (exportColumn == null) throw new ArgumentNullException("exportColumn"); var strikeOut = new TextDecoration(); strikeOut.Location = TextDecorationLocation.Strikethrough; Pen p = CreateWpfPen(exportColumn); strikeOut.Pen = p ; strikeOut.PenThicknessUnit = TextDecorationUnit.FontRecommended; textBlock.TextDecorations.Add(strikeOut); }