Missing クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
不足している Objectを表します。 このクラスは継承できません。
public ref class Missing sealed
public ref class Missing sealed : System::Runtime::Serialization::ISerializable
public sealed class Missing
public sealed class Missing : System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class Missing : System.Runtime.Serialization.ISerializable
type Missing = class
type Missing = class
interface ISerializable
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type Missing = class
interface ISerializable
Public NotInheritable Class Missing
Public NotInheritable Class Missing
Implements ISerializable
- 継承
-
Missing
- 属性
- 実装
次の例は、 オブジェクトを使用して、リフレクションを Missing 使用して既定の引数を持つメソッドを呼び出す方法を示しています。
using System;
using System.Reflection;
[assembly:CLSCompliant(true)]
public class MissingClass
{
public static void MethodWithDefault(int value = 33)
{
Console.WriteLine("value = {0}", value);
}
}
public class Example
{
public static void Main()
{
// Invoke without reflection
MissingClass.MethodWithDefault();
// Invoke by using reflection.
Type t = typeof(MissingClass);
MethodInfo mi = t.GetMethod("MethodWithDefault");
mi.Invoke(null, new object[] { Missing.Value });
}
}
// The example displays the following output:
// value = 33
// value = 33
Imports System.Reflection
<Assembly:CLSCompliant(True)>
Public Class MissingClass
Public Shared Sub MethodWithDefault(Optional value As Integer = 33)
Console.WriteLine("value = {0}", value)
End Sub
End Class
Public Module Example
Public Sub Main()
' Invoke without reflection.
MissingClass.MethodWithDefault()
' Invoke by using reflection.
Dim t As Type = GetType(MissingClass)
Dim mi As MethodInfo = t.GetMethod("MethodWithDefault")
mi.Invoke(Nothing, { Missing.Value })
End Sub
End Module
' The example displays the following output:
' value = 33
' value = 33
クラスは Missing 、通常、リフレクションを使用する場合に、既定の引数を使用してメソッドを呼び出すために使用されます。
フィールドによってValue返される のインスタンスMissingは 1 つだけ存在します。
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
Get |
既定のハッシュ関数として機能します。 (継承元 Object) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
ISerializable. |
SerializationInfo オブジェクトに、Missing オブジェクトのただ 1 つのインスタンスを再作成するために必要な論理コンテキスト情報を設定します。 |
製品 | バージョン |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。