TReKiE / msnp-sharp

Automatically exported from code.google.com/p/msnp-sharp
0 stars 0 forks source link

need c# to vb.net conversion of snippet #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, i'm converting the example to vb.net and i'm stuck here and all my
effort to convert the line where you add delegate to form close event went
futile.Plz help me. Can you guyz provide me with a valid c# to vb.net
conversion of these lines?
Also to the proj owners whr can i contact you if i got stuck any where else
in the project?
Thanks ahead, tomsmaily [at] gmail.com

if (contact.OnPendingList || (contact.OnReverseList &&
!contact.OnAllowedList && !contact.OnBlockedList && !contact.OnPendingList))
{
>   ReverseAddedForm form = new ReverseAddedForm(contact);
>   form.FormClosed += delegate(object f, FormClosedEventArgs fce)
   {
>       form = f as ReverseAddedForm;
       if (DialogResult.OK == form.DialogResult)
       {

       }
       return;
   };
>   form.Show(this);
}

Original issue reported on code.google.com by tomsma...@gmail.com on 22 Apr 2009 at 10:36

GoogleCodeExporter commented 9 years ago
Private Sub Nameserver_ReverseAdded(ByVal sender As Object, ByVal e As 
ContactEventArgs)
    If MyBase.InvokeRequired Then
        MyBase.Invoke(New EventHandler(Of ContactEventArgs)(AddressOf 
Me.Nameserver_ReverseAdded), New Object() { sender, e })
    Else
        Dim contact As Contact = e.Contact
        If (Me.messenger.Nameserver.Owner.NotifyPrivacy = NotifyPrivacy.PromptOnAdd) 
Then
            If (contact.OnPendingList OrElse (((contact.OnReverseList AndAlso Not 
contact.OnAllowedList) AndAlso Not contact.OnBlockedList) AndAlso Not 
contact.OnPendingList)) Then
                Dim form As New ReverseAddedForm(contact)
                AddHandler form.FormClosed, Function (ByVal f As Object, ByVal fce 
As FormClosedEventArgs) 
                    form = TryCast(f,ReverseAddedForm)
                    If (DialogResult.OK = form.DialogResult) Then
                        If form.AddToContactList Then
                            Me.messenger.Nameserver.ContactService.AddNewContact
(contact.Mail)
                            Thread.Sleep(200)
                            If form.Blocked Then
                                contact.Blocked = True
                            End If
                        ElseIf form.Blocked Then
                            contact.Blocked = True
                        Else
                            contact.OnAllowedList = True
                        End If
                        Thread.Sleep(200)
                        contact.OnPendingList = False
                    End If
                End Function
                form.Show(Me)
            Else
                MessageBox.Show((contact.Mail & " accepted your invitation and added 
you their contact list."))
            End If
        End If
    End If
End Sub

Please use Red Gate's Reflector to convert the code by machine.

Original comment by freezing...@gmail.com on 23 Apr 2009 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by freezing...@gmail.com on 23 Apr 2009 at 6:02