Skip to content

Instantly share code, notes, and snippets.

@o-eight
Created July 7, 2011 12:41

Revisions

  1. o-eight revised this gist Jul 7, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.bas
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    Partial Public Class MainPage
    Inherits UserControl

    'Declare Member-variant for Custom Class by WCF Service
    'WCFサービスのカスタムクラス用のメンバ変数宣言
    Dim svc As ServiceReference1.Service1Client

    Public Sub New()
    InitializeComponent()
    'initialize Custom Class
    'カスタムクラスのインスタンス生成
    svc = New ServiceReference1.Service1Client()
    'DoWork呼び出し完了時のイベントハンドラを指定
    AddHandler svc.DoWorkCompleted, AddressOf svc_DoWorkCompleted
  2. o-eight renamed this gist Jul 7, 2011. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. o-eight created this gist Jul 7, 2011.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    Partial Public Class MainPage
    Inherits UserControl

    'Declare Member-variant for Custom Class by WCF Service
    Dim svc As ServiceReference1.Service1Client

    Public Sub New()
    InitializeComponent()
    'initialize Custom Class
    svc = New ServiceReference1.Service1Client()
    'DoWork呼び出し完了時のイベントハンドラを指定
    AddHandler svc.DoWorkCompleted, AddressOf svc_DoWorkCompleted
    End Sub

    Private Sub svc_DoWorkCompleted(sender As System.Object, e As ServiceReference1.DoWorkCompletedEventArgs)
    MessageBox.Show(e.Result)
    End Sub

    Private Sub button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles button1.Click
    svc.DoWorkAsync("Test Message")
    End Sub
    End Class