diff --git a/.idea/.idea.NodeEditor/.idea/.gitignore b/.idea/.idea.NodeEditor/.idea/.gitignore new file mode 100644 index 0000000..391aacf --- /dev/null +++ b/.idea/.idea.NodeEditor/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.NodeEditor.iml +# Datasource local storage ignored files +/../../../../../../../:\Users\Liam\NodeEditor\.idea\.idea.NodeEditor\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.NodeEditor/.idea/contentModel.xml b/.idea/.idea.NodeEditor/.idea/contentModel.xml index abfd5e9..0bffd39 100644 --- a/.idea/.idea.NodeEditor/.idea/contentModel.xml +++ b/.idea/.idea.NodeEditor/.idea/contentModel.xml @@ -1,9 +1,9 @@ - - - + + + @@ -12,6 +12,8 @@ + + @@ -28,6 +30,7 @@ + diff --git a/.idea/.idea.NodeEditor/.idea/misc.xml b/.idea/.idea.NodeEditor/.idea/misc.xml new file mode 100644 index 0000000..1d8c84d --- /dev/null +++ b/.idea/.idea.NodeEditor/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.NodeEditor/.idea/modules.xml b/.idea/.idea.NodeEditor/.idea/modules.xml index cb0411a..5dffea2 100644 --- a/.idea/.idea.NodeEditor/.idea/modules.xml +++ b/.idea/.idea.NodeEditor/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/.idea.NodeEditor/.idea/workspace.xml b/.idea/.idea.NodeEditor/.idea/workspace.xml index 510e3c8..c5e7aa6 100644 --- a/.idea/.idea.NodeEditor/.idea/workspace.xml +++ b/.idea/.idea.NodeEditor/.idea/workspace.xml @@ -3,11 +3,39 @@ NodeEditor.csproj + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + @@ -24,8 +64,10 @@ + + @@ -64,14 +106,53 @@ - + + + + + diff --git a/.idea/.idea.NodeEditor/riderModule.iml b/.idea/.idea.NodeEditor/riderModule.iml new file mode 100644 index 0000000..1a4e0d9 --- /dev/null +++ b/.idea/.idea.NodeEditor/riderModule.iml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controls/Node.xaml b/Controls/Node.xaml new file mode 100644 index 0000000..1358e17 --- /dev/null +++ b/Controls/Node.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/Controls/Node.xaml.cs b/Controls/Node.xaml.cs new file mode 100644 index 0000000..4ce0e7a --- /dev/null +++ b/Controls/Node.xaml.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using System.Windows.Controls; +using System.Windows.Media; + +namespace NodeEditor.Controls +{ + /// + /// Interaction logic for Node.xaml + /// + public partial class Node : UserControl + { + public static List Nodes { get; } = new List(); + + // ReSharper disable once UnusedAutoPropertyAccessor.Global + public string Desc { get; set; } + + public Node() + { + Nodes.Add(this); + Name = GetIndexOf(this).ToString(); + Desc = ""; + InitializeComponent(); + } + public Node(string name) + { + Nodes.Add(this); + Name = name; + Desc = ""; + InitializeComponent(); + } + public Node(string name, string desc) + { + Nodes.Add(this); + Name = name; + Desc = desc; + InitializeComponent(); + } + + public static int GetIndexOf(Node node) + { + if (node != null) + return Nodes.IndexOf(node); + return -1; + } + + public void Destroy() + { + var parentObject = VisualTreeHelper.GetParent(this); + var parent = parentObject as Canvas; + + parent?.Children.Remove(this); + Nodes.Remove(this); + } + } +} diff --git a/NodeEditor.csproj b/NodeEditor.csproj index 60d1a9c..b17e1d8 100644 --- a/NodeEditor.csproj +++ b/NodeEditor.csproj @@ -65,6 +65,9 @@ EditorCanvas.xaml + + Node.xaml + @@ -72,6 +75,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer