Added custom Node control

NodesAndConnections
Liam Golly 5 years ago
parent 0cc262f92b
commit 9afbfb0443

@ -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/

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelStore">
<e p="C:\Users\jdc10\AppData\Local\JetBrains\Rider2020.3\extResources" t="IncludeRecursive" />
<e p="C:\Users\jdc10\AppData\Local\JetBrains\Rider2020.3\resharper-host\Local\Transient\Rider\v203\SolutionCaches\_NodeEditor.784521688.00" t="ExcludeRecursive" />
<e p="C:\Users\jdc10\Downloads\NodeEditor" t="IncludeRecursive">
<e p="C:\Users\Liam\AppData\Local\JetBrains\Rider2020.2\extResources" t="IncludeRecursive" />
<e p="C:\Users\Liam\AppData\Local\JetBrains\Rider2020.2\resharper-host\Local\Transient\Rider\v202\SolutionCaches\_NodeEditor.-1699062794.00" t="ExcludeRecursive" />
<e p="C:\Users\Liam\NodeEditor" t="IncludeRecursive">
<e p=".gitignore" t="Include" />
<e p="App.config" t="Include" />
<e p="App.xaml" t="Include" />
@ -12,6 +12,8 @@
<e p="Controls" t="Include">
<e p="EditorCanvas.xaml" t="Include" />
<e p="EditorCanvas.xaml.cs" t="Include" />
<e p="Node.xaml" t="Include" />
<e p="Node.xaml.cs" t="Include" />
</e>
<e p="Extensions" t="Include">
<e p="MathExtensions.cs" t="Include" />
@ -28,6 +30,7 @@
<e p="App.g.cs" t="Include" />
<e p="Controls" t="Include">
<e p="EditorCanvas.g.cs" t="Include" />
<e p="Node.g.cs" t="Include" />
</e>
<e p="GeneratedInternalTypeHelper.g.cs" t="Include" />
<e p="MainWindow.g.cs" t="Include" />

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.jetbrains.rider.android.RiderAndroidMiscFileCreationComponent">
<option name="ENSURE_MISC_FILE_EXISTS" value="true" />
</component>
</project>

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/riderModule.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.NodeEditor/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.NodeEditor/riderModule.iml" />
</modules>
</component>
</project>

@ -3,11 +3,39 @@
<component name="AutoGeneratedRunConfigurationManager">
<projectFile>NodeEditor.csproj</projectFile>
</component>
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="BRANCH:NodesAndConnections" type="e8cecc67:BranchNodeDescriptor" />
</path>
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="8d840f1a-4000-4390-ab3f-2383ed6434d5" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/Controls/EditorCanvas.xaml" beforeDir="false" afterPath="$PROJECT_DIR$/Controls/EditorCanvas.xaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Controls/EditorCanvas.xaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Controls/EditorCanvas.xaml.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main-map.png" beforeDir="false" afterPath="$PROJECT_DIR$/main-map.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/riderModule.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/contentModel.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/modules.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.NodeEditor/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/NodeEditor.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/NodeEditor.csproj" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -15,8 +43,20 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="main" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/Controls/Node.xaml.cs" />
</list>
</option>
</component>
<component name="ProjectId" id="1ltZq4ji537vQS7B5Q2SkaWibqc" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
@ -24,8 +64,10 @@
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
@ -64,14 +106,53 @@
<option name="presentableId" value="Default" />
<updated>1608418540783</updated>
<workItem from="1608418548513" duration="1911000" />
<workItem from="1608578473230" duration="1414000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="NodesAndConnections" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value>
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="NodesAndConnections" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,12 @@
<UserControl x:Class="NodeEditor.Controls.Node"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:NodeEditor.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

@ -0,0 +1,55 @@
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Media;
namespace NodeEditor.Controls
{
/// <summary>
/// Interaction logic for Node.xaml
/// </summary>
public partial class Node : UserControl
{
public static List<Node> Nodes { get; } = new List<Node>();
// 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);
}
}
}

@ -65,6 +65,9 @@
<Compile Include="Controls\EditorCanvas.xaml.cs">
<DependentUpon>EditorCanvas.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Node.xaml.cs">
<DependentUpon>Node.xaml</DependentUpon>
</Compile>
<Compile Include="Extensions\MathExtensions.cs" />
<Compile Include="Extensions\MouseExtensions.cs" />
<Compile Include="Extensions\ReadJSON.cs" />
@ -72,6 +75,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Node.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

Loading…
Cancel
Save