-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathTextLiteralNode.cs
More file actions
41 lines (36 loc) · 1.25 KB
/
TextLiteralNode.cs
File metadata and controls
41 lines (36 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using DynamicData;
using ExampleCodeGenApp.Model;
using ExampleCodeGenApp.Model.Compiler;
using ExampleCodeGenApp.ViewModels.Editors;
using ExampleCodeGenApp.Views;
using NodeNetwork.Toolkit.ValueNode;
using ReactiveUI;
namespace ExampleCodeGenApp.ViewModels.Nodes
{
public class TextLiteralNode : CodeGenNodeViewModel
{
static TextLiteralNode()
{
Splat.Locator.CurrentMutable.Register(() => new CodeGenNodeView(), typeof(IViewFor<TextLiteralNode>));
}
public StringValueEditorViewModel ValueEditor { get; } = new StringValueEditorViewModel();
public ValueNodeOutputViewModel<ITypedExpression<string>> Output { get; }
public TextLiteralNode() : base(NodeType.Literal)
{
this.Name = "Text";
Output = new CodeGenOutputViewModel<ITypedExpression<string>>(PortType.String)
{
Name = "Value",
Editor = ValueEditor,
Value = ValueEditor.ValueChanged.Select(v => new StringLiteral{ Value = v })
};
this.EditableOutputs().Add(Output);
}
}
}