Class DateTimeContainer
- Namespace
- CMS.MacroEngine
- Assembly
- CMS.MacroEngine.dll
Object encapsulating DateTime objects to be accessible via macro engine.
[Extension(typeof(DateTimeMethods))]
public class DateTimeContainer : IDataContainer, ISimpleDataContainer
- Inheritance
-
objectDateTimeContainer
- Implements
- Extension Methods
Constructors
DateTimeContainer(DateTime)
Creates new instance of DateTimeContainer.
public DateTimeContainer(DateTime dt)
Parameters
dtDateTimeDateTime object to be encapsulated
Properties
ColumnNames
Column names.
public List<string> ColumnNames { get; }
Property Value
- List<string>
Culture
Gets or sets the culture of the date time (for ToString formatting purposes).
public string Culture { get; set; }
Property Value
- string
DateTime
Gets the encapsulated DateTime.
public DateTime DateTime { get; }
Property Value
- DateTime
this[string]
Gets the value of the column, setter is not implemented.
public object this[string columnName] { get; set; }
Parameters
columnNamestringColumn name
Property Value
- object
Methods
ContainsColumn(string)
Returns true if the object contains specified column.
public bool ContainsColumn(string columnName)
Parameters
columnNamestringColumn name
Returns
- bool
Equals(object)
Returns true if date times are same.
public override bool Equals(object obj)
Parameters
objobjectObject to compare with
Returns
- bool
GetHashCode()
Returns hash code.
public override int GetHashCode()
Returns
- int
GetTypeCode()
Returns the TypeCode for this instance.
public TypeCode GetTypeCode()
Returns
- TypeCode
GetValue(string)
Gets or sets the value of the column.
public object GetValue(string columnName)
Parameters
columnNamestringColumn name
Returns
- object
SetValue(string, object)
Not implemented.
public bool SetValue(string columnName, object value)
Parameters
columnNamestringColumn name
valueobjectNew value
Returns
- bool
ToBoolean(IFormatProvider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.
public bool ToBoolean(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- bool
ToByte(IFormatProvider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.
public byte ToByte(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- byte
ToChar(IFormatProvider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.
public char ToChar(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- char
ToDateTime(IFormatProvider)
Converts the value of this instance to an equivalent DateTime using the specified culture-specific formatting information.
public DateTime ToDateTime(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- DateTime
ToDecimal(IFormatProvider)
Converts the value of this instance to an equivalent Decimal number using the specified culture-specific formatting information.
public decimal ToDecimal(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- decimal
ToDouble(IFormatProvider)
Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.
public double ToDouble(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- double
ToInt16(IFormatProvider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
public short ToInt16(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- short
ToInt32(IFormatProvider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.
public int ToInt32(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- int
ToInt64(IFormatProvider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.
public long ToInt64(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- long
ToSByte(IFormatProvider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.
public sbyte ToSByte(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- sbyte
ToSingle(IFormatProvider)
Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.
public float ToSingle(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- float
ToString()
Returns string representation of datetime.
public override string ToString()
Returns
- string
ToString(IFormatProvider)
Converts the value of this instance to an equivalent String using the specified culture-specific formatting information.
public string ToString(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- string
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringThe format to use or a null reference to use the default format defined for the type of the System.IFormattable implementation.
formatProviderIFormatProviderThe provider to use to format the value or a null reference to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
ToType(Type, IFormatProvider)
Converts the value of this instance to an Object of the specified Type that has an equivalent value, using the specified culture-specific formatting information.
public object ToType(Type conversionType, IFormatProvider provider)
Parameters
conversionTypeTypeproviderIFormatProvider
Returns
- object
ToUInt16(IFormatProvider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.
public ushort ToUInt16(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- ushort
ToUInt32(IFormatProvider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.
public uint ToUInt32(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- uint
ToUInt64(IFormatProvider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.
public ulong ToUInt64(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
- ulong
TryGetValue(string, out object)
Returns value of column.
public bool TryGetValue(string columnName, out object value)
Parameters
columnNamestringColumn name
valueobjectReturns the value
Returns
- bool
Returns true if the operation was successful (the value was present)