Repository.WriteToDiagnosticsLog: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
 
(31 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}}
 
== Syntax ==
*WriteToDiagnosticsLog({{APIPrefix|Optional ByVal}} message {{APIPrefix|As String}} , {{APIPrefix|Optional ByVal}} entrytype {{APIPrefix|As}} [[Repository.XFRACASDiagnosticEntryType|XFRACASDiagnosticEntryType]])
 
Parameters
:''message'': The message that should be displayed in the diagnostics log for the diagnostics entry type
:''entryType'': The type of diagnostics entry type, specified as [[Repository.XFRACASDiagnosticsEntryType Enumeration|XFRACASDiagnosticsEntryType]]
:''exObject'': The object that can be written into the diagnostics log.
:''comment'': Optional comment that can be written into the diagnostics log.
:''[[Repository.XFRACASDiagnosticsEntryType|XFRACASDiagnosticsEntryType]]:
 
 
== 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]](ByVal message As String, ByVal entryType As [[Repository.XFRACASDiagnosticsEntryType|XFRACASDiagnosticsEntryType]])
 
=== 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]](ByVal message As String, ByVal entryType As [[Repository.XFRACASDiagnosticsEntryType|XFRACASDiagnosticsEntryType]])

Latest revision as of 19:05, 5 May 2016