Repository.WriteToDiagnosticsLog: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
 
(20 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
#REDIRECT [[Repository.XFRACAS.WriteMessageToDiagnosticsLog]]
 
{{Template:Repository.WriteToDiagnosticsLog.Cmt}}
 
This method is an overloaded method which means the same signature will accept different sets of arguments. Both available methods are shown separately.
 
=First Available Method=
Writes a message to the diagnostics log.
 
== Syntax ==
*WriteToDiagnosticsLog(message {{APIPrefix|As String}} , entrytype {{APIPrefix|As}} [[Repository.XFRACASDiagnosticEntryType|XFRACASDiagnosticEntryType]])
 
Parameters
:''message'': Message to write to the diagnostics log
:''entryType'': The type of diagnostics entry type, specified as [[Repository.XFRACASDiagnosticsEntryType Enumeration|XFRACASDiagnosticsEntryType]]
 
=Second Available Method=
Writes exception information to the diagnostics log.
 
== Syntax ==
*WriteToDiagnosticsLog(exObject {{APIPrefix|As}} System.Exception , entrytype {{APIPrefix|As}} [[Repository.XFRACASDiagnosticEntryType|XFRACASDiagnosticEntryType]], {{APIPrefix| Optional}} comment{{APIPrefix|As String}})
 
Parameters
:''exObject'': Represents an error that occurs during application execution
:''entryType'': The type of diagnostics entry type, specified as [[Repository.XFRACASDiagnosticsEntryType Enumeration|XFRACASDiagnosticsEntryType]]
:''comment'': ''Optional'' comment to write to the diagnostics log
 
= Usage Example =
{{APIComment|Code Block}}
 
'{{APIComment|Declare a new repository connection class.}}
{{APIPrefix|Private WithEvents MyRepository As [[New Repository]]}}
'{{APIComment|Connect to the Synthesis repository.}}
{{APIPrefix|Dim}} Success {{APIPrefix|As Boolean}} = {{APIPrefix|False}}
Success = MyRepository.[[Repository.ConnectToRepository|ConnectToRepository]]("RepositoryFileNamePath")
'{{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}}
{{APIPrefix|Dim}} ListOfXFRACASEntities() {{APIPrefix|As [[NameIdPair Class|NameIdPair]]}}
ListOfXFRACASEntities = MyRepository.[[Repository.GetAllXFRACASEntities|GetAllXFRACASEntities]]()
'{{APIComment|Import the XML file into the entity desired.  In this example, the first entity is used.}}
{{APIPrefix|Dim}} ImportXMLSystemID {{APIPrefix|As Integer}}
ImportXMLSystemID = MyRepository.[[Repository.ImportXFRACASXMLFile|ImportXFRACASXMLFile]](ListOfXFRACASEntities(0).ID,  [[XFRACASImportType]].Incident, "XMLFileName", "XMLFileDescription")
'{{APIComment|Process the imported file.}}
MyRepository.[[Repository.ProcessXfracasImports|ProcessXfracasImports]]()
'{{APIComment|Create place to see where code is breaking instead of writing to your own logfile}}
MyRepository.[[Repository.WriteToDiagnosticsLog|WriteToDiagosticsLog]](Diagnostics Message {{APIPrefix|As}} String, entryType {{APIPrefix|As}}[[Repository.XFRACASDiagnosticsEntryType Enumeration|XFRACASDiagnosticsEntryType]].Information)
 
== Reformatted Usage Example ==
{{APIComment|Declare a new repository connection class.}}
        Private WithEvents MyRepository As [[New Repository]]
 
{{APIComment|Connect to the Synthesis repository.}}
        Dim Success As Boolean = False
        Success = MyRepository.[[Repository.ConnectToRepository|ConnectToRepository]]("RepositoryFileNamePath")
 
{{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}}
        Dim ListOfXFRACASEntities() As [[NameIdPair Class|NameIdPair]]
        ListOfXFRACASEntities = MyRepository.[[Repository.GetAllXFRACASEntities|GetAllXFRACASEntities]]()
 
{{APIComment|Import the XML file into the entity desired.  In this example, the first entity is used.}}
        Dim ImportXMLSystemID As Integer
        ImportXMLSystemID = MyRepository.[[Repository.ImportXFRACASXMLFile|ImportXFRACASXMLFile]](ListOfXFRACASEntities(0).ID, [[XFRACASImportType]].Incident, "XMLFileName", "XMLFileDescription")
 
{{APIComment|Process the imported file.}}
        MyRepository.[[Repository.ProcessXfracasImports|ProcessXfracasImports]]()
 
{{APIComment|Create place to see where code is breaking instead of writing to your own logfile}}
        MyRepository.[[Repository.WriteToDiagnosticsLog|WriteToDiagosticsLog]]({{APIPrefix|ByVal}}Diagnostics Message {{APIPrefix|As}}String, entryType {{APIPrefix|AS}}[[Repository.XFRACASDiagnosticsEntryType Enumeration|XFRACASDiagnosticsEntryType]].Information)

Latest revision as of 19:05, 5 May 2016