Class ArchiveRestrictionInfo
This class carries information about a restriction on the query of an archive provider
Implements
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoCore.dll
Syntax
public sealed class ArchiveRestrictionInfo : Object, ICloneable
Constructors
ArchiveRestrictionInfo()
Construct the object with blank values
Declaration
public ArchiveRestrictionInfo()
ArchiveRestrictionInfo(ArchiveColumnInfo, String, Boolean, String[])
This class carries information about a restriction on the query of an archive provider
Declaration
public ArchiveRestrictionInfo(ArchiveColumnInfo baseColumn, string oper, bool isActive, params string[] value)
Parameters
Type | Name | Description |
---|---|---|
ArchiveColumnInfo | baseColumn | |
String | oper | |
Boolean | isActive | |
String[] | value |
ArchiveRestrictionInfo(ArchiveColumnInfo, String, String[])
This class carries information about a restriction on the query of an archive provider
Declaration
public ArchiveRestrictionInfo(ArchiveColumnInfo baseColumn, string oper, params string[] value)
Parameters
Type | Name | Description |
---|---|---|
ArchiveColumnInfo | baseColumn | |
String | oper | |
String[] | value |
ArchiveRestrictionInfo(ArchiveRestrictionInfo)
This class carries information about a restriction on the query of an archive provider
Declaration
public ArchiveRestrictionInfo(ArchiveRestrictionInfo original)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo | original |
ArchiveRestrictionInfo(String)
Construct the object, setting basic items
Declaration
public ArchiveRestrictionInfo(string restriction)
Parameters
Type | Name | Description |
---|---|---|
String | restriction | Column name, operator and value. Ex: 'contact_id=2' |
ArchiveRestrictionInfo(String, String)
Construct the object, setting basic items
Declaration
public ArchiveRestrictionInfo(string name, string oper)
Parameters
Type | Name | Description |
---|---|---|
String | name | Column name, including any prefixes |
String | oper | Operator |
ArchiveRestrictionInfo(String, String, Int32[])
Construct the object, setting basic items and more than one value
Declaration
public ArchiveRestrictionInfo(string name, string oper, params int[] values)
Parameters
Type | Name | Description |
---|---|---|
String | name | Column name, including any prefixes |
String | oper | Operator |
Int32[] | values | Value, non-string values must be formatted using the invariant culture |
ArchiveRestrictionInfo(String, String, String)
Construct the object, setting basic items
Declaration
public ArchiveRestrictionInfo(string name, string oper, string value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Column name, including any prefixes |
String | oper | Operator |
String | value | Value, non-string values must be formatted using the invariant culture |
ArchiveRestrictionInfo(String, String, String[])
Construct the object, setting basic items and more than one value
Declaration
public ArchiveRestrictionInfo(string name, string oper, params string[] value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Column name, including any prefixes |
String | oper | Operator |
String[] | value | Value, non-string values must be formatted using the invariant culture |
Fields
MissingValueMarker
This class carries information about a restriction on the query of an archive provider
Declaration
public const string MissingValueMarker = "!novalue!"
Field Value
Type | Description |
---|---|
String |
MultiDisplayValueSeparator
This class carries information about a restriction on the query of an archive provider
Declaration
public const string MultiDisplayValueSeparator = " - "
Field Value
Type | Description |
---|---|
String |
MultiListDisplayValueSeparator
This class carries information about a restriction on the query of an archive provider
Declaration
public const string MultiListDisplayValueSeparator = "; "
Field Value
Type | Description |
---|---|
String |
UniqueKeyElementDelimiter
This class carries information about a restriction on the query of an archive provider
Declaration
public const string UniqueKeyElementDelimiter = "|"
Field Value
Type | Description |
---|---|
String |
Properties
ColumnInfo
Optional complete ArchiveColumnInfo for this restriction; in that case, ColumnInfo.Name == this.Name will always be true
Declaration
public ArchiveColumnInfo ColumnInfo { get; set; }
Property Value
Type | Description |
---|---|
ArchiveColumnInfo |
DisplayValues
Display representation of value(s) - list ID's are decoded to display texts, other values are represented in a format suitable for decoding and display through the CultureDataFormatter.
Declaration
public string[] DisplayValues { get; set; }
Property Value
Type | Description |
---|---|
String[] |
InterOperator
Get or set the inter-restriction operator that describes how this restriction is related to the next one in an array. Default for new ArchiveRestrictionInfo objects is And
Declaration
public InterRestrictionOperator InterOperator { get; set; }
Property Value
Type | Description |
---|---|
InterRestrictionOperator |
InterParenthesis
Get or set the parenthesis (if any) associated with this restriction. Positive values indicate a number of opening parentheses (deepening nesting level), while negative numbers indicate closing parentheses. Zero means no change in nesting level (no parentheses).
Declaration
public int InterParenthesis { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
IsActive
Is this restriction active? Inactive restrictions will not influence the generated query
Declaration
public bool IsActive { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Name
The programmatic column name, including any required prefixes
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
NumValues
Return the number of values of this restriction (subrestrictions not taken into account). A 'null' value array will return 0.
Declaration
public int NumValues { get; }
Property Value
Type | Description |
---|---|
Int32 |
Operator
The operator, such as =, etc
Declaration
public string Operator { get; set; }
Property Value
Type | Description |
---|---|
String |
ScalarDisplayValue
Readonly shortcut to DisplayValues[0] that will return the empty string if there are no values, or the zero'th element of the array if there is one
Declaration
public string ScalarDisplayValue { get; }
Property Value
Type | Description |
---|---|
String |
ScalarValue
Readonly shortcut to Values[0] that will return the empty string if there are no values, or the zero'th element of the array if there is one
Declaration
public string ScalarValue { get; }
Property Value
Type | Description |
---|---|
String |
SubRestrictions
Optional collection of sub criteria, usually null but set for Saint counter fields
Declaration
public ArchiveRestrictionInfo[] SubRestrictions { get; set; }
Property Value
Type | Description |
---|---|
ArchiveRestrictionInfo[] |
UniqueHash
This class carries information about a restriction on the query of an archive provider
Declaration
public int UniqueHash { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Values
Value(s) to test against
Declaration
public string[] Values { get; set; }
Property Value
Type | Description |
---|---|
String[] |
Methods
AddRestrictionIfMissing(ArchiveRestrictionInfo[], ArchiveRestrictionInfo)
Add an archive restriction if it is not already present in the array; otherwise do nothing
Declaration
public static ArchiveRestrictionInfo[] AddRestrictionIfMissing(ArchiveRestrictionInfo[] restrictions, ArchiveRestrictionInfo addIfMissing)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictions | Restrictions to look in, returned unchanged if desired restriction is already present |
ArchiveRestrictionInfo | addIfMissing | Restrictions to add if not already there |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Restrictions, guaranteed to contain the addifMissing restriction (plus all other restrictions originally there) |
AddSubRestriction(ArchiveRestrictionInfo)
Add another subrestriction at the end of the current collection of restrictions.
Declaration
public void AddSubRestriction(ArchiveRestrictionInfo subRestriction)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo | subRestriction |
AddValue(String[])
Add another value at the end of the current collection of values
Declaration
public void AddValue(params string[] newValue)
Parameters
Type | Name | Description |
---|---|---|
String[] | newValue | Value to add |
Clone()
This class carries information about a restriction on the query of an archive provider
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object |
EliminateEmptyValueRestrictions(ArchiveRestrictionInfo[], Boolean)
Scan through an array of restrictions, and remove those that have a null or empty value array. Note that having a single value element that itself is null or the empty string is something different, such restrictions will be eliminated only if so requested. The return value is a copy, the original is not touched.
Declaration
public static ArchiveRestrictionInfo[] EliminateEmptyValueRestrictions(ArchiveRestrictionInfo[] restrictions, bool eliminateEmptyString)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictions | Array of restrictions to scan |
Boolean | eliminateEmptyString | If true, consider empty strings to be 'no value', and eliminate restrictions that have exatcly one empty string, as if they had no value at all |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Copy of input, containing only those restrictions that had non-null and non-empty value arrays |
EnforceNumValues(Int32)
Enforce exactly or at least a certain number of values; an exception is thrown if there are too few or too many
Declaration
public void EnforceNumValues(int requiredValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | requiredValues | Positive number: Require exactly this number of values. Negative number: Require at least the number of values of the absolute value of this parameter |
EnforceUniqueIdRestriction(String, ArchiveRestrictionInfo[], String)
Scan the given restriction array, look for a given restriction, and throw an exception if it is not present or not of type unique id (operator equals or =).
Declaration
public static void EnforceUniqueIdRestriction(string restrictionName, ArchiveRestrictionInfo[] restrictions, string exceptionText)
Parameters
Type | Name | Description |
---|---|---|
String | restrictionName | Restriction to look for |
ArchiveRestrictionInfo[] | restrictions | Restrictions to look in |
String | exceptionText | Exception text to use if the unique id restriction is not there |
ExtractAndDropRestriction(String, ref ArchiveRestrictionInfo[])
This class carries information about a restriction on the query of an archive provider
Declaration
public static ArchiveRestrictionInfo ExtractAndDropRestriction(string findRestriction, ref ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
String | findRestriction | |
ArchiveRestrictionInfo[] | restrictions |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo |
ExtractRestriction(String, ArchiveRestrictionInfo[])
Scan the restriction array and return the given restriction if found; otherwise return null
Declaration
public static ArchiveRestrictionInfo ExtractRestriction(string findRestriction, ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
String | findRestriction | Name of restriction to look for |
ArchiveRestrictionInfo[] | restrictions | Restrictions to look in |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | Found restriction, or null |
ExtractRestrictionsByBaseName(String, ArchiveRestrictionInfo[])
Scan the restriction array and return all instances of the desired restriction. All comparisons are base name to base name, case insensitive.
Declaration
public static ArchiveRestrictionInfo[] ExtractRestrictionsByBaseName(string restrictionName, ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
String | restrictionName | Restriction to search for, only base name will be used |
ArchiveRestrictionInfo[] | restrictions | Restrictions to search, only base names will be used |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Array of matching restrictions, or an empty array (never null) |
Remarks
The ExtractRestriction(String, ArchiveRestrictionInfo[]) method performs a case-insensitive exact match search - so that looking for source/contactRestrictionId would NOT match targe/contactRestrictionId. Here, only base names are used, so there would be a match. However, it's not a simple substring search, so that source/restrictionContactId will not match contactId.
FilterInactive(ArchiveRestrictionInfo[])
Take an array of restrictions and return a shallow copy that contains only active restrictions
Declaration
public static ArchiveRestrictionInfo[] FilterInactive(ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictions | Restriction array to filter |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Copy of array, referring to the same elements, but only those that have IsActive set to true. |
FromSoListRestriction(String)
Create a new archive restriction info object based on a string made by ToSoListRestriction()
Declaration
public static ArchiveRestrictionInfo FromSoListRestriction(string soListRestriction)
Parameters
Type | Name | Description |
---|---|---|
String | soListRestriction |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo |
GetAllRowsRestrictionInfo()
Returns a new ArchiveRestrictionInfo which tell the provider to return all rows.
Declaration
public static ArchiveRestrictionInfo GetAllRowsRestrictionInfo()
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | ArchiveRestrictionInfo with the getAllRows restriction. |
GetBaseNameFromComplexName(String)
Extract the base name from a (possibly) complex name (which involves subrestrictions)
Declaration
public static string GetBaseNameFromComplexName(string uniqueKey)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueKey |
Returns
Type | Description |
---|---|
String |
GetBoolValue(Int32)
Get a value as a boolean. Uses bool.TryParse(String, Boolean), but also accepts integer values through CultureDataFormatter.ParseEncodedInt(String) to do the parsing. Returns 0 if the value array is empty, regardless of index.
Declaration
public bool GetBoolValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of value to return |
Returns
Type | Description |
---|---|
Boolean | Bool value |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if the index is out of range, except if the value array is empty |
GetBoolValueArray()
Get an array of boolean values - assumes that the values array is of a homogenous type. Uses bool.TryParse(String, Boolean), but also accepts integer values through CultureDataFormatter.ParseEncodedInt(String) to do the parsing. Returns an empty array if the values array is empty or null, or if the values array contains one element and that element is null or the empty string.
Declaration
public bool[] GetBoolValueArray()
Returns
Type | Description |
---|---|
Boolean[] | Array of values |
GetComplexName()
Create a string that will uniquely identify a restriction. For simple restrictions this is the name; if there are sub-restrictions, their names and values will be part of the key (needed for Saint searches, where the same basic restriction may be repeated with different sub restrictions).
Declaration
public string GetComplexName()
Returns
Type | Description |
---|---|
String | String that will uniquely identify the restriction. |
GetConcatenatedDisplayValue()
Get a concatenated display value that contains all actual values separated by the correct multi-value separator, taking into account the restriction value type
Declaration
public string GetConcatenatedDisplayValue()
Returns
Type | Description |
---|---|
String |
GetDateTimeValue(Int32)
Get a value as a DateTime. Uses CultureDataFormatter.ParseEncodedDate(String) to do the parsing. Returns DateTime.MinValue if the value array is empty, regardless of index.
Declaration
public DateTime GetDateTimeValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of value to return |
Returns
Type | Description |
---|---|
DateTime | Integer value |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if the index is out of range, except if the value array is empty |
GetDateTimeValueArray()
Get an array of datetime values - assumes that the values array is of a homogenous type. Uses CultureDataFormatter.ParseEncodedDate(String) to do the parsing. Returns an empty array if the values array is empty or null, or if the values array contains one element and that element is null or the empty string.
Declaration
public DateTime[] GetDateTimeValueArray()
Returns
Type | Description |
---|---|
DateTime[] | Array of values |
GetDoubleValue(Int32)
Get a value as a double. Uses CultureDataFormatter.ParseEncodedDouble(String) to do the parsing. Returns 0.0 if the value array is empty, regardless of index.
Declaration
public double GetDoubleValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of value to return |
Returns
Type | Description |
---|---|
Double | Double value |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if the index is out of range, except if the value array is empty |
GetDoubleValueArray()
Get an array of double values - assumes that the values array is of a homogenous type. Uses CultureDataFormatter.ParseEncodedDouble(String) to do the parsing. Returns an empty array if the values array is empty or null, or if the values array contains one element and that element is null or the empty string.
Declaration
public double[] GetDoubleValueArray()
Returns
Type | Description |
---|---|
Double[] | Array of values |
GetIntValue(Int32)
Get a value as an integer. Uses CultureDataFormatter.ParseEncodedInt(String) to do the parsing. Returns 0 if the value array is empty, regardless of index.
Declaration
public int GetIntValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of value to return |
Returns
Type | Description |
---|---|
Int32 | Integer value |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if the index is out of range, except if the value array is empty |
GetIntValueArray()
Get an array of integer values - assumes that the values array is of a homogenous type. Uses CultureDataFormatter.ParseEncodedInt(String) to do the parsing. Returns an empty array if the values array is empty or null, or if the values array contains one element and that element is null or the empty string.
Declaration
public int[] GetIntValueArray()
Returns
Type | Description |
---|---|
Int32[] | Array of values |
GetMultiValueSeparator(String)
Get the oppropriate separator between multiple display values, based on restriction type
Declaration
public static string GetMultiValueSeparator(string restrictionType)
Parameters
Type | Name | Description |
---|---|---|
String | restrictionType | Type of restriction |
Returns
Type | Description |
---|---|
String | Value separator |
GetNoRowsRestrictionInfo()
Returns a new ArchiveRestrictionInfo which tell the provider not to return any rows.
Declaration
public static ArchiveRestrictionInfo GetNoRowsRestrictionInfo()
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | ArchiveRestrictionInfo with the getNoRows restriction. |
GetSubRestriction(String)
Get a named subrestriction from this restriction
Declaration
public ArchiveRestrictionInfo GetSubRestriction(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Case-insensivite nameof subrestriction |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | Subrestriction if found, or null |
GetUniqueIdRestriction(String, ArchiveRestrictionInfo[], String)
Scan the given restriction array to find the given restriction; require it to have an equals or = operator; parse the single scalar value as an int and return it. This is a very common case, where a restriction on a single id is used.
Declaration
public static int GetUniqueIdRestriction(string restrictionName, ArchiveRestrictionInfo[] restrictions, string exceptionText)
Parameters
Type | Name | Description |
---|---|---|
String | restrictionName | Case-insensitive name of restriction to find |
ArchiveRestrictionInfo[] | restrictions | Array of restrictions to scan |
String | exceptionText | Text for exception if the restriction does not exist. If this parameter is null, then no exception will be thrown and the integer value 0 will be returned instead |
Returns
Type | Description |
---|---|
Int32 | Integer value if found, or either 0 or an exception if not found, depending on the exceptiontext parameter |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if the restriction does not exist, using the given text |
GetUniqueRestrictionKey()
Get the unique restriction key - really unique, and no longer related to the name of the restriction
Declaration
public int GetUniqueRestrictionKey()
Returns
Type | Description |
---|---|
Int32 |
PatchRestrictionArray(Boolean, ArchiveRestrictionInfo[], ArchiveRestrictionInfo[])
Take an array of restrictions, and patch in one or more replacements. Such replacements will be added if they are not already there, and will REPLACE any existing restrictions with the same keys. The returned array is always a copy of the original, which is not touched.
Declaration
public static ArchiveRestrictionInfo[] PatchRestrictionArray(bool dropIfNoValues, ArchiveRestrictionInfo[] original, params ArchiveRestrictionInfo[] toBeReplaced)
Parameters
Type | Name | Description |
---|---|---|
Boolean | dropIfNoValues | |
ArchiveRestrictionInfo[] | original | Original set of restrictions, will not be changed |
ArchiveRestrictionInfo[] | toBeReplaced | Restrictions that will override existing ones with the same key |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Original restrictions, with the replacements patched in |
PrefixRestrictions(IEnumerable<ArchiveRestrictionInfo>, String)
Prefix each restriction in a collection with a certain name prefix, according to the standard prefix rules
Declaration
public static void PrefixRestrictions(IEnumerable<ArchiveRestrictionInfo> restrictions, string prefix)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ArchiveRestrictionInfo> | restrictions | |
String | prefix |
SetIntValue(Int32)
Set the value to be a single integer; any previous value(s) are lost
Declaration
public void SetIntValue(int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value | integer value to set |
SetIntValueArray(Int32[])
Set the value to be the given array of integers; any previous value(s) are lost
Declaration
public void SetIntValueArray(int[] values)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | values | Arrayof integers to set |
SetRecursiveActive(Boolean)
Set the IsActive flag for the restriction, and propagate into all subrestrictions as well
Declaration
public void SetRecursiveActive(bool isActive)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isActive | New value for isActive flag |
SetValue(String[])
Set the given value as the current collection of values; this method is here because of the params notation, otherwise it is equivalent to simply setting the Values property
Declaration
public void SetValue(params string[] newValue)
Parameters
Type | Name | Description |
---|---|---|
String[] | newValue | Value to add |
ToKeyArray(ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a int array containing the names only
Declaration
public static int[] ToKeyArray(params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictionInfos | Column infos to extract names from |
Returns
Type | Description |
---|---|
Int32[] | Array of names, in original order |
ToKeyArray(List<ArchiveRestrictionInfo>)
Utility method to convert a list of ArchiveRestrictionInfo into a int array containing the names only
Declaration
public static int[] ToKeyArray(List<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
List<ArchiveRestrictionInfo> | restrictionInfos | Column infos to extract names from |
Returns
Type | Description |
---|---|
Int32[] | Array of names, in original order |
ToKeyArray(Predicate<ArchiveRestrictionInfo>, ArchiveRestrictionInfo[])
Utility method to conditionally convert an array of ArchiveRestrictionInfo into a int array containing the names only. The given predicate is applied to each ArchiveRestrictionInfo to determine if its name should be included in the result.
Declaration
public static int[] ToKeyArray(Predicate<ArchiveRestrictionInfo> condition, params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ArchiveRestrictionInfo[] | restrictionInfos | Column infos to test and extract the name from |
Returns
Type | Description |
---|---|
Int32[] | Array of names of column infos that were chosen, in original order |
ToKeyArray(Predicate<ArchiveRestrictionInfo>, List<ArchiveRestrictionInfo>)
Utility method to conditionally convert a list of ArchiveRestrictionInfo into a int array containing the names only. The given predicate is applied to each ArchiveRestrictionInfo to determine if its name should be included in the result.
Declaration
public static int[] ToKeyArray(Predicate<ArchiveRestrictionInfo> condition, List<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
List<ArchiveRestrictionInfo> | restrictionInfos | Column infos to test and extract the name from |
Returns
Type | Description |
---|---|
Int32[] | Array of names of column infos that were chosen, in original order |
ToKeyDictionary(ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<int, ArchiveRestrictionInfo> ToKeyDictionary(params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<Int32, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToKeyDictionary(ICollection<ArchiveRestrictionInfo>)
Utility method to convert a collection of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<int, ArchiveRestrictionInfo> ToKeyDictionary(ICollection<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ICollection<ArchiveRestrictionInfo> | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<Int32, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToKeyDictionary(Predicate<ArchiveRestrictionInfo>, ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<int, ArchiveRestrictionInfo> ToKeyDictionary(Predicate<ArchiveRestrictionInfo> condition, params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ArchiveRestrictionInfo[] | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<Int32, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToKeyDictionary(Predicate<ArchiveRestrictionInfo>, ICollection<ArchiveRestrictionInfo>)
Utility method to conditionally convert a collection of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<int, ArchiveRestrictionInfo> ToKeyDictionary(Predicate<ArchiveRestrictionInfo> condition, ICollection<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ICollection<ArchiveRestrictionInfo> | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<Int32, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToNameArray(ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a string array containing the names only
Declaration
public static string[] ToNameArray(params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictionInfos | Column infos to extract names from |
Returns
Type | Description |
---|---|
String[] | Array of names, in original order |
ToNameArray(List<ArchiveRestrictionInfo>)
Utility method to convert a list of ArchiveRestrictionInfo into a string array containing the names only
Declaration
public static string[] ToNameArray(List<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
List<ArchiveRestrictionInfo> | restrictionInfos | Column infos to extract names from |
Returns
Type | Description |
---|---|
String[] | Array of names, in original order |
ToNameArray(Predicate<ArchiveRestrictionInfo>, ArchiveRestrictionInfo[])
Utility method to conditionally convert an array of ArchiveRestrictionInfo into a string array containing the names only. The given predicate is applied to each ArchiveRestrictionInfo to determine if its name should be included in the result.
Declaration
public static string[] ToNameArray(Predicate<ArchiveRestrictionInfo> condition, params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ArchiveRestrictionInfo[] | restrictionInfos | Column infos to test and extract the name from |
Returns
Type | Description |
---|---|
String[] | Array of names of column infos that were chosen, in original order |
ToNameArray(Predicate<ArchiveRestrictionInfo>, List<ArchiveRestrictionInfo>)
Utility method to conditionally convert a list of ArchiveRestrictionInfo into a string array containing the names only. The given predicate is applied to each ArchiveRestrictionInfo to determine if its name should be included in the result.
Declaration
public static string[] ToNameArray(Predicate<ArchiveRestrictionInfo> condition, List<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
List<ArchiveRestrictionInfo> | restrictionInfos | Column infos to test and extract the name from |
Returns
Type | Description |
---|---|
String[] | Array of names of column infos that were chosen, in original order |
ToNameDictionary(ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<string, ArchiveRestrictionInfo> ToNameDictionary(params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<String, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToNameDictionary(ICollection<ArchiveRestrictionInfo>)
Utility method to convert a collection of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<string, ArchiveRestrictionInfo> ToNameDictionary(ICollection<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
ICollection<ArchiveRestrictionInfo> | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<String, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToNameDictionary(Predicate<ArchiveRestrictionInfo>, ArchiveRestrictionInfo[])
Utility method to convert an array of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<string, ArchiveRestrictionInfo> ToNameDictionary(Predicate<ArchiveRestrictionInfo> condition, params ArchiveRestrictionInfo[] restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ArchiveRestrictionInfo[] | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<String, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToNameDictionary(Predicate<ArchiveRestrictionInfo>, ICollection<ArchiveRestrictionInfo>)
Utility method to conditionally convert a collection of ArchiveRestrictionInfo into a dictionary keyed by the restriction unique identifier (see GetUniqueRestrictionKey() for how such an identifier is created). The values of the dictionary will be the restriction info objects.
Declaration
public static Dictionary<string, ArchiveRestrictionInfo> ToNameDictionary(Predicate<ArchiveRestrictionInfo> condition, ICollection<ArchiveRestrictionInfo> restrictionInfos)
Parameters
Type | Name | Description |
---|---|---|
Predicate<ArchiveRestrictionInfo> | condition | Predicate that takes an ArchiveRestrictionInfo and returns a bool. A value of true indicates that that particular ArchiveRestrictionInfo should be included in the result. |
ICollection<ArchiveRestrictionInfo> | restrictionInfos | Restriction infos to extract names from |
Returns
Type | Description |
---|---|
Dictionary<String, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToSoListRestriction()
Convert this restrictionInfo instance into a syntax understood by the SoList providers that represent archives
Declaration
public string ToSoListRestriction()
Returns
Type | Description |
---|---|
String |
ToString()
Return a string representation, suitable for debugging
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
ToString(String)
This class carries information about a restriction on the query of an archive provider
Declaration
public string ToString(string prefix)
Parameters
Type | Name | Description |
---|---|---|
String | prefix |
Returns
Type | Description |
---|---|
String |
TransformSpecialOperators(String)
A few operators have dual names - such as equals, which has the synonym '='. Sometimes we need to avoid using the synonyms, which may match special separators or other elements with semantic meanings. See hard coding in the constructor of this class as well.
Declaration
public static string TransformSpecialOperators(string operatorName)
Parameters
Type | Name | Description |
---|---|---|
String | operatorName | Operator name, either primary or synonym |
Returns
Type | Description |
---|---|
String | Primary operator name |