C#和VB.NET语法不同

C#               

 Dispatcher.BeginInvoke(() =>
                {
                    dataGrid1.DataContext = obsvCollCustomers;
                });

VB.NET

...

 Me.Dispatcher.BeginInvoke(New NoArgsDelegate(AddressOf miniCall))

...

 

    '委托
    Public Delegate Sub NoArgsDelegate()

    Sub miniCall()
        dataGrid1.DataContext = obsvCollCustomers
    End Sub

C#

               // 异步操作结果类型转换

                DataServiceQuery<Customer> queryResult =(DataServiceQuery<Customer>) result.AsyncState;

VB.NET

            '异步操作结果类型转换
            Dim queryResult As DataServiceQuery(Of AdoNetDataServices.ServiceReference1.Customer) = result.AsyncState

C#

 dataGrid1.AutoGeneratingColumn += OnColumnCreated;

VB.NET

 

 

posted on 2009-02-15 18:23  wmt  阅读(216)  评论(0)    收藏  举报

导航