Click or drag to resize

IExceptionManagerCountsByType Method

Retrieves the count of exceptions for each exception type that meets an optionally supplied set of filter criteria. If no filters are supplied then counts are returned for each exception type for which exceptions occurred.

Namespace:  EdaIntegrationContract.Exceptions
Assembly:  EdaIntegration.Contract (in EdaIntegration.Contract.dll) Version: 1.0
Syntax
C#
List<KeyValuePair<ExceptionType, int>> CountsByType(
	IExceptionFilter filter = null
)

Parameters

filter (Optional)
Type: EdaIntegrationContract.ExceptionsIExceptionFilter
The filters to apply to limit the exception values returned

Return Value

Type: ListKeyValuePairExceptionType, Int32
A key/value pair representing the exception type (key) and the number of exceptions that occurred for that type (value).
Examples
The following example demonstrates retrieving the count of exceptions for all exception types.
C#
using EdaIntegrationContract;
using EdaIntegrationContract.Case;
using EdaIntegrationContract.Exceptions;

class Sample
{
    static void Main()
    {
        var edaIntegration = new EdaIntegration().ConnectToExplore();
        ICase edaCase = edaIntegration.Cases.OpenCaseByName("Case 1");

        Console.WriteLine("Exceptions with counts");
        Console.WriteLine("======================");
        foreach (KeyValuePair<ExceptionType, int> kvp in edaCase.Exceptions.CountsByType())
        {
            Console.WriteLine("{0, -16}  {1, 4}", kvp.Key, kvp.Value);
        }
    }
}
/*
This example produces the following results:

Exceptions with counts
======================
EmptyFile            1
EncryptedFile        4
NoContent           10
UnknownFileType      1
 */
See Also