IUccDiagnosticInfo Interface
Encapsulates the diagnostic information as an entry in an error report.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
An instance of IUccDiagnosticInfo is obtained by reading the UCCOPEC_DIAGNOSTIC_DETAILS property of an instance of IUccContext.
The following example reads an IUccOperationProgressEvent instance obtained from the platform when the OnShutdown event is raised. You get an instance of IUccOperationContext from the OriginalOperationContext property of IUccOperationProgressEvent instance.
The example method accepts an IUccOperationContext instance obtained as previously described.
public struct DiagnosicInfo
{
public int Code;
public List<string> Properties;
public string Source;
public List<int> ErrorCodes;
public string Text;
public string DiagType;
}
public List<DiagnosicInfo> DiagnosticInformation(IUccOperationContext pContext)
{
List<DiagnosicInfo> returnValue = new List<DiagnosicInfo>();
if (pContext.Context.IsPropertySet(
(int)UCC_OPERATION_PROGRESS_EVENT_CONTEXT.UCCOPEC_DIAGNOSTIC_DETAILS))
{
IUccCollection diagCollection = pContext.Context.get_Property(
(int)UCC_OPERATION_PROGRESS_EVENT_CONTEXT.UCCOPEC_DIAGNOSTIC_DETAILS) as IUccCollection;
foreach (IUccDiagnosticInfo d in diagCollection)
{
DiagnosicInfo diagDetails = new DiagnosicInfo();
diagDetails.DiagType = d.Type.ToString();
diagDetails.Code = d.Code;
foreach (int code in d.SubCodes)
{
diagDetails.ErrorCodes.Add(code);
}
diagDetails.Source = d.Source;
diagDetails.Text = d.Text;
foreach (IUccProperty property in d.Properties)
{
diagDetails.Properties.Add(
property.Id.ToString()
+ " "
+ property.Value.ToString());
}
returnValue.Add(diagDetails);
}
}
return returnValue;
}