Class TooltipPluginBase
Base class for tooltip provide plugins. This class contains some useful helper functions, and implements the Template Method pattern. Derived classes need to implement the InnerGetTooltip method, and can use the TryGetIntHint(string, out int) and similar methods to obtain values from the tooltip hint.
Inheritance
Inherited Members
Namespace: SuperOffice.CRM.Tooltips
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public abstract class TooltipPluginBase
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.Constructors
TooltipPluginBase()
Base class for tooltip provide plugins. This class contains some useful helper functions, and implements the Template Method pattern. Derived classes need to implement the InnerGetTooltip method, and can use the TryGetIntHint(string, out int) and similar methods to obtain values from the tooltip hint.
Declaration
protected TooltipPluginBase()
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.Fields
ImageHint
Base class for tooltip provide plugins. This class contains some useful helper functions, and implements the Template Method pattern. Derived classes need to implement the InnerGetTooltip method, and can use the TryGetIntHint(string, out int) and similar methods to obtain values from the tooltip hint.
Declaration
public const string ImageHint = "images"
Field Value
| Type | Description |
|---|---|
| string |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.SimpleHint
Base class for tooltip provide plugins. This class contains some useful helper functions, and implements the Template Method pattern. Derived classes need to implement the InnerGetTooltip method, and can use the TryGetIntHint(string, out int) and similar methods to obtain values from the tooltip hint.
Declaration
public const string SimpleHint = "simple"
Field Value
| Type | Description |
|---|---|
| string |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.UpdatedHint
Base class for tooltip provide plugins. This class contains some useful helper functions, and implements the Template Method pattern. Derived classes need to implement the InnerGetTooltip method, and can use the TryGetIntHint(string, out int) and similar methods to obtain values from the tooltip hint.
Declaration
public const string UpdatedHint = "updated"
Field Value
| Type | Description |
|---|---|
| string |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.Properties
Hints
The raw hints dictionary
Declaration
protected Dictionary<string, List<string>> Hints { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, List<string>> |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.WantImages
True if the hints dictionary contains the property 'images=true', or if there is no images property in the hint
Declaration
protected bool WantImages { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.WantSimple
True if the hints dictionary contains the property 'simple=true'
Declaration
protected bool WantSimple { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.WantUpdated
True if the hints dictionary contains the property 'updated=true', or if the property is missing. False if the hints dictionary contains the property 'updated=false'
Declaration
protected bool WantUpdated { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.Methods
FormatDescriptionText(string)
Remove blank lines from a string and make sure the length of the string does not exceed 256 characters. This method should be used to format the Text property of an entity like Appointment, Sale and Project, because the length of the text property is unlimited.
Declaration
protected static string FormatDescriptionText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | String to process |
Returns
| Type | Description |
|---|---|
| string | Result with no blank lines and maximum 256 characters long |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.GetRawValues(string)
Get raw hint values, based on the hint name
Declaration
protected List<string> GetRawValues(string hintName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | hintName | Hint key to look for |
Returns
| Type | Description |
|---|---|
| List<string> | List of raw values, or null if the hint did not exist |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.GetTooltipAsync(Dictionary<string, List<string>>, CancellationToken)
Implements the interface method; caches this hints and calls the inner method
Declaration
public Task<string> GetTooltipAsync(Dictionary<string, List<string>> hints, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, List<string>> | hints | Tooltip hints |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | Tooltip text, or string.Empty |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.InnerGetTooltipAsync(CancellationToken)
Subclass contract: derived class must implement their tooltip logicin this method.
Declaration
protected abstract Task<string> InnerGetTooltipAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | Tooltip text, or an empty string |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
MakeImageHint(string, int)
Utility method for creating an image hint with the correct syntax, from a key and id combination. This method will automatically take into account the WantImages property of the current instance.
Declaration
protected string MakeImageHint(string key, int id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | Key name, for instance person_id. This key must be something that is recognized by the image streaming service. |
| int | id | ID for the given key |
Returns
| Type | Description |
|---|---|
| string | Image hint |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.RemoveBlankLines(string)
Remove blank lines from a string, and convert \r\n to just \n. If the remainder of the string after processing is just \n, an empty string will be returned as the final result; otherwise we just remove single or multiple blank lines.
Declaration
protected static string RemoveBlankLines(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | String to process |
Returns
| Type | Description |
|---|---|
| string | Result with no blank lines |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.TryGetBoolHint(string, out bool)
Search the hints dictionary (this is an O(1) operation) for the given hint, and try to parse it as a bool. False is the result if the key is not found or has an invalid format. The return value is true if the hint is found and is parseable as a bool. Strings accepted are as for TryParse(string, out bool). If more than one hint of the same name exists, the value of the first one will be used.
Declaration
protected bool TryGetBoolHint(string hintName, out bool result)
Parameters
| Type | Name | Description |
|---|---|---|
| string | hintName | Hint key to look for |
| bool | result | Out: found value, or false |
Returns
| Type | Description |
|---|---|
| bool | True if the hint is found and is valid |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.TryGetDateHint(string, out DateTime)
Search the hints dictionary (this is an O(1) operation) for the given hint, and try to parse it as a datetime. DateTime.MinValue is the result if the key is not found or has an invalid format. The return value is true iff the hint is found and is parseable as a datetime. Both the invariant and current cultures are used, in that order. If more than one hint of the same name exists, the value of the first one will be used.
Declaration
protected bool TryGetDateHint(string hintName, out DateTime result)
Parameters
| Type | Name | Description |
|---|---|---|
| string | hintName | Hint key to look for |
| DateTime | result | Out: found value, or false |
Returns
| Type | Description |
|---|---|
| bool | True if the hint is found and is valid |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.TryGetIntHint(string, out int)
Search the hints dictionary (this is an O(1) operation) for the given hint, and try to parse it as an int. Zero is the result if the key is not found or has an invalid format. The return value is true iff the hint is found and is parseable as an int. Formats accepted are as for SuperOffice.Util.CultureDataFormatter.TryParse. If more than one hint of the same name exists, the value of the first one will be used.
Declaration
protected bool TryGetIntHint(string hintName, out int result)
Parameters
| Type | Name | Description |
|---|---|---|
| string | hintName | Hint key to look for |
| int | result | Out: found value, or 0 |
Returns
| Type | Description |
|---|---|
| bool | True if the hint is found and is valid |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.TryGetStringHint(string, out string)
Search the hints dictionary (this is an O(1) operation) for the given hint. The return value is true iff the hint is found. If more than one hint of the same name exists, the value of the first one will be used.
Declaration
protected bool TryGetStringHint(string hintName, out string result)
Parameters
| Type | Name | Description |
|---|---|---|
| string | hintName | Hint key to look for |
| string | result | Out: found value, or null |
Returns
| Type | Description |
|---|---|
| bool | True if the hint is found and is valid |
Remarks
The tooltip hints are accessible through the Hints property, but clients should usually find the provided access methods sufficient. TryGetIntHint(string, out int), TryGetStringHint(string, out string) and TryGetBoolHint(string, out bool) look for and parse the given type of key, and return a bool value that specifies whether the given key was found.
WantImages and WantSimple are boolean properties that give the result of a search for 'images=true' and 'simple=true', to promote a common way of specifying these two properties. The class implements the ITooltipProviderPlugin and thereby also the IPlugin interfaces. Derived classes need to be marked with the TooltipProviderPluginAttribute attribute, specifying a provider name (please prefix with your company to help make it unique and recognizable), and optionally a priority. The attribute is also used to register hint keys; the derived class will be called only for requests matching at least one key.