/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } char[] actual = (char[])value; return(new String(actual)); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="context">Holds information about the column current being processed.</param> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(IColumnContext context, object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } string actual = (string)value; return(actual); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } TEnum actual = (TEnum)value; return(formatter(actual)); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } char actual = (char)value; return(actual.ToString(CultureInfo.CurrentCulture)); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } bool actual = (bool)value; return(actual ? TrueString : FalseString); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } byte[] actual = (byte[])value; Encoding encoding = Encoding ?? Encoding.Default; return(encoding.GetString(actual)); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } byte[] actual = (byte[])value; Encoding actualEncoding = Encoding ?? new UTF8Encoding(false); return(actualEncoding.GetString(actual)); }
/// <summary> /// Formats the given object array into an embedded record. /// </summary> /// <param name="value">The object array containing the values of the embedded record.</param> /// <returns>A formatted string containing the embedded data.</returns> public override string Format(object value) { object[] values = value as object[]; if (values == null) { return(NullHandler.GetNullRepresentation()); } StringWriter writer = new StringWriter(); SeparatedValueRecordWriter recordWriter = new SeparatedValueRecordWriter(writer, schema, options); recordWriter.WriteRecord(values); return(writer.ToString()); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="context">Holds information about the column current being processed.</param> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(IColumnContext context, object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } ushort actual = (ushort)value; return(OutputFormat == null ? actual.ToString(FormatProvider ?? CultureInfo.CurrentCulture) : actual.ToString(OutputFormat, FormatProvider ?? CultureInfo.CurrentCulture)); }
/// <summary> /// Formats the given object array into an embedded record. /// </summary> /// <param name="context">Holds information about the column current being processed.</param> /// <param name="value">The object array containing the values of the embedded record.</param> /// <returns>A formatted string containing the embedded data.</returns> public override string Format(IColumnContext context, object value) { var values = value as object[]; if (values == null) { return(NullHandler.GetNullRepresentation()); } var writer = new StringWriter(); var recordWriter = GetWriter(writer); recordWriter.WriteRecord(values); return(writer.ToString()); }
/// <summary> /// Formats the given object array into an embedded record. /// </summary> /// <param name="value">The object array containing the values of the embedded record.</param> /// <returns>A formatted string containing the embedded data.</returns> public override string Format(object value) { var values = value as object[]; if (values == null) { return(NullHandler.GetNullRepresentation()); } var writer = new StringWriter(); var recordWriter = new FixedLengthRecordWriter(writer, schema, Options ?? new FixedLengthOptions()); recordWriter.WriteRecord(values); return(writer.ToString()); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="context">Holds information about the column current being processed.</param> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(IColumnContext context, object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } Guid actual = (Guid)value; if (OutputFormat == null) { return(actual.ToString()); } return(actual.ToString(OutputFormat)); }
/// <summary> /// Formats the given object. /// </summary> /// <param name="value">The object to format.</param> /// <returns>The formatted value.</returns> public override string Format(object value) { if (value == null) { return(NullHandler.GetNullRepresentation()); } DateTime actual = (DateTime)value; if (OutputFormat == null) { return(actual.ToString(FormatProvider ?? CultureInfo.CurrentCulture)); } else { return(actual.ToString(OutputFormat, FormatProvider ?? CultureInfo.CurrentCulture)); } }
/// <summary> /// Returns null so nothing is written to the document. /// </summary> /// <param name="value">The value that needs written to the document.</param> /// <returns>A null.</returns> public override string Format(object value) { return(NullHandler.GetNullRepresentation()); }
/// <summary> /// Returns null so nothing is written to the document. /// </summary> /// <param name="context">Holds information about the column current being processed.</param> /// <param name="value">The value that needs written to the document.</param> /// <returns>A null.</returns> public override string Format(IColumnContext context, object value) { return(NullHandler.GetNullRepresentation()); }