TA Diagnostics

You can use Diagnostics to get runtime information about classes with and without TA support. Add a call to the following method in the configureTA() method and run the example from the previous topic:

 

 

TAExample.cs: ActivateDiagnostics
1private static void ActivateDiagnostics(IConfiguration configuration) 2 { 3 // Add diagnostic listener that will show all the classes that are not 4 // TA aware. 5 configuration.Diagnostic().AddListener(new TADiagnostics()); 6 }
TAExample.cs: TADiagnostics
01private class TADiagnostics : IDiagnosticListener 02 { 03 public void OnDiagnostic(IDiagnostic diagnostic) 04 { 05 if (!(diagnostic is NotTransparentActivationEnabled)) 06 { 07 return; 08 } 09 System.Console.WriteLine(diagnostic.ToString()); 10 } 11 }


 

TAExample.vb: ActivateDiagnostics
1Private Shared Sub ActivateDiagnostics(ByVal configuration As IConfiguration) 2 ' Add diagnostic listener that will show all the classes that are not 3 ' TA aware. 4 configuration.Diagnostic.AddListener(New TADiagnostics) 5 End Sub
TAExample.vb: TADiagnostics
01Private Class TADiagnostics 02 Implements IDiagnosticListener 03 04 Public Sub OnDiagnostic(ByVal diagnostic As IDiagnostic) Implements IDiagnosticListener.OnDiagnostic 05 If Not (TypeOf diagnostic Is NotTransparentActivationEnabled) Then 06 Return 07 End If 08 System.Console.WriteLine(diagnostic) 09 End Sub 10 End Class


The example should show you diagnostic messages about the classes without TA support. In this case it should be Image class (Pilot._image) and BlobImpl (used in Image class).