Repository.Message: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) (Created page with '{{Template:API}}{{Template:APIBreadcrumb|.Repository}} {{Template:InProgress}} <onlyinclude>Occurs when a logic error is produced. Displays an error messag…') |
Kate Racaza (talk | contribs) No edit summary |
||
Line 40: | Line 40: | ||
NewAction.ActionDescription = {{APIString|"MyNewAction"}} | NewAction.ActionDescription = {{APIString|"MyNewAction"}} | ||
{{APIComment|' | {{APIComment|'Trigger the event by sending the new action to the repository without specifying a target project.}} | ||
{{APIPrefix|Call}} MyRepository.Action.AddAction(NewAction) | {{APIPrefix|Call}} MyRepository.Action.AddAction(NewAction) | ||
Line 72: | Line 72: | ||
NewAction.ActionDescription = {{APIString|"MyNewAction"}} | NewAction.ActionDescription = {{APIString|"MyNewAction"}} | ||
{{APIComment|' | {{APIComment|'Trigger the event by sending the new action to the repository without specifying a target project.}} | ||
MyRepository.Action.AddAction(NewAction) | MyRepository.Action.AddAction(NewAction) | ||
Revision as of 23:11, 16 August 2016
Member of: SynthesisAPI.Repository
Template:InProgress
Occurs when a logic error is produced. Displays an error message.
Remarks: To write your own code for the event procedure, set the UseEvents
property of the Repository
object to True. The event is raised by the class methods.
Syntax
_Message(msg)
Parameters
msg
- Required. String. The message to display when an error occurs.
Example
The following example provides a simple demonstration on how to customize the event procedure.
VBA 'Specify a variable to handle the event. Public WithEvents MyRepository As Repository '---------------------------- Public Sub Main() 'Associate the event variable with an object. Set MyRepository = New Repository 'Set the application to use your event procedure. MyRepository.UseEvents = True 'Connect to a Synthesis repository. MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11") 'Create a new action. Dim NewAction As New cAction NewAction.ActionDescription = "MyNewAction" 'Trigger the event by sending the new action to the repository without specifying a target project. Call MyRepository.Action.AddAction(NewAction) Msgbox("End") End Sub '---------------------------- Private Sub MyRepository_Message(ByVal msg As String) '<Add code here to handle the event.> MsgBox (msg) End Sub
VB.NET 'Specify a variable to handle the event. Public WithEvents MyRepository As Repository '---------------------------- Sub Main() 'Associate the event variable with an object. MyRepository = New Repository 'Set the application to use your event procedure. MyRepository.UseEvents = True 'Connect to a Synthesis repository. MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11") 'Create a new action. Dim NewAction As New cAction NewAction.ActionDescription = "MyNewAction" 'Trigger the event by sending the new action to the repository without specifying a target project. MyRepository.Action.AddAction(NewAction) Msgbox("End") End Sub '---------------------------- Private Sub MyRepository_Message(msg As String) Handles MyRepository.Message '<Add code here to handle the event.> MsgBox (msg) End Sub