Class ArchiveRestrictionInfo
This class carries information about a restriction on the query of an archive provider
Implements
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoCore.dll
Syntax
[DataContract(Namespace = "http://www.superoffice.net/ws/crm/NetServer/11.7.0.0")]
public sealed class ArchiveRestrictionInfo : ICloneable
Constructors
ArchiveRestrictionInfo()
Construct the object with blank values
Declaration
public ArchiveRestrictionInfo()
ArchiveRestrictionInfo(ArchiveColumnInfo, string, bool, params 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 | |
| bool | isActive | |
| string[] | value |
ArchiveRestrictionInfo(ArchiveColumnInfo, string, params 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, params int[])
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 |
| int[] | 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, params 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
[DataMember]
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
[DataMember]
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
[DataMember]
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
[DataMember]
public int InterParenthesis { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
IsActive
Is this restriction active? Inactive restrictions will not influence the generated query
Declaration
[DataMember]
public bool IsActive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Name
The programmatic column name, including any required prefixes
Declaration
[DataMember]
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 |
|---|---|
| int |
Operator
The operator, such as =, etc
Declaration
[DataMember]
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
[DataMember]
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
[DataMember]
public int UniqueHash { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Values
Value(s) to test against
Declaration
[DataMember]
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(params 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[], bool)
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 |
| bool | 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(int)
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 |
|---|---|---|
| int | 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(int)
Get a value as a boolean. Uses bool.TryParse(string, out bool), 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 |
|---|---|---|
| int | index | Index of value to return |
Returns
| Type | Description |
|---|---|
| bool | 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, out bool), 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 |
|---|---|
| bool[] | 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(int)
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 |
|---|---|---|
| int | 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(int)
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 |
|---|---|---|
| int | 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(int)
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 |
|---|---|---|
| int | index | Index of value to return |
Returns
| Type | Description |
|---|---|
| int | 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 |
|---|---|
| int[] | 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 |
|---|---|
| int | 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 |
|---|---|
| int |
PatchRestrictionArray(bool, ArchiveRestrictionInfo[], params 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 |
|---|---|---|
| bool | 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(int)
Set the value to be a single integer; any previous value(s) are lost
Declaration
public void SetIntValue(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | integer value to set |
SetIntValueArray(int[])
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 |
|---|---|---|
| int[] | values | Arrayof integers to set |
SetRecursiveActive(bool)
Set the IsActive flag for the restriction, and propagate into all subrestrictions as well
Declaration
public void SetRecursiveActive(bool isActive)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isActive | New value for isActive flag |
SetValue(params 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(params 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 |
|---|---|
| int[] | 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 |
|---|---|
| int[] | Array of names, in original order |
ToKeyArray(Predicate<ArchiveRestrictionInfo>, params 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 |
|---|---|
| int[] | 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 |
|---|---|
| int[] | Array of names of column infos that were chosen, in original order |
ToKeyDictionary(params 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<int, 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<int, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToKeyDictionary(Predicate<ArchiveRestrictionInfo>, params 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<int, 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<int, ArchiveRestrictionInfo> | Dictionary of key/restriction pairs |
ToNameArray(params 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>, params 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(params 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>, params 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 |
Overrides
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 |