@@ -27,7 +27,7 @@ You can register:
2727- RegisterType(param Type[ ] )
2828
2929### Example
30- ``` csharp
30+ {% highlight csharp %}
3131// using Z.Expressions; // Don't forget to include this.
3232var context = new EvalContext();
3333context.RegisterAlias("Math2", "System.Math");
@@ -40,19 +40,19 @@ context.RegisterGlobalVariable("sessionCount", 0);
4040context.RegisterStaticMember(typeof(Math), typeof(Int));
4141context.RegisterStaticMember(powMemberInfo, RoundMemberInfo);
4242context.RegisterType(typeof (bool), typeof(char);
43- ```
43+ {% endhighlight %}
4444
4545### Static Member
4646You can use static member name without qualifying them with their namespace or type name. Static member is a new feature in C# 6.0.
4747
48- ``` csharp
48+ {% highlight csharp %}
4949// using Z.Expressions; // Don't forget to include this.
5050var context = new EvalContext();
5151context.RegisterStaticMember(typeof(Math), typeof(Int));
5252
5353bool result = context.Execute<double >("Pow(2, 3)"); // Math.Pow(2, 3) = 8"
5454int result = context.Execute<int >("MinValue"); // Int.MinValue
55- ```
55+ {% endhighlight %}
5656
5757## Unregister
5858### Problem
@@ -70,7 +70,7 @@ You can unregister:
7070- UnregisterType(param Type[ ] )
7171
7272### Example
73- ``` csharp
73+ {% highlight csharp %}
7474// using Z.Expressions; // Don't forget to include this.
7575var context = new EvalContext();
7676context.UnregisterAlias("Math2");
@@ -83,4 +83,4 @@ context.UnregisterGlobalVariables("sessionCount");
8383context.UnregisterStaticMember(typeof(Math), typeof(Int));
8484context.UnregisterStaticMember(powMemberInfo, RoundMemberInfo);
8585context.UnregisterType(typeof (bool), typeof(char);
86- ```
86+ {% endhighlight %}
0 commit comments