BadScript 2
Loading...
Searching...
No Matches
CommandLine.Infrastructure.FSharpOptionHelper Class Reference

Static Public Member Functions

static Type GetUnderlyingType (Type type)
 
static object Some (Type type, object value)
 
static object None (Type type)
 
static object ValueOf (object value)
 
static bool IsSome (object value)
 

Detailed Description

Definition at line 9 of file FSharpOptionHelper.cs.

Member Function Documentation

◆ GetUnderlyingType()

static Type CommandLine.Infrastructure.FSharpOptionHelper.GetUnderlyingType ( Type  type)
static

Definition at line 11 of file FSharpOptionHelper.cs.

12 {
13 return type
14 .GetGenericArguments()[0];
15 }

◆ IsSome()

static bool CommandLine.Infrastructure.FSharpOptionHelper.IsSome ( object  value)
static

Definition at line 41 of file FSharpOptionHelper.cs.

42 {
43 return (bool)typeof(FSharpOption<>)
44 .MakeGenericType(GetUnderlyingType(value.GetType()))
45 .StaticMethod(
46 "get_IsSome", value);
47 }

◆ None()

static object CommandLine.Infrastructure.FSharpOptionHelper.None ( Type  type)
static

Definition at line 25 of file FSharpOptionHelper.cs.

26 {
27 return typeof(FSharpOption<>)
28 .MakeGenericType(type)
29 .StaticProperty(
30 "None");
31 }

◆ Some()

static object CommandLine.Infrastructure.FSharpOptionHelper.Some ( Type  type,
object  value 
)
static

Definition at line 17 of file FSharpOptionHelper.cs.

18 {
19 return typeof(FSharpOption<>)
20 .MakeGenericType(type)
21 .StaticMethod(
22 "Some", value);
23 }

◆ ValueOf()

static object CommandLine.Infrastructure.FSharpOptionHelper.ValueOf ( object  value)
static

Definition at line 33 of file FSharpOptionHelper.cs.

34 {
35 return typeof(FSharpOption<>)
36 .MakeGenericType(GetUnderlyingType(value.GetType()))
37 .InstanceProperty(
38 "Value", value);
39 }

The documentation for this class was generated from the following file: