LogicalMethodInfo.IsAsync プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > LogicalMethodInfo.IsAsync プロパティの意味・解説 

LogicalMethodInfo.IsAsync プロパティ

LogicalMethodInfo のインスタンス表されるメソッドが、非同期的に呼び出されるかどうかを示す値を取得します

名前空間: System.Web.Services.Protocols
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

使用例使用例
Imports System
Imports System.Reflection
Imports System.Web.Services.Protocols
Imports Microsoft.VisualBasic

Public Class MyService
   Inherits SoapHttpClientProtocol
   
   Public Function BeginAdd _
       (xValue As Integer, yValue As
 Integer, callback As AsyncCallback, asyncState
 As Object) _
                                                                                
    As IAsyncResult
      Return Me.BeginInvoke("Add",
 New Object() {xValue, yValue}, callback,
 asyncState)
   End Function 'BeginAdd
   
   Public Function EndAdd(asyncResult As
 System.IAsyncResult) As Integer
      Dim results As Object()
 = Me.EndInvoke(asyncResult)
      Return CInt(results(0))
   End Function 'EndAdd
End Class 'MyService

Public Class LogicalMethodInfo_Create
   
   Public Shared Sub Main()
      Dim myType As Type = GetType(MyService)
      Dim myBeginMethod As MethodInfo = myType.GetMethod("BeginAdd")
      Dim myEndMethod As MethodInfo = myType.GetMethod("EndAdd")
      Dim myLogicalMethodInfo As LogicalMethodInfo
 = _
          LogicalMethodInfo.Create(New MethodInfo() _
                          {myBeginMethod, myEndMethod}, LogicalMethodTypes.Async)(0)
      
      Console.WriteLine _
        (ControlChars.Newline + "The asynchronous callback parameter
 of method {0} is :" + _ 
                                             ControlChars.Newline, myLogicalMethodInfo.Name)
      Console.WriteLine _
        (ControlChars.Tab + myLogicalMethodInfo.AsyncCallbackParameter.Name + "
 : " + _
                    myLogicalMethodInfo.AsyncCallbackParameter.ParameterType.ToString())
      
      Console.WriteLine _
        (ControlChars.Newline + "The asynchronous state parameter
 of method {0} is :" + _
                                             ControlChars.Newline, myLogicalMethodInfo.Name)
      Console.WriteLine _
       (ControlChars.Tab + myLogicalMethodInfo.AsyncStateParameter.Name + "
 : " + _
                               myLogicalMethodInfo.AsyncStateParameter.ParameterType.ToString())
      
      Console.WriteLine _
       (ControlChars.Newline + "The asynchronous result parameter
 of method {0} is :" + _
                                                     ControlChars.Newline, myLogicalMethodInfo.Name)
      Console.WriteLine _
       (ControlChars.Tab + myLogicalMethodInfo.AsyncResultParameter.Name + "
 : " + _
                               myLogicalMethodInfo.AsyncResultParameter.ParameterType.ToString())
      
      Console.WriteLine _
        (ControlChars.Newline + "The begin method of the asynchronous
 method {0} is :" + _
                                             ControlChars.Newline, myLogicalMethodInfo.Name)
      Console.WriteLine(ControlChars.Tab + myLogicalMethodInfo.BeginMethodInfo.ToString())
      
      Console.WriteLine _
       (ControlChars.Newline + "The end method of the asynchronous
 method {0} is :" + _
                                                     ControlChars.Newline, myLogicalMethodInfo.Name)
      Console.WriteLine(ControlChars.Tab + myLogicalMethodInfo.EndMethodInfo.ToString())
      
      If myLogicalMethodInfo.IsAsync Then
         Console.WriteLine(ControlChars.Newline + "{0} is asynchronous",
 myLogicalMethodInfo.Name)
      Else
         Console.WriteLine(ControlChars.Newline + "{0} is synchronous",
 myLogicalMethodInfo.Name)
      End If 
   End Sub 'Main
End Class 'LogicalMethodInfo_Create
using System;
using System.Reflection;
using System.Web.Services.Protocols;

public class MyService : SoapHttpClientProtocol
{
   public IAsyncResult BeginAdd(int xValue,
 int yValue,
                                AsyncCallback callback,
                                object asyncState)
   {
      return this.BeginInvoke("Add",
 new object[] {xValue,yValue}, callback, asyncState);
   }

   public int EndAdd(System.IAsyncResult asyncResult)
 
   {
      object[] results = this.EndInvoke(asyncResult);
      return ((int)(results[0]));
   } 
}

public class LogicalMethodInfo_Create
{
   public static void Main()
   {
      Type myType = typeof(MyService);
      MethodInfo myBeginMethod = myType.GetMethod("BeginAdd");
      MethodInfo myEndMethod = myType.GetMethod("EndAdd");
      LogicalMethodInfo myLogicalMethodInfo = 
         (LogicalMethodInfo.Create(new MethodInfo[] { myBeginMethod
,
                                                      myEndMethod },
                                   LogicalMethodTypes.Async))[0];

      Console.WriteLine("\nThe asynchronous callback parameter of method {0}
 is :\n",
                           myLogicalMethodInfo.Name);
      Console.WriteLine("\t" + myLogicalMethodInfo.AsyncCallbackParameter.Name
 +
                              " : " + myLogicalMethodInfo.AsyncCallbackParameter.ParameterType);

            Console.WriteLine("\nThe asynchronous state parameter of method
 {0} is :\n",
         myLogicalMethodInfo.Name);
      Console.WriteLine("\t" + myLogicalMethodInfo.AsyncStateParameter.Name
 +
         " : " + myLogicalMethodInfo.AsyncStateParameter.ParameterType);

      Console.WriteLine("\nThe asynchronous result parameter of method {0} is
 :\n",
         myLogicalMethodInfo.Name);
      Console.WriteLine("\t" + myLogicalMethodInfo.AsyncResultParameter.Name
 +
         " : " + myLogicalMethodInfo.AsyncResultParameter.ParameterType);

      Console.WriteLine("\nThe begin method of the asynchronous method {0} is
 :\n",
         myLogicalMethodInfo.Name);
      Console.WriteLine("\t" + myLogicalMethodInfo.BeginMethodInfo);

      Console.WriteLine("\nThe end method of the asynchronous method {0} is
 :\n",
         myLogicalMethodInfo.Name);
      Console.WriteLine("\t" + myLogicalMethodInfo.EndMethodInfo);

      if(myLogicalMethodInfo.IsAsync)
         Console.WriteLine("\n{0} is asynchronous", myLogicalMethodInfo.Name);
      else
         Console.WriteLine("\n{0} is synchronous", myLogicalMethodInfo.Name);

   }
}
#using <System.dll>
#using <System.Web.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Reflection;
using namespace System::Web::Services::Protocols;

public ref class MyService: public
 SoapHttpClientProtocol
{
public:
   IAsyncResult^ BeginAdd( int xValue, int
 yValue, AsyncCallback^ callback, Object^ asyncState )
   {
      array<Object^>^temp0 = {xValue,yValue};
      return this->BeginInvoke( "Add",
 temp0, callback, asyncState );
   }

   int EndAdd( System::IAsyncResult^ asyncResult )
   {
      array<Object^>^results = this->EndInvoke( asyncResult
 );
      return  *dynamic_cast<int^>(results[
 0 ]);
   }
};

int main()
{
   Type^ myType = MyService::typeid;
   MethodInfo^ myBeginMethod = myType->GetMethod( "BeginAdd" );
   MethodInfo^ myEndMethod = myType->GetMethod( "EndAdd" );
   array<MethodInfo^>^temp0 = {myBeginMethod,myEndMethod};
   LogicalMethodInfo^ myLogicalMethodInfo = LogicalMethodInfo::Create( temp0, LogicalMethodTypes::Async
 )[ 0 ];
   Console::WriteLine( "\nThe asynchronous callback parameter of method {0}
 is :\n", myLogicalMethodInfo->Name );
   Console::WriteLine( "\t {0} : {1}", myLogicalMethodInfo->AsyncCallbackParameter->Name,
 myLogicalMethodInfo->AsyncCallbackParameter->ParameterType );
   Console::WriteLine( "\nThe asynchronous state parameter of method {0} is
 :\n", myLogicalMethodInfo->Name );
   Console::WriteLine( "\t {0} : {1}", myLogicalMethodInfo->AsyncStateParameter->Name,
 myLogicalMethodInfo->AsyncStateParameter->ParameterType );
   Console::WriteLine( "\nThe asynchronous result parameter of method {0} is
 :\n", myLogicalMethodInfo->Name );
   Console::WriteLine( "\t {0} : {1}", myLogicalMethodInfo->AsyncResultParameter->Name,
 myLogicalMethodInfo->AsyncResultParameter->ParameterType );
   Console::WriteLine( "\nThe begin method of the asynchronous method {0} is
 :\n", myLogicalMethodInfo->Name );
   Console::WriteLine( "\t {0}", myLogicalMethodInfo->BeginMethodInfo
 );
   Console::WriteLine( "\nThe end method of the asynchronous method {0} is :\n",
 myLogicalMethodInfo->Name );
   Console::WriteLine( "\t {0}", myLogicalMethodInfo->EndMethodInfo
 );
   if ( myLogicalMethodInfo->IsAsync )
      Console::WriteLine( "\n {0} is asynchronous", myLogicalMethodInfo->Name
 );
   else
      Console::WriteLine( "\n {0} is synchronous", myLogicalMethodInfo->Name
 );
}
import System.*;
import System.Reflection.*;
import System.Web.Services.Protocols.*;

public class MyService extends SoapHttpClientProtocol
{
    public IAsyncResult BeginAdd(int xValue,
 int yValue, AsyncCallback callback,
        Object asyncState)
    {
        return this.BeginInvoke("Add",
 new Object[] { (Int32)xValue, 
            (Int32)yValue }, callback, asyncState);
    } //BeginAdd

    public int EndAdd(System.IAsyncResult asyncResult)
    {
        Object results[] = this.EndInvoke(asyncResult);
        return Convert.ToInt32(results.get_Item(0));
    } //EndAdd
} //MyService

public class LogicalMethodInfo_Create
{
    public static void main(String[]
 args)
    {
        Type myType = MyService.class.ToType();
        MethodInfo myBeginMethod = myType.GetMethod("BeginAdd");
        MethodInfo myEndMethod = myType.GetMethod("EndAdd");
        LogicalMethodInfo myLogicalMethodInfo = 
            ((LogicalMethodInfo)((LogicalMethodInfo[])LogicalMethodInfo.
            Create(new MethodInfo[] { myBeginMethod, myEndMethod
 }, 
            LogicalMethodTypes.Async)).get_Item(0));

        Console.WriteLine("\nThe asynchronous callback parameter "
            + "of method {0} is :\n", myLogicalMethodInfo.get_Name());
        Console.WriteLine("\t" 
            + myLogicalMethodInfo.get_AsyncCallbackParameter().get_Name() 
            + " : " + myLogicalMethodInfo.get_AsyncCallbackParameter().
            get_ParameterType());

        Console.WriteLine("\nThe asynchronous state parameter "
            + "of method {0} is :\n", myLogicalMethodInfo.get_Name());
        Console.WriteLine("\t" 
            + myLogicalMethodInfo.get_AsyncStateParameter().get_Name() + " :
 " 
            + myLogicalMethodInfo.get_AsyncStateParameter().
            get_ParameterType());

        Console.WriteLine("\nThe asynchronous result parameter "
            + "of method {0} is :\n", myLogicalMethodInfo.get_Name());
        Console.WriteLine("\t" 
            + myLogicalMethodInfo.get_AsyncResultParameter().get_Name() + "
 : " 
            + myLogicalMethodInfo.get_AsyncResultParameter().
            get_ParameterType());

        Console.WriteLine("\nThe begin method of the asynchronous "
            + "method {0} is :\n", myLogicalMethodInfo.get_Name());
        Console.WriteLine("\t" + myLogicalMethodInfo.get_BeginMethodInfo());

        Console.WriteLine("\nThe end method of the asynchronous "
            + "method {0} is :\n", myLogicalMethodInfo.get_Name());
        Console.WriteLine("\t" + myLogicalMethodInfo.get_EndMethodInfo());

        if (myLogicalMethodInfo.get_IsAsync()) {
            Console.WriteLine("\n{0} is asynchronous", 
                myLogicalMethodInfo.get_Name());
        }
        else {
            Console.WriteLine("\n{0} is synchronous", 
                myLogicalMethodInfo.get_Name());
        }
    } //main
} //LogicalMethodInfo_Create
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
LogicalMethodInfo クラス
LogicalMethodInfo メンバ
System.Web.Services.Protocols 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

LogicalMethodInfo.IsAsync プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



LogicalMethodInfo.IsAsync プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS