Class TooltipProvider
The one-stop shop for asynchronous tooltips. This class takes a tooltip hint and through the static GetTooltip(String) method converts it into a tooltip. The underlying tooltip providers are dynamically loaded plugins.
Due to the possibility of fairly expensive operations behind the tooltip, this system SHOULD NOT be used to mass-produce tooltips in some tight loop. Call the tooltip provider only when you know that the user actually needs a tooltip here and now.Namespace: SuperOffice.CRM.Tooltips
Assembly: SoDataBase.dll
Syntax
public static class TooltipProvider : Object
Remarks
Tooltip plugin providers must implement the SuperOffice.CRM.Tooltips.ITooltipProviderPlugin interface, and are welcome to use the TooltipPluginBase base class as well.
string myTooltip = TooltipProvider.GetTooltip("{contact_id=" + myContactId + "}");
Methods
GetTooltip(String)
Process the incoming hint, and return a tooltip. The tooltip is either a parseable tooltip hint, or a literal text.
Declaration
public static string GetTooltip(string tooltipHint)
Parameters
Type | Name | Description |
---|---|---|
String | tooltipHint | Tooltip hint, or literal text |
Returns
Type | Description |
---|---|
String | Formatted tooltip, possibly including image tags or other metainformation |
Remarks
If it is a literal, it may be formatted according to current tooltip rules, and is then returned. A tooltip hint has the syntax {<id>=<value>[<id>=<value>]...}, ie., curly braces around the whole string, and one or more id/value pairs. The delimiter within each pair is an equals sign, and the delimiter between pairs is an ampersand. A typical hint is {contact_id=5}. Another possible hint would be {contact_id=123&simple=true}.
Id's are case-insensitive, using the OrdinalIgnoreCase comparer provided by the .NET framework.GetTooltipHintValue(String)
Get the inner value of a dynamic tooltip hint - or nothing, if the tooltip is not a dynamic hint. Dynamic hints are delimited by braces and contain at least one name value pair.
Declaration
public static string GetTooltipHintValue(string delimitedHint)
Parameters
Type | Name | Description |
---|---|---|
String | delimitedHint | Tooltip hint, including the braces |
Returns
Type | Description |
---|---|
String | Tooltip hint minus the braces, or string.Empty if no braces were present (then this is not a dynamic hint at all) |
Remarks
Tooltip plugin providers must implement the SuperOffice.CRM.Tooltips.ITooltipProviderPlugin interface, and are welcome to use the TooltipPluginBase base class as well.
string myTooltip = TooltipProvider.GetTooltip("{contact_id=" + myContactId + "}");
MakeImageHint(String, Int32, Boolean)
Utility method for creating an image hint with the correct syntax, from a key and id combination. If you are programming something that is derived from TooltipPluginBase, using the MakeImageHint(String, Int32) is somewhat simpler than using this method.
Declaration
public static string MakeImageHint(string key, int id, bool wantImage)
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. |
Int32 | id | ID for the given key |
Boolean | wantImage | Should the image hint be created; if false, an empty string will be returned |
Returns
Type | Description |
---|---|
String | Image hint |
Remarks
Tooltip plugin providers must implement the SuperOffice.CRM.Tooltips.ITooltipProviderPlugin interface, and are welcome to use the TooltipPluginBase base class as well.
string myTooltip = TooltipProvider.GetTooltip("{contact_id=" + myContactId + "}");
MakeTooltipHint(String)
Utility method for creating a tooltip hint with the correct syntax, from a single key and single value
Declaration
public static string MakeTooltipHint(string keyAndValue)
Parameters
Type | Name | Description |
---|---|---|
String | keyAndValue | Key and value with an equals sign as the delimiter |
Returns
Type | Description |
---|---|
String | Tooltip hint |
Remarks
Tooltip plugin providers must implement the SuperOffice.CRM.Tooltips.ITooltipProviderPlugin interface, and are welcome to use the TooltipPluginBase base class as well.
string myTooltip = TooltipProvider.GetTooltip("{contact_id=" + myContactId + "}");
MakeTooltipHint(String, Int32)
Utility method for creating a tooltip hint with the correct syntax, from a single key and single value
Declaration
public static string MakeTooltipHint(string key, int value)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key name |
Int32 | value | Key value |
Returns
Type | Description |
---|---|
String | Tooltip hint |
Remarks
Tooltip plugin providers must implement the SuperOffice.CRM.Tooltips.ITooltipProviderPlugin interface, and are welcome to use the TooltipPluginBase base class as well.
string myTooltip = TooltipProvider.GetTooltip("{contact_id=" + myContactId + "}");