RuntimeHelpers.GetObjectValue メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > RuntimeHelpers.GetObjectValue メソッドの意味・解説 

RuntimeHelpers.GetObjectValue メソッド

値型ボックス格納します

名前空間: System.Runtime.CompilerServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
使用例使用例

GetObjectValue メソッド使用してクラスボックス化する方法次のコード例示します

Imports System.Runtime.CompilerServices

' Declare a value type.
Structure Point2I

    Dim x As Integer
    Dim y As Integer
End Structure

Module Program

    Sub Main(ByVal args() As
 String)


        ' Allocate an unboxed Point2I (not on the heap).
        Dim pnt As Point2I
        pnt.x = 0
        pnt.y = 0

        ' Box the value.  (Put it in the heap.)
        Dim objPntr As Object
 = RuntimeHelpers.GetObjectValue(pnt)
    End Sub


End Module
using System;
using System.Runtime.CompilerServices;

// Declare a value type.
struct Point2I
{
    public int x;
    public int y;
}

class Program
{

    static void Main(string[]
 args)
    {
        // Allocate an unboxed Point2I (not on the heap).
        Point2I pnt;
        pnt.x = 0;
        pnt.y = 0;

        // Box the value.  (Put it in the heap.)
        object objPntr = RuntimeHelpers.GetObjectValue(pnt);

    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
RuntimeHelpers クラス
RuntimeHelpers メンバ
System.Runtime.CompilerServices 名前空間



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

辞書ショートカット

すべての辞書の索引

RuntimeHelpers.GetObjectValue メソッドのお隣キーワード
検索ランキング

   

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



RuntimeHelpers.GetObjectValue メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS