In VB6 there is a Form event called LinkExecute
witch I can use to link tow projects together. For example I create project A with a button and link it with project B witch has a textbox when I click on the button on project A the textbox in project B changed.
To simplify the idea it link the tow projects and make one of them listen to the other events and when a specific event occur on the main project the listener fire an event locally on the listener project.
Both projects are WinForms and run on the same machine.
Project A
Private Sub Command1_Click()
On Error Resume Next
Text1.LinkTopic = "Project1|SYSTEM"
Text1.LinkItem = "TEXTSource"
Text1.LinkMode = vbLinkManual
Text1.LinkRequest ' "Hello World"
Text1.LinkExecute "Hello World"
DoEvents
End Sub
Public Sub Form_Load()
End Sub
Project B
Private Sub Command1_Click()
Label1.Caption = Val(Label1.Caption) + 1
End Sub
Private Sub Form_LinkClose()
List1.AddItem "Form_LinkClose"
Command1_Click
End Sub
Private Sub Form_LinkError(LinkErr As Integer)
List1.AddItem "form_LinkError"
Command1_Click
End Sub
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
List1.AddItem "Command " & CmdStr & " has been received"
Cancel = False
Command1_Click
End Sub
Private Sub Form_LinkOpen(Cancel As Integer)
List1.AddItem "Form_LinkOpen"
Cancel = False
Command1_Click
End Sub
Private Sub Form_Load()
List1.Clear
Command1_Click
End Sub
Private Sub PictureSource_LinkClose()
List1.AddItem "PictureSource LinkClose"
Command1_Click
End Sub
Private Sub PictureSource_LinkError(LinkErr As Integer)
List1.AddItem "PictureSource LinkError: Error = " & LinkErr
Command1_Click
End Sub
Private Sub PictureSource_LinkNotify()
List1.AddItem "PictureSource LinkNotify"
Command1_Click
End Sub
Private Sub PictureSource_LinkOpen(Cancel As Integer)
List1.AddItem "PictureSource LinkOpen"
Command1_Click
End Sub
So what is the equivalent to LinkExecute
in C# or how can I do the same in C#?