Micro Focus Content Manager SDK 10.1
TRIM.SDK.TrimApplicationBase Class Reference
Inheritance diagram for TRIM.SDK.TrimApplicationBase:
TRIM.SDK.TrimApplication

Classes

class  DummyFinalizer
 

Static Public Member Functions

static void Initialize ()
 Initializes the SDK, by explicitly loading native binaries. Once Initialize() returns successfully, subsequent calls to Initialize() have no effect. If Initialize() is not called by the application, it will be called implicitly by the SDK, when the first native-backed SDK method is called. More...
 
static void DiagnoseDllLoading (string binariesDir="", string systemDir="C:\\Windows\\System32")
 Diagnoses DLL dependency issues when loading the SDK. Loads known dependencies one by one to determine if any are missing. Any loading errors are written to the console. More...
 
static void EnableSdkLeakTracking (bool enable)
 Enables or disables SDK leak tracking. If leak tracking is enabled, stack traces are collected upon the creation of each Database. If the leak tracker subsequently detects that one of these objects is being disposed by the garbage collector, rather than through explicit disposal, an error will be logged to the Windows Application event log. Such an error will only be logged once. More...
 
static int GetSdkLeakCount ()
 Gets the current number of SDK leaks. Requires SDK leak tracking to be enabled. More...
 
static List< string > GetSdkLeakStackTraces ()
 Gets the current list of SDK leaks. Requires SDK leak tracking to be enabled. More...
 
static int GetSdkObjectCount ()
 Gets the current number of SDK objects that have not yet been disposed. More...
 
static long ToErrorCode (MessageIds msgId)
 Converts the error message enumeration value to an ErrorCode that is used by the TRIMSDK TrimException class. More...
 
static string GetMessage (MessageIds msgId)
 Retrieves a message with the specified message id from the TRIM Messages database. More...
 
static string GetMessage (MessageIds msgId, string substPercent1)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message. More...
 
static string GetMessage (MessageIds msgId, string substPercent1, string substPercent2)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message. More...
 
static string GetMessage (MessageIds msgId, string[] substPercentStrings)
 Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported. More...
 
static string GetMessage (Database db, MessageIds msgId)
 Retrieves a message with the specified message id from the TRIM Messages database. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string substPercent1)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string substPercent1, string substPercent2)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string[] substPercentStrings)
 Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static void WriteToSdkLog (string msg)
 Write a message to the Content Manager client log. Requires SDK logging to be enabled in the client log settings. More...
 

Properties

static string TrimBinariesLoadPath [get, set]
 Set TrimBinariesLoadPath, to force the SDK to load native binaries from a particular path. This will override the searching logic that the SDK would otherwise apply. More...
 
static bool HasBeenInitialized [get]
 

Member Function Documentation

◆ DiagnoseDllLoading()

static void TRIM.SDK.TrimApplicationBase.DiagnoseDllLoading ( string  binariesDir = "",
string  systemDir = "C:\\Windows\\System32" 
)
static

Diagnoses DLL dependency issues when loading the SDK. Loads known dependencies one by one to determine if any are missing. Any loading errors are written to the console.

Parameters
binariesDirDirectory from which to load Content Manager binaries. Leave blank to use the directory from which TRIM.SDK.dll was loaded.
systemDirDirectory from which to load Windows system DLL's. Defaults to "C:\Windows\System32".

◆ EnableSdkLeakTracking()

static void TRIM.SDK.TrimApplicationBase.EnableSdkLeakTracking ( bool  enable)
static

Enables or disables SDK leak tracking. If leak tracking is enabled, stack traces are collected upon the creation of each Database. If the leak tracker subsequently detects that one of these objects is being disposed by the garbage collector, rather than through explicit disposal, an error will be logged to the Windows Application event log. Such an error will only be logged once.

If leak tracking is enabled, SDK applications can also manually check for leaks by calling GetSdkLeakCount() and GetSdkLeakStackTraces() at arbitrary points in the application.

◆ GetMessage() [1/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( Database  db,
MessageIds  msgId 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database.

◆ GetMessage() [2/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( Database  db,
MessageIds  msgId,
string  substPercent1 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database.

◆ GetMessage() [3/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( Database  db,
MessageIds  msgId,
string  substPercent1,
string  substPercent2 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database.

◆ GetMessage() [4/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( Database  db,
MessageIds  msgId,
string[]  substPercentStrings 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database.

◆ GetMessage() [5/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( MessageIds  msgId)
static

Retrieves a message with the specified message id from the TRIM Messages database.

◆ GetMessage() [6/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( MessageIds  msgId,
string  substPercent1 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message.

◆ GetMessage() [7/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( MessageIds  msgId,
string  substPercent1,
string  substPercent2 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message.

◆ GetMessage() [8/8]

static string TRIM.SDK.TrimApplicationBase.GetMessage ( MessageIds  msgId,
string[]  substPercentStrings 
)
static

Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported.

◆ GetSdkLeakCount()

static int TRIM.SDK.TrimApplicationBase.GetSdkLeakCount ( )
static

Gets the current number of SDK leaks. Requires SDK leak tracking to be enabled.

◆ GetSdkLeakStackTraces()

static List<string> TRIM.SDK.TrimApplicationBase.GetSdkLeakStackTraces ( )
static

Gets the current list of SDK leaks. Requires SDK leak tracking to be enabled.

Returns

◆ GetSdkObjectCount()

static int TRIM.SDK.TrimApplicationBase.GetSdkObjectCount ( )
static

Gets the current number of SDK objects that have not yet been disposed.

◆ Initialize()

static void TRIM.SDK.TrimApplicationBase.Initialize ( )
static

Initializes the SDK, by explicitly loading native binaries. Once Initialize() returns successfully, subsequent calls to Initialize() have no effect. If Initialize() is not called by the application, it will be called implicitly by the SDK, when the first native-backed SDK method is called.

◆ ToErrorCode()

static long TRIM.SDK.TrimApplicationBase.ToErrorCode ( MessageIds  msgId)
static

Converts the error message enumeration value to an ErrorCode that is used by the TRIMSDK TrimException class.

◆ WriteToSdkLog()

static void TRIM.SDK.TrimApplicationBase.WriteToSdkLog ( string  msg)
static

Write a message to the Content Manager client log. Requires SDK logging to be enabled in the client log settings.

Property Documentation

◆ HasBeenInitialized

bool TRIM.SDK.TrimApplicationBase.HasBeenInitialized
staticget

◆ TrimBinariesLoadPath

string TRIM.SDK.TrimApplicationBase.TrimBinariesLoadPath
staticgetset

Set TrimBinariesLoadPath, to force the SDK to load native binaries from a particular path. This will override the searching logic that the SDK would otherwise apply.