Class ExpressionDescription
Represents the identifing information and metadata for a C# expression. This serves both as a request to create an expression, but also as a unique identifying key for an expression.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.CSharpExpressions
Assembly: ZptSharp.CSharpExpressions.dll
Syntax
public sealed class ExpressionDescription : IEquatable<ExpressionDescription>
Constructors
| Improve this Doc View SourceExpressionDescription(String, IEnumerable<AssemblyReference>, IEnumerable<UsingNamespace>, IEnumerable<String>, IEnumerable<VariableType>)
Initializes a new instance of ExpressionDescription.
Declaration
public ExpressionDescription(string expression, IEnumerable<AssemblyReference> assemblyReferences, IEnumerable<UsingNamespace> usingNamespaces, IEnumerable<string> inScopeVariableNames, IEnumerable<VariableType> typeDesignations)
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The expression body. |
System.Collections.Generic.IEnumerable<AssemblyReference> | assemblyReferences | The assembly references. |
System.Collections.Generic.IEnumerable<UsingNamespace> | usingNamespaces | The using namespaces. |
System.Collections.Generic.IEnumerable<System.String> | inScopeVariableNames | A collection of the names of variables which are in-scope for this expression. |
System.Collections.Generic.IEnumerable<VariableType> | typeDesignations | A collection of variable-type-designations. |
Properties
| Improve this Doc View SourceAssemblyReferences
Gets a collection of the assembly references which should be available when the expression is evaluated.
Declaration
public IReadOnlyCollection<AssemblyReference> AssemblyReferences { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<AssemblyReference> |
Expression
Gets the body of the expression itself. This is an executable C# script.
Declaration
public string Expression { get; }
Property Value
Type | Description |
---|---|
System.String | The expression body. |
InScopeVariableNames
Gets a collection of the names of variables which are in-scope for this expression.
Declaration
public IReadOnlyCollection<string> InScopeVariableNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<System.String> |
TypeDesignations
Gets a collection of variable-type-designations. These indicate any variables which should be treated as
strongly-typed instances and not as dynamic
objects.
Declaration
public IReadOnlyCollection<VariableType> TypeDesignations { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<VariableType> |
UsingNamespaces
Gets a collection of the using
namespaces which should be 'in scope' when the expression is evaluated.
Declaration
public IReadOnlyCollection<UsingNamespace> UsingNamespaces { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<UsingNamespace> |
Methods
| Improve this Doc View SourceEquals(Object)
Gets a value which indicates if the current instance is equal to the specified System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Equals(ExpressionDescription)
Gets a value which indicates if the current instance is equal to the specified ExpressionDescription.
Declaration
public bool Equals(ExpressionDescription other)
Parameters
Type | Name | Description |
---|---|---|
ExpressionDescription | other | An expression specification. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode()
Gets a hash code for the current instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code. |
Overrides
ToString()
Gets a string which represents the current instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The string representation. |