• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class Format

Represents the format of a value.

Inheritance
object
Format
DateTimeFormat
FractionFormat
GeneralFormat
NumberFormat
TextFormat
Inherited Members
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public abstract class Format

Constructors

Format(string)

Initializes a new Format for the supplied workbook data.

Declaration
protected Format(string code)
Parameters
Type Name Description
string code

Fields

_code

Exposes the code associated with Format.

Declaration
protected string _code
Field Value
Type Description
string

The code returned by the operation.

Properties

Category

Get the category of the format

Declaration
public abstract FormatCategory Category { get; }
Property Value
Type Description
FormatCategory

Code

Get the code of the format. The code is a string representation of the format used to serialize to file.

Declaration
public string Code { get; }
Property Value
Type Description
string

FormatCode

Alias for Code.

Declaration
public string FormatCode { get; }
Property Value
Type Description
string

Methods

CanFormat(object)

Indicates whether an object can be formatted by the current format

Declaration
public abstract bool CanFormat(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool

Equals(object)

Exposes the equals associated with Format.

Declaration
public override sealed bool Equals(object obj)
Parameters
Type Name Description
object obj

The obj used by the operation.

Returns
Type Description
bool

The equals returned by the operation.

Overrides
object.Equals(object)

GetColor(object)

Returns the codor used to display a value. If no

Declaration
public DrawingColor GetColor(object value)
Parameters
Type Name Description
object value
Returns
Type Description
DrawingColor

GetHashCode()

Retrieves the requested hash code from the Format.

Declaration
public override sealed int GetHashCode()
Returns
Type Description
int

The get hash code returned by the operation.

Overrides
object.GetHashCode()

Parse(string)

Converts a string to a format.

Declaration
public static Format Parse(string formatCode)
Parameters
Type Name Description
string formatCode

A string containing the code of the format to convert

Returns
Type Description
Format
Exceptions
Type Condition
ArgumentNullException
NotSupportedException

Operators

operator >(Format, Format)

SJE 22-07-2013 comparison operators between formats

Declaration
public static bool operator >(Format a, Format b)
Parameters
Type Name Description
Format a
Format b
Returns
Type Description
bool

implicit operator Format(string)

Implicitly converts a format code string to a Format instance, allowing cell.Format = "#,##0.00" syntax.

Declaration
public static implicit operator Format(string formatCode)
Parameters
Type Name Description
string formatCode

The format code string.

Returns
Type Description
Format

operator <(Format, Format)

SJE 22-07-2013 comparison operators between formats

Declaration
public static bool operator <(Format a, Format b)
Parameters
Type Name Description
Format a
Format b
Returns
Type Description
bool
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX