Skip to content

Commit c82666d

Browse files
committed
Update to 1.5
1 parent ab377b6 commit c82666d

4 files changed

Lines changed: 35 additions & 20 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ Console.WriteLine(expr.ToString("Factory methods"));
3232
)
3333
*/
3434

35+
Console.WriteLine(expr.ToString("Object notation"));
36+
// prints:
37+
/*
38+
new Expression<Func<bool>> {
39+
NodeType = ExpressionType.Lambda,
40+
Type = typeof(Func<bool>),
41+
Body = new ConstantExpression {
42+
Type = typeof(bool),
43+
Value = true
44+
},
45+
ReturnType = typeof(bool)
46+
}
47+
*/
3548
```
3649

3750
Features:
@@ -40,6 +53,7 @@ Features:
4053

4154
* Pseudo-code in C# or VB.NET
4255
* Factory method calls which generate this expression
56+
* Object notation, using object initializer and collection initializer syntax to describe objects
4357

4458
* Extension methods are rendered as instance methods
4559

_visualizerTests.dotnetcore/Program.cs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,32 @@
88
using ExpressionToString.Util;
99
using System.Reflection;
1010
using System.Collections;
11+
using System.Linq.Expressions;
12+
using ExpressionToString;
1113

1214
namespace _visualizerTests.dotnetcore {
1315
class Program {
1416
static void Main(string[] args) {
15-
var x = Parameter(typeof(int), "x");
16-
var y = Parameter(typeof(int), "y");
17-
var expr = Multiply(
18-
Add(x, y),
19-
Constant(5)
20-
);
21-
17+
//var x = Parameter(typeof(int), "x");
18+
//var y = Parameter(typeof(int), "y");
19+
//var expr = Multiply(
20+
// Add(x, y),
21+
// Constant(5)
22+
//);
2223
//var data = new VisualizerData(expr);
2324
//Console.WriteLine(CanSerialize(data));
2425

25-
var endnodeData = new EndNodeData {
26-
Closure = null,
27-
Name = null,
28-
Type = "int",
29-
Value = "5"
30-
};
26+
//var endnodeData = new EndNodeData {
27+
// Closure = null,
28+
// Name = null,
29+
// Type = "int",
30+
// Value = "5"
31+
//};
3132
//Console.WriteLine(CanSerialize(endnodeData));
3233

33-
var stream = File.Create(Path.GetTempFileName());
34-
var formatter = new BinaryFormatter();
35-
formatter.Serialize(stream, endnodeData);
34+
//var stream = File.Create(Path.GetTempFileName());
35+
//var formatter = new BinaryFormatter();
36+
//formatter.Serialize(stream, endnodeData);
3637

3738
//var visualizerHost = new VisualizerDevelopmentHost(expr, typeof(Visualizer), typeof(VisualizerDataObjectSource));
3839
//visualizerHost.ShowVisualizer();

_visualizerTests/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ static void Main(string[] args) {
8585
//Expression<Func<int, double, double[]>> expr = (n, exp) => new[] { Math.Pow(n, exp) };
8686

8787
//IQueryable<Person> personSource = null;
88-
Expression<Func<Person, bool>> expr = person => person.LastName.StartsWith("A");
88+
//Expression<Func<Person, bool>> expr = person => person.LastName.StartsWith("A");
8989

90-
Console.WriteLine(expr.ToString("Object notation", out var pathSpans));
90+
//Console.WriteLine(expr.ToString("Object notation", out var pathSpans));
9191

9292
//var hour = Variable(typeof(int), "hour");
9393
//var msg = Variable(typeof(string), "msg");
@@ -149,7 +149,7 @@ static void Main(string[] args) {
149149
//Expression<Func<int, float, float>> multiplier = (i, f) => i * f;
150150

151151
//IEnumerable<string> matchingNames = new List<string>() { "Smith", "Doe" };
152-
//Expression<Func<Person, bool>> expr = p => p.DOB.DayOfWeek == DayOfWeek.Tuesday;
152+
Expression<Func<Person, bool>> expr = p => p.DOB.DayOfWeek == DayOfWeek.Tuesday;
153153

154154

155155
//expr = p => matchingNames.Contains(p.LastName) && p.DOB.DayOfWeek == DayOfWeek.Tuesday;

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.4.{build}
1+
version: 1.5.{build}
22
image:
33
- Visual Studio 2019
44
- Visual Studio 2017

0 commit comments

Comments
 (0)