Class ArchiveRow
This class carries the data of one archive row
Inheritance
System.Object
ArchiveRow
Implements
System.Data.IDataRecord
Assembly: SoCore.dll
Syntax
public class ArchiveRow : Object, IDataRecord, IEquatable<ArchiveRow>
Constructors
ArchiveRow()
Construct the object, with all blank values
Declaration
ArchiveRow(ArchiveRow)
Declaration
public ArchiveRow(ArchiveRow baseRow)
Parameters
ArchiveRow(String, Int32)
Construct the object, setting the entity name and primary key.
Declaration
public ArchiveRow(string entityName, int primaryKey)
Parameters
Type |
Name |
Description |
System.String |
entityName |
|
System.Int32 |
primaryKey |
|
ArchiveRow(String[], ArchiveRow)
Create an ArchiveRow that contains exactly the specified columns, populated from the
given row. Columns missing from the given row will have blank values in the result;
columns not in the completeColumnsList will not be copied
Declaration
public ArchiveRow(string[] completeColumnsList, ArchiveRow populatedPartialRow)
Parameters
Type |
Name |
Description |
System.String[] |
completeColumnsList |
List of column names that should be present in the new row
|
ArchiveRow |
populatedPartialRow |
Existing row object, source of data
|
Properties
ColumnData
The columns in the row, represented as name/value pairs. The value is a ArchiveColumnData object.
Declaration
public Dictionary<string, ArchiveColumnData> ColumnData { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, ArchiveColumnData> |
|
FieldCount
Declaration
public int FieldCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
Item[Int32]
Declaration
public object this[int i] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Property Value
Type |
Description |
System.Object |
|
Item[String]
Declaration
public object this[string name] { get; }
Parameters
Type |
Name |
Description |
System.String |
name |
|
Property Value
Type |
Description |
System.Object |
|
LinkHint
The link hint for this row
Declaration
public string LinkHint { get; set; }
Property Value
Type |
Description |
System.String |
|
Parents
Declaration
public List<ArchiveRowParent> Parents { get; set; }
Property Value
RowKey
The primary key of this row
Declaration
public int RowKey { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
RowRight
Table rights for the primary table of this row. The QueryProviderBase class by default sets this to be
the TableRight of the Sentry handling the PrimaryTable of the query. Typically, buttons such as Add and Delete
in archive bottom toolbars will be controlled by this right.
Link hints on the separate cells may point to logic that makes changes (such as the toggle completed hint
on the activity archive); such hints should be individually added/removed by the provider responsible for
them based on Sentry information for that particular cell (or whatever is appropriate).
Declaration
public TableRight RowRight { get; set; }
Property Value
RowType
The entity that owns the row. Semantically this is the same as .
Declaration
public string RowType { get; set; }
Property Value
Type |
Description |
System.String |
|
StyleHint
The style hint for this row
Declaration
public string StyleHint { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
AddLinkHint(String)
Add a link hint; if a link hint already has been set, then add the new with an ampersand after the old.
Declaration
public void AddLinkHint(string linkHint)
Parameters
Type |
Name |
Description |
System.String |
linkHint |
link hint to be added
|
AddLinkHintToField(String, String)
Declaration
public void AddLinkHintToField(string columnName, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
columnName |
|
System.String |
linkHint |
|
AddOverlappingBoolColumn(String, Boolean)
Declaration
public ArchiveColumnData AddOverlappingBoolColumn(string name, bool value)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Boolean |
value |
|
Returns
AddOverlappingBoolColumn(String, Boolean, String)
Declaration
public ArchiveColumnData AddOverlappingBoolColumn(string name, bool value, string tooltipHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Boolean |
value |
|
System.String |
tooltipHint |
|
Returns
AddOverlappingBoolColumn(String, Boolean, String, String)
Declaration
public ArchiveColumnData AddOverlappingBoolColumn(string name, bool value, string tooltipHint, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Boolean |
value |
|
System.String |
tooltipHint |
|
System.String |
linkHint |
|
Returns
AddOverlappingColumn(String)
Add a column, overwriting an existing column of the same name with the new value;
this overload sets a null value
Declaration
public ArchiveColumnData AddOverlappingColumn(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
Programmatic name
|
Returns
AddOverlappingColumn(String, ArchiveColumnData)
Add a column, overwriting an existing column of the same name with the new value - but only if the previous value is blank or null
Declaration
public ArchiveColumnData AddOverlappingColumn(string name, ArchiveColumnData data)
Parameters
Type |
Name |
Description |
System.String |
name |
Programmatic name
|
ArchiveColumnData |
data |
Data value
|
Returns
AddOverlappingColumn(String, String)
Add a column, overwriting an existing column of the same name with the new value;
this overload takes just a string display value
Declaration
public ArchiveColumnData AddOverlappingColumn(string name, string displayValue)
Parameters
Type |
Name |
Description |
System.String |
name |
Programmatic name
|
System.String |
displayValue |
Display value, as string
|
Returns
AddOverlappingColumn(String, String, String)
Add a column, overwriting an existing column of the same name with the new value;
this overload takes a string display value and a string tooltip hint
Declaration
public ArchiveColumnData AddOverlappingColumn(string name, string displayValue, string tooltipHint)
Parameters
Type |
Name |
Description |
System.String |
name |
Programmatic name
|
System.String |
displayValue |
Display value, as string
|
System.String |
tooltipHint |
Tooltip hint, as string
|
Returns
AddOverlappingColumn(String, String, String, String)
Add a column, overwriting an existing column of the same name with the new value;
this overload takes a string display value and a string tooltip hint
Declaration
public ArchiveColumnData AddOverlappingColumn(string name, string displayValue, string tooltipHint, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
name |
Programmatic name
|
System.String |
displayValue |
Display value, as string
|
System.String |
tooltipHint |
Tooltip hint, as string
|
System.String |
linkHint |
Link hint, as string
|
Returns
AddOverlappingDateTimeColumn(String, DateTime)
Declaration
public ArchiveColumnData AddOverlappingDateTimeColumn(string name, DateTime value)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.DateTime |
value |
|
Returns
AddOverlappingDateTimeColumn(String, DateTime, String)
Declaration
public ArchiveColumnData AddOverlappingDateTimeColumn(string name, DateTime value, string tooltipHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.DateTime |
value |
|
System.String |
tooltipHint |
|
Returns
AddOverlappingDateTimeColumn(String, DateTime, String, String)
Declaration
public ArchiveColumnData AddOverlappingDateTimeColumn(string name, DateTime value, string tooltipHint, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.DateTime |
value |
|
System.String |
tooltipHint |
|
System.String |
linkHint |
|
Returns
AddOverlappingDoubleColumn(String, Double)
Declaration
public ArchiveColumnData AddOverlappingDoubleColumn(string name, double value)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Double |
value |
|
Returns
AddOverlappingDoubleColumn(String, Double, String)
Declaration
public ArchiveColumnData AddOverlappingDoubleColumn(string name, double value, string tooltipHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Double |
value |
|
System.String |
tooltipHint |
|
Returns
AddOverlappingDoubleColumn(String, Double, String, String)
Declaration
public ArchiveColumnData AddOverlappingDoubleColumn(string name, double value, string tooltipHint, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Double |
value |
|
System.String |
tooltipHint |
|
System.String |
linkHint |
|
Returns
AddOverlappingIntColumn(String, Int32)
Declaration
public ArchiveColumnData AddOverlappingIntColumn(string name, int value)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Int32 |
value |
|
Returns
AddOverlappingIntColumn(String, Int32, String)
Declaration
public ArchiveColumnData AddOverlappingIntColumn(string name, int value, string tooltipHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Int32 |
value |
|
System.String |
tooltipHint |
|
Returns
AddOverlappingIntColumn(String, Int32, String, String)
Declaration
public ArchiveColumnData AddOverlappingIntColumn(string name, int value, string tooltipHint, string linkHint)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Int32 |
value |
|
System.String |
tooltipHint |
|
System.String |
linkHint |
|
Returns
AddOverlappingTimeSpanColumn(String, TimeSpan, String, String)
Declaration
public ArchiveColumnData AddOverlappingTimeSpanColumn(string name, TimeSpan value, string tooltipHint = "", string linkHint = "")
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.TimeSpan |
value |
|
System.String |
tooltipHint |
|
System.String |
linkHint |
|
Returns
AddParent(String, Int32)
Declaration
public void AddParent(string tableName, int primaryKey)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.Int32 |
primaryKey |
|
AddStyleHint(String)
Add a style hint; if a style hint already has been set, then add the new with an ampersand after the old.
Always make sure the style hints are in alphabetical order; a predictable order is needed to be sure we can correctly
match combinations in the style sheet.
Declaration
public void AddStyleHint(string styleHint)
Parameters
Type |
Name |
Description |
System.String |
styleHint |
Style hint to be added
|
Add a tooltip to a field in an archive row. The tooltip can be a literal and/or a {} style hint. It will
be added to the given column if that column either lacks a tooltip or has one of the same type. If the
column is missing, nothing bad happens. The added tooltip may be null or empty, causing nothing to happen.
Declaration
public void AddTooltipToField(string columnName, string tooltip)
Parameters
Type |
Name |
Description |
System.String |
columnName |
Name of column to add a tooltip to
|
System.String |
tooltip |
tooltip to add, may be null, empty, literal or a hint
|
AlignToTargetColumnSet(String[])
Align the content of this ArchiveRow with the given list of columns. Surplus columns are removed,
while missing columns are added with null data.
Declaration
public void AlignToTargetColumnSet(string[] completeColumnsList)
Parameters
Type |
Name |
Description |
System.String[] |
completeColumnsList |
List of columns the row is to contain
|
Clone()
Declaration
public ArchiveRow Clone()
Returns
Equals(ArchiveRow)
Checks if two archive rows are the same row. This will only do a simple check on row type and row key, as doing
extensive checks on all the data contained within the row would be too expensive, performance-wise.
Declaration
public bool Equals(ArchiveRow other)
Parameters
Returns
Type |
Description |
System.Boolean |
True if input is not null and matches row type and key, false if not.
|
GetBoolean(Int32)
Declaration
public bool GetBoolean(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
GetByte(Int32)
Declaration
public byte GetByte(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Byte |
|
GetBytes(Int32, Int64, Byte[], Int32, Int32)
Declaration
public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int64 |
fieldOffset |
|
System.Byte[] |
buffer |
|
System.Int32 |
bufferoffset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
GetChar(Int32)
Declaration
public char GetChar(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Char |
|
GetChars(Int32, Int64, Char[], Int32, Int32)
Declaration
public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int64 |
fieldoffset |
|
System.Char[] |
buffer |
|
System.Int32 |
bufferoffset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
GetData(Int32)
Declaration
public IDataReader GetData(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
GetDataTypeName(Int32)
Declaration
public string GetDataTypeName(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
GetDateTime(Int32)
Declaration
public DateTime GetDateTime(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.DateTime |
|
GetDecimal(Int32)
Declaration
public Decimal GetDecimal(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Decimal |
|
GetDisplayValue(String)
Get the display value for a given column ID. If the column does not
exist, an empty string (not null) is returned
Declaration
public string GetDisplayValue(string columnName)
Parameters
Type |
Name |
Description |
System.String |
columnName |
Column name, case-sensitive and must include any prefixes
|
Returns
Type |
Description |
System.String |
Display value if found, or an empty string
|
GetDouble(Int32)
Declaration
public double GetDouble(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Double |
|
GetFieldType(Int32)
Declaration
public Type GetFieldType(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Type |
|
GetFloat(Int32)
Declaration
public float GetFloat(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Single |
|
GetGuid(Int32)
Declaration
public Guid GetGuid(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Guid |
|
GetInt16(Int32)
Declaration
public short GetInt16(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int16 |
|
GetInt32(Int32)
Declaration
public int GetInt32(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int32 |
|
GetInt64(Int32)
Declaration
public long GetInt64(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int64 |
|
GetLinkHintValue(String)
Return a link hint by name
Declaration
public string GetLinkHintValue(string hintName)
Parameters
Type |
Name |
Description |
System.String |
hintName |
|
Returns
Type |
Description |
System.String |
|
GetName(Int32)
Declaration
public string GetName(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
GetOrdinal(String)
Declaration
public int GetOrdinal(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Int32 |
|
GetString(Int32)
Declaration
public string GetString(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
GetValue(Int32)
Declaration
public object GetValue(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Object |
|
GetValues(Object[])
Declaration
public int GetValues(object[] values)
Parameters
Type |
Name |
Description |
System.Object[] |
values |
|
Returns
Type |
Description |
System.Int32 |
|
HasLinkHint(String)
Check if link hint exists
Declaration
public bool HasLinkHint(string hintName)
Parameters
Type |
Name |
Description |
System.String |
hintName |
|
Returns
Type |
Description |
System.Boolean |
|
IsDBNull(Int32)
Declaration
public bool IsDBNull(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
PopulateFromBase(ArchiveRow, Boolean)
Declaration
public void PopulateFromBase(ArchiveRow baseRow, bool includeData)
Parameters
Type |
Name |
Description |
ArchiveRow |
baseRow |
|
System.Boolean |
includeData |
|
RemoveLinkHint(String)
Remove occurances of key from the linkHint.
Declaration
public void RemoveLinkHint(string key)
Parameters
Type |
Name |
Description |
System.String |
key |
The key to remove
|
RemoveStyleHint(String)
Remove a style hint if it was present, otherwise do nothing
Declaration
public void RemoveStyleHint(string removeHint)
Parameters
Type |
Name |
Description |
System.String |
removeHint |
Hint to remove
|
ReplaceLinkHint(String, String)
Declaration
public void ReplaceLinkHint(string linkKey, string linkValue)
Parameters
Type |
Name |
Description |
System.String |
linkKey |
|
System.String |
linkValue |
|
ToIdDictionary(ArchiveRow[])
Create a lookup dictionary of rows, based on their primary key. Note that there is no built-in guarantee that an arbitrary
collection/array of rows will have unique primary keys; if there are multiple entities then each one might have its
own key range.
Declaration
public static Dictionary<int, ArchiveRow> ToIdDictionary(ArchiveRow[] rows)
Parameters
Type |
Name |
Description |
ArchiveRow[] |
rows |
Rows to be converted to a dictionary
|
Returns
Type |
Description |
System.Collections.Generic.Dictionary<System.Int32, ArchiveRow> |
Dictionary indexed by primary key
|
ToIdDictionary(ICollection<ArchiveRow>)
Create a lookup dictionary of rows, based on their primary key. Note that there is no built-in guarantee that an arbitrary
collection/array of rows will have unique primary keys; if there are multiple entities then each one might have its
own key range.
Declaration
public static Dictionary<int, ArchiveRow> ToIdDictionary(ICollection<ArchiveRow> rows)
Parameters
Type |
Name |
Description |
System.Collections.Generic.ICollection<ArchiveRow> |
rows |
Rows to be converted to a dictionary
|
Returns
Type |
Description |
System.Collections.Generic.Dictionary<System.Int32, ArchiveRow> |
Dictionary indexed by primary key
|
ToString()
Returns a string representation of the values of this row, intended for debug display purposes (this is not
a complete serialization)
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Implements
System.Data.IDataRecord
System.IEquatable<>
Extension Methods
EnumUtil.MapEnums<From, To>(From)