Microsoft.CSharp Namespace
Namespace: Microsoft.CSharp
The Microsoft.CSharp namespace provides types that support the C# programming language, including the dynamic language runtime (DLR) and expression trees.
Classes
Classes in Microsoft.CSharp
-
CSharpArgumentInfoclassRepresents information about a dynamic argument passed to a dynamic operation.
-
ExpandoObjectclassRepresents an object whose members can be dynamically added and removed at run time.
-
RuntimeBinderExceptionclassThe exception that is thrown when the common language runtime cannot dynamically bind a member or operation.
Methods
No top-level methods are directly exposed in this namespace. Methods are typically accessed through the classes within this namespace.
Structs
No top-level structs are directly exposed in this namespace.
Enums
Enums in Microsoft.CSharp
CSharpArgumentInfo Class
Represents information about a dynamic argument passed to a dynamic operation.
public sealed class CSharpArgumentInfo
Constructors
-
CSharpArgumentInfo(int flags, object name)Initializes a new instance of the
CSharpArgumentInfoclass.
Properties
-
int Flags { get; }Gets the binder flags associated with the argument.
-
object Name { get; }Gets the name of the argument.
CSharpBinderFlags Enum
Specifies flags for constructing C# binders.
public enum CSharpBinderFlags
Members
-
NoneNo binder flags are specified.
-
InvokeSimpleNameThe binder performs a simple name invocation.
-
InvokeMethodNameThe binder performs a method name invocation.
-
BinaryOperationThe binder performs a binary operation.
ExpandoObject Class
Represents an object whose members can be dynamically added and removed at run time.
public sealed class ExpandoObject : IDynamicMetaObjectProvider, ICollection>, IEnumerable>, IEnumerable
Example
C# Example
using Microsoft.CSharp;
using System.Dynamic;
dynamic expando = new ExpandoObject();
expando.Name = "Alice";
expando.Age = 30;
Console.WriteLine($"Name: {expando.Name}, Age: {expando.Age}");
RuntimeBinderException Class
The exception that is thrown when the common language runtime cannot dynamically bind a member or operation.
public sealed class RuntimeBinderException : Exception
Constructors
-
RuntimeBinderException()Initializes a new instance of the
RuntimeBinderExceptionclass. -
RuntimeBinderException(string message)Initializes a new instance of the
RuntimeBinderExceptionclass with a specified error message.