Loupe - Log - Monitor - Resolve
Gibraltar.Agent.Metrics Namespace / EventMetricDefinition Class / TryGetValue Method / TryGetValue(String,EventMetricDefinition) Method
The Key of the event metric definition to get (composed of the metrics system, category name, and counter name combined as a single string).
The output variable to receive the EventMetricDefinition object if found (null if not).

In This Topic
    TryGetValue(String,EventMetricDefinition) Method
    In This Topic
    Retrieve an EventMetricDefinition by its combined three-part Key string, if present.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function TryGetValue( _
       ByVal key As String, _
       ByRef value As EventMetricDefinition _
    ) As Boolean
    public static bool TryGetValue( 
       string key,
       out EventMetricDefinition value
    )

    Parameters

    key
    The Key of the event metric definition to get (composed of the metrics system, category name, and counter name combined as a single string).
    value
    The output variable to receive the EventMetricDefinition object if found (null if not).

    Return Value

    False if no metric definition is registered with the given Key, true if an EventMetricDefinition is registered with the given Key, or throws an exception if the registered definition is not an EventMetricDefinition.
    Remarks
    This method looks in the collection of registered metric definitions for the specified Id key. If it is not found, the output is set to null and the method returns false. If the Id key is found and resolves to an EventMetricDefinition, it is stored in the value output parameter and the method returns true. If the Id key is found but is not an EventMetricDefinition, an ArgumentException is thrown to signal a usage inconsistency in your code.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also