YED

Набор инструментов для взаимодействия с yEd Graph Editot формат

10/6/2019 11:09:33 AM

Changes

.gitignore 16(+16 -0)

YED/YED.sln 55(+55 -0)

Details

.gitignore 16(+16 -0)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ca1bdd7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+
+YED/.vs
+
+YED/yEd.XGML/bin
+YED/yEd.XGML/obj
+
+YED/Graph.Simple/bin
+YED/Graph.Simple/obj
+
+YED/YED.Console/bin
+YED/YED.Console/obj
+
+YED/Graph.Converter/bin
+YED/Graph.Converter/obj
+
+
diff --git a/YED/Build/Graph.Converter.dll b/YED/Build/Graph.Converter.dll
new file mode 100644
index 0000000..7ae56d1
Binary files /dev/null and b/YED/Build/Graph.Converter.dll differ
diff --git a/YED/Build/Graph.Converter.pdb b/YED/Build/Graph.Converter.pdb
new file mode 100644
index 0000000..95c4982
Binary files /dev/null and b/YED/Build/Graph.Converter.pdb differ
diff --git a/YED/Build/Graph.Simple.dll b/YED/Build/Graph.Simple.dll
new file mode 100644
index 0000000..573b6d7
Binary files /dev/null and b/YED/Build/Graph.Simple.dll differ
diff --git a/YED/Build/Graph.Simple.pdb b/YED/Build/Graph.Simple.pdb
new file mode 100644
index 0000000..12452de
Binary files /dev/null and b/YED/Build/Graph.Simple.pdb differ
diff --git a/YED/Build/yEd.XGML.dll b/YED/Build/yEd.XGML.dll
new file mode 100644
index 0000000..fdc50eb
Binary files /dev/null and b/YED/Build/yEd.XGML.dll differ
diff --git a/YED/Build/yEd.XGML.pdb b/YED/Build/yEd.XGML.pdb
new file mode 100644
index 0000000..0b26f41
Binary files /dev/null and b/YED/Build/yEd.XGML.pdb differ
diff --git a/YED/Graph.Converter/Converter.cs b/YED/Graph.Converter/Converter.cs
new file mode 100644
index 0000000..009a8bc
--- /dev/null
+++ b/YED/Graph.Converter/Converter.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using yEd.XGML.DocumentEntities;
+using Graph.Simple.Entities;
+
+using yEd.XGML.DocumentEntities.NodeEntitie;
+using yEd.XGML.DocumentEntities.EdgeEntitie;
+
+
+namespace Graph.Converter
+{
+    public class Converter
+    {
+        public Simple.Entities.Graph YedToGraph(Document document)
+        {
+            Simple.Entities.Graph res = new Simple.Entities.Graph();
+
+            //yEd ID, Graph ID
+            Dictionary<int, int> ID_mapper = new Dictionary<int, int>(document.Elements.Count());
+
+            foreach (var elem in document.Elements.Values)
+            {
+                if (!elem.isGroup)
+                {
+                    var n_node = res.AddNode();
+                    ID_mapper.Add(elem.id, n_node.ID);
+                }
+            }
+
+
+            foreach (var elem in document.Edges)
+            {
+                if (!res.Nodes.ContainsKey(ID_mapper[elem.source]) || !res.Nodes.ContainsKey(ID_mapper[elem.target]))
+                    continue;
+
+                var NodeStart = res.Nodes[ID_mapper[elem.source]];
+                var NodeEnd = res.Nodes[ID_mapper[elem.target]];
+                float widht = 1;
+
+                float.TryParse(elem.label, out widht);
+
+                res.AddEdge(NodeStart, NodeEnd, widht);
+            }
+
+
+            return res;
+        }
+
+        public Document GraphToYed(Simple.Entities.Graph graph)
+        {
+            Document document = new Document();
+
+            foreach (var elem in graph.Nodes.Values)
+            {
+                document.Elements.Add(elem.ID, new yEd.XGML.DocumentEntities.NodeEntitie.Node()
+                {
+                    id = elem.ID,
+                    label = "Node " + elem.ID
+                });
+            }
+
+            foreach (var elem in graph.Edges.Values)
+            {
+                document.Edges.Add(new yEd.XGML.DocumentEntities.EdgeEntitie.Edge()
+                {
+                    source = elem.Start.ID,
+                    target = elem.End.ID,
+                    label = elem.Weight.ToString()
+                });
+            }
+
+            return document;
+        }
+    }
+}
diff --git a/YED/Graph.Converter/Graph.Converter.csproj b/YED/Graph.Converter/Graph.Converter.csproj
new file mode 100644
index 0000000..0c90757
--- /dev/null
+++ b/YED/Graph.Converter/Graph.Converter.csproj
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{0AE53B32-BCB4-415E-8D19-1751222B3B96}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Graph.Converter</RootNamespace>
+    <AssemblyName>Graph.Converter</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Converter.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Graph.Simple\Graph.Simple.csproj">
+      <Project>{b4f935a8-1ab9-4555-9260-684f1ea37b0f}</Project>
+      <Name>Graph.Simple</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\yEd.XGML\yEd.XGML.csproj">
+      <Project>{25c3deca-032a-4ade-bcd0-b8616ad0ffef}</Project>
+      <Name>yEd.XGML</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/YED/Graph.Converter/Properties/AssemblyInfo.cs b/YED/Graph.Converter/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..0c7e936
--- /dev/null
+++ b/YED/Graph.Converter/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("Graph.Converter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Graph.Converter")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("0ae53b32-bcb4-415e-8d19-1751222b3b96")]
+
+// Сведения о версии сборки состоят из следующих четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//   Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/YED/Graph.Simple/Entities/Base/BaseGraphUnit.cs b/YED/Graph.Simple/Entities/Base/BaseGraphUnit.cs
new file mode 100644
index 0000000..21faa7d
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Base/BaseGraphUnit.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Graph.Simple.Enums;
+
+namespace Graph.Simple.Entities.Base
+{    
+        public abstract class BaseGraphUnit
+        {
+            #region
+
+            public ElementType Type { private set; get; }
+
+            public int ID { private set; get; }
+            public Graph Graph { private set; get; }
+
+
+            #endregion
+            
+            protected BaseGraphUnit(ElementType type, Graph graph, int ID)
+            {
+                this.Type = type;
+                this.Graph = graph;
+                this.ID = ID;
+            }
+        }
+    
+}
diff --git a/YED/Graph.Simple/Entities/Edge.cs b/YED/Graph.Simple/Entities/Edge.cs
new file mode 100644
index 0000000..4a2f32d
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Edge.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Graph.Simple.Entities.Base;
+using Graph.Simple.Enums;
+
+namespace Graph.Simple.Entities
+{
+        public class Edge : BaseGraphUnit
+        {
+            #region
+
+            public Node Start { private set; get; }
+            public Node End { private set; get; }
+            public float Weight { set; get; }
+
+            #endregion
+
+            public Edge(int ID, Graph graph, Node start, Node end) : base(ElementType.Edge, graph, ID)
+            {
+                Start = start;
+                End = end;
+            }           
+        }
+    }
diff --git a/YED/Graph.Simple/Entities/Graph.cs b/YED/Graph.Simple/Entities/Graph.cs
new file mode 100644
index 0000000..1ab23ec
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Graph.cs
@@ -0,0 +1,211 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Graph.Simple.Entities.Base;
+using Graph.Simple.Entities.Internal;
+
+namespace Graph.Simple.Entities
+{
+    public class Graph
+    {
+        #region
+
+        /// <summary>
+        /// Коллекция вершин
+        /// key - ID
+        /// value - вершина графа
+        /// </summary>
+        private Dictionary<int, GraphNode> _Nodes;
+        private Dictionary<int, Node> __Nodes;
+
+        public IReadOnlyDictionary<int, Node> Nodes => __Nodes;
+
+
+
+        /// <summary>
+        /// Коллекция ребер
+        /// key - ID
+        /// value - Ребро
+        /// </summary>
+        private Dictionary<int, GraphEdge> _Edges;
+        private Dictionary<int, Edge> __Edges;// { private set; get; }
+
+        public IReadOnlyDictionary<int, Edge> Edges => __Edges;
+
+
+
+        private int _MaxNodeID = -1;
+        private int GetNextNodeID => ++_MaxNodeID;
+
+
+        private int _MaxEdgeID = -1;
+        private int GetNextEdgeID => ++_MaxEdgeID;
+
+
+        #endregion
+
+
+        private void Init()
+        {
+            _Nodes = new Dictionary<int, GraphNode>();
+            __Nodes = new Dictionary<int, Node>();
+
+            _Edges = new Dictionary<int, GraphEdge>();
+            __Edges = new Dictionary<int, Edge>();
+        }
+
+        public Graph()
+        {
+            Init();
+        }
+
+
+        #region
+
+        /// <summary>
+        /// Метод проверяет принадлежат ли данные элементы графу
+        /// </summary>
+        /// <param name="elements"></param>
+        /// <returns></returns>
+        public bool ContainsElements(params BaseGraphUnit[] elements)
+        {
+            foreach (var elem in elements)
+            {
+                if (elem == null)
+                    return false;
+
+                if (elem.Graph != this)
+                    return false;
+            }
+
+            return true;
+        }
+
+
+        public Node AddNode()
+        {
+            var NewNode = new GraphNode(GetNextNodeID, this);
+
+            _Nodes.Add(NewNode.ID, NewNode);
+            __Nodes.Add(NewNode.ID, NewNode);
+
+            return NewNode;
+        }
+
+
+        public void RemoveNode(Node node, bool WithEdge = false)
+        {
+            if (!ContainsElements(node))
+                throw new Exception("_Graph.RemoveNode | _Graph not contains this node");
+
+            GraphNode graphNode = node as GraphNode;
+
+            if (!WithEdge && graphNode.Inputs.Count != 0)
+                throw new Exception("_Graph.RemoveNode | Node contact with edge(s), but WithEdge set false");
+
+            while (graphNode.Outputs.Count != 0)
+            {
+                RemoveEdge(graphNode.Outputs.First());
+            }
+
+            while (graphNode.Inputs.Count != 0)
+            {
+                RemoveEdge(graphNode.Inputs.First());
+            }
+
+            _Nodes.Remove(node.ID);
+            __Nodes.Remove(node.ID);
+        }
+
+        /// <summary>
+        /// Добавить ребро
+        /// </summary>
+        /// <param name="node_start">Начало</param>
+        /// <param name="node_end">Окончание</param>
+        /// <param name="Bidir">Создать двунаправленное</param>
+        /// <param name="weight">Вес</param>
+        /// <returns></returns>
+        public Edge AddEdge(Node node_start, Node node_end, float widht = 1)
+        {
+            if (!ContainsElements(node_start, node_end))
+                throw new Exception("_Graph.AddEdge | _Graph not contains node_start or/and node_end");
+
+            if (/*!UseCicleEdge &&*/ node_start == node_end)
+                throw new Exception("_Graph.AddEdge | node_start == node_end and UseCicleEdge == false");
+
+            var graphnode_start = node_start as GraphNode;
+            var graphnode_end = node_end as GraphNode;
+
+            if (/*UseMultiEdge &&*/ graphnode_start.Outputs.FirstOrDefault(e => e.End == node_end) != null
+                || (graphnode_start.Inputs.FirstOrDefault(e => e.Start == node_end) != null))
+                throw new Exception("_Graph.AddEdge | Edge already exists (maybe bidir <->), if change remove and create");
+
+            GraphEdge NewEdge = null;
+
+
+            if (widht < 0)
+                throw new Exception();
+            NewEdge = new GraphEdge(GetNextEdgeID, this, node_start, node_end)
+            {
+                Weight = widht
+            };
+
+
+            graphnode_start.Outputs.Add(NewEdge);
+            graphnode_end.Inputs.Add(NewEdge);
+
+            _Edges.Add(NewEdge.ID, NewEdge);
+            __Edges.Add(NewEdge.ID, NewEdge);
+
+            return NewEdge;
+        }
+
+        /// <summary>
+        /// Удаляет ребро и обратное ему
+        /// </summary>
+        /// <param name="edge"></param>
+        public void RemoveEdge(Edge edge)
+        {
+            if (!ContainsElements(edge))
+                throw new Exception("");
+
+            ((GraphNode)edge.Start).Outputs.Remove(edge);
+            ((GraphNode)edge.End).Inputs.Remove(edge);
+
+            _Edges.Remove(edge.ID);
+            __Edges.Remove(edge.ID);
+        }
+
+
+        public Edge GetEdge(Node node1, Node node2)
+        {
+            if (!ContainsElements(node1, node2))
+                throw new Exception("Graph.GetEdge | graph not contains nodes");
+
+            return Edges.Values.FirstOrDefault(e => e.Start.ID == node1.ID && e.End.ID == node2.ID);
+        }
+
+        #endregion
+
+
+        #region     
+
+        public void AllClear()
+        {
+            _Edges.Clear();
+            __Edges.Clear();
+            _MaxEdgeID = -1;
+
+
+            _Nodes.Clear();
+            __Nodes.Clear();
+            _MaxNodeID = -1;
+        }
+
+        #endregion
+
+    }
+}
diff --git a/YED/Graph.Simple/Entities/Internal/GraphEdge.cs b/YED/Graph.Simple/Entities/Internal/GraphEdge.cs
new file mode 100644
index 0000000..8363345
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Internal/GraphEdge.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace Graph.Simple.Entities.Internal
+{
+    internal class GraphEdge : Edge
+    {
+        public GraphEdge(int ID, Graph graph, Node Start, Node End) : base(ID, graph, Start, End) { }
+
+        public override string ToString()
+        {
+            return string.Format("GraphEdge {0} {1} -> {2}",
+                ID, Start.ID, End.ID);
+        }
+
+    }
+}
+
diff --git a/YED/Graph.Simple/Entities/Internal/GraphNode.cs b/YED/Graph.Simple/Entities/Internal/GraphNode.cs
new file mode 100644
index 0000000..483098b
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Internal/GraphNode.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Graph.Simple.Entities.Internal
+{
+    internal class GraphNode : Node
+    {
+        #region
+
+        new public List<Edge> Inputs
+        {
+            set
+            {
+                _Inputs = value;
+            }
+            get
+            {
+                return //(IReadOnlyList<Edge>)
+                _Inputs;
+            }
+        }
+        new public List<Edge> Outputs
+        {
+            set
+            {
+                _Outputs = value;
+            }
+            get
+            {
+                return //(IReadOnlyList<Edge>)
+                _Outputs;
+            }
+        }
+
+        #endregion
+
+        public GraphNode(int ID, Graph graph) : base(ID, graph) { }
+
+        public override string ToString()
+        {
+            return "GraphNode " + ID;
+        }
+
+    }
+
+}
+
+
diff --git a/YED/Graph.Simple/Entities/Node.cs b/YED/Graph.Simple/Entities/Node.cs
new file mode 100644
index 0000000..f4fbf03
--- /dev/null
+++ b/YED/Graph.Simple/Entities/Node.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Graph.Simple.Entities.Base;
+using Graph.Simple.Enums;
+
+namespace Graph.Simple.Entities
+{
+    /// <summary>
+    /// Узел графа 
+    /// </summary>
+    public class Node : BaseGraphUnit
+    {
+        #region
+
+        //Позиция вершины
+        //public Point2D Position { set; get; }
+
+
+        //Списки ребер в которых задействова данный узел
+        protected List<Edge> _Inputs { set; get; }
+        protected List<Edge> _Outputs { set; get; }
+
+
+        public IReadOnlyList<Edge> Inputs => _Inputs;
+        public IReadOnlyList<Edge> Outputs => _Outputs;
+
+        #endregion
+
+        protected Node(int ID, Graph graph) : base(ElementType.Node, graph, ID)
+        {
+            _Inputs = new List<Edge>();
+            _Outputs = new List<Edge>();
+        }
+
+    }
+}
+
diff --git a/YED/Graph.Simple/Enums/ElementType.cs b/YED/Graph.Simple/Enums/ElementType.cs
new file mode 100644
index 0000000..08cd3a8
--- /dev/null
+++ b/YED/Graph.Simple/Enums/ElementType.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Graph.Simple.Enums
+{
+    public enum ElementType
+    {
+        Node,
+        Edge
+    }
+}
diff --git a/YED/Graph.Simple/Graph.Simple.csproj b/YED/Graph.Simple/Graph.Simple.csproj
new file mode 100644
index 0000000..1e21f80
--- /dev/null
+++ b/YED/Graph.Simple/Graph.Simple.csproj
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{B4F935A8-1AB9-4555-9260-684F1EA37B0F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Graph.Simple</RootNamespace>
+    <AssemblyName>Graph.Simple</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Entities\Base\BaseGraphUnit.cs" />
+    <Compile Include="Entities\Edge.cs" />
+    <Compile Include="Entities\Graph.cs" />
+    <Compile Include="Entities\Internal\GraphEdge.cs" />
+    <Compile Include="Entities\Internal\GraphNode.cs" />
+    <Compile Include="Entities\Node.cs" />
+    <Compile Include="Enums\ElementType.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/YED/Graph.Simple/Graph.Simple.csproj.user b/YED/Graph.Simple/Graph.Simple.csproj.user
new file mode 100644
index 0000000..6cbe588
--- /dev/null
+++ b/YED/Graph.Simple/Graph.Simple.csproj.user
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/YED/Graph.Simple/Properties/AssemblyInfo.cs b/YED/Graph.Simple/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..73ce5ee
--- /dev/null
+++ b/YED/Graph.Simple/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("Graph.Simple")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Graph.Simple")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("b4f935a8-1ab9-4555-9260-684f1ea37b0f")]
+
+// Сведения о версии сборки состоят из следующих четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//   Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/YED/YED.Console/App.config b/YED/YED.Console/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/YED/YED.Console/App.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+    </startup>
+</configuration>
\ No newline at end of file
diff --git a/YED/YED.Console/Documents/Document1.xgml b/YED/YED.Console/Documents/Document1.xgml
new file mode 100644
index 0000000..806263b
--- /dev/null
+++ b/YED/YED.Console/Documents/Document1.xgml
@@ -0,0 +1,373 @@
+<?xml version="1.0" encoding="Cp1251"?>
+<section name="xgml">
+	<attribute key="Creator" type="String">yFiles</attribute>
+	<attribute key="Version" type="String">2.14</attribute>
+	<section name="graph">
+		<attribute key="hierarchic" type="int">1</attribute>
+		<attribute key="label" type="String"></attribute>
+		<attribute key="directed" type="int">1</attribute>
+		<section name="node">
+			<attribute key="id" type="int">0</attribute>
+			<attribute key="label" type="String">H</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">365.0</attribute>
+				<attribute key="y" type="double">176.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">rectangle</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">H</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">1</attribute>
+			<attribute key="label" type="String">E</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">411.0</attribute>
+				<attribute key="y" type="double">176.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">rectangle3d</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">E</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">2</attribute>
+			<attribute key="label" type="String">L</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">457.0</attribute>
+				<attribute key="y" type="double">176.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">roundrectangle</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">L</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">3</attribute>
+			<attribute key="label" type="String">L</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">503.0</attribute>
+				<attribute key="y" type="double">176.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">diamond</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">L</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">4</attribute>
+			<attribute key="label" type="String">O</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">549.0</attribute>
+				<attribute key="y" type="double">176.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">ellipse</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">O</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">5</attribute>
+			<attribute key="label" type="String">W</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">371.0</attribute>
+				<attribute key="y" type="double">273.37646484375</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">fatarrow</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">W</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">6</attribute>
+			<attribute key="label" type="String">O</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">411.0</attribute>
+				<attribute key="y" type="double">273.37646484375</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">fatarrow2</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">O</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">7</attribute>
+			<attribute key="label" type="String">R</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">451.0</attribute>
+				<attribute key="y" type="double">273.37646484375</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">hexagon</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">R</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">8</attribute>
+			<attribute key="label" type="String">L</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">491.0</attribute>
+				<attribute key="y" type="double">273.37646484375</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">octagon</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">L</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">9</attribute>
+			<attribute key="label" type="String">D</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">536.0</attribute>
+				<attribute key="y" type="double">273.37646484375</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">parallelogram</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">D</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">10</attribute>
+			<attribute key="label" type="String">Group A</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">453.5</attribute>
+				<attribute key="y" type="double">322.2668134765626</attribute>
+				<attribute key="w" type="double">225.0</attribute>
+				<attribute key="h" type="double">202.53362695312524</attribute>
+				<attribute key="type" type="String">rectangle</attribute>
+				<attribute key="fill" type="String">#F2F0D8</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+				<attribute key="topBorderInset" type="double">0.0</attribute>
+				<attribute key="bottomBorderInset" type="double">0.0</attribute>
+				<attribute key="leftBorderInset" type="double">0.0</attribute>
+				<attribute key="rightBorderInset" type="double">0.0</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">Group A</attribute>
+				<attribute key="fill" type="String">#B7B69E</attribute>
+				<attribute key="fontSize" type="int">15</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="alignment" type="String">right</attribute>
+				<attribute key="autoSizePolicy" type="String">node_width</attribute>
+				<attribute key="anchor" type="String">t</attribute>
+				<attribute key="borderDistance" type="double">0.0</attribute>
+			</section>
+			<attribute key="isGroup" type="boolean">true</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">11</attribute>
+			<attribute key="label" type="String">3</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">451.0</attribute>
+				<attribute key="y" type="double">361.4550458984376</attribute>
+				<attribute key="w" type="double">60.760000000000105</attribute>
+				<attribute key="h" type="double">86.15716210937524</attribute>
+				<attribute key="type" type="String">rectangle</attribute>
+				<attribute key="fill" type="String">#F2F0D8</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+				<attribute key="topBorderInset" type="double">0.0</attribute>
+				<attribute key="bottomBorderInset" type="double">3.7806972656252356</attribute>
+				<attribute key="leftBorderInset" type="double">0.38000000000010914</attribute>
+				<attribute key="rightBorderInset" type="double">0.37999999999999545</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">3</attribute>
+				<attribute key="fill" type="String">#B7B69E</attribute>
+				<attribute key="fontSize" type="int">15</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="alignment" type="String">right</attribute>
+				<attribute key="autoSizePolicy" type="String">node_width</attribute>
+				<attribute key="anchor" type="String">t</attribute>
+				<attribute key="borderDistance" type="double">0.0</attribute>
+			</section>
+			<attribute key="isGroup" type="boolean">true</attribute>
+			<attribute key="gid" type="int">10</attribute>
+		</section>
+		<section name="node">
+			<attribute key="id" type="int">12</attribute>
+			<attribute key="label" type="String">!</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">451.00000000000006</attribute>
+				<attribute key="y" type="double">370.7529296875</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">triangle</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">!</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="model"/>
+			</section>
+			<attribute key="gid" type="int">11</attribute>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">0</attribute>
+			<attribute key="target" type="int">1</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">1</attribute>
+			<attribute key="target" type="int">2</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">2</attribute>
+			<attribute key="target" type="int">3</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">3</attribute>
+			<attribute key="target" type="int">4</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">4</attribute>
+			<attribute key="target" type="int">5</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">5</attribute>
+			<attribute key="target" type="int">6</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">6</attribute>
+			<attribute key="target" type="int">7</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">7</attribute>
+			<attribute key="target" type="int">8</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">8</attribute>
+			<attribute key="target" type="int">9</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+		<section name="edge">
+			<attribute key="source" type="int">9</attribute>
+			<attribute key="target" type="int">12</attribute>
+			<section name="graphics">
+				<attribute key="fill" type="String">#000000</attribute>
+				<attribute key="targetArrow" type="String">standard</attribute>
+			</section>
+		</section>
+	</section>
+</section>
diff --git a/YED/YED.Console/Program.cs b/YED/YED.Console/Program.cs
new file mode 100644
index 0000000..68180e4
--- /dev/null
+++ b/YED/YED.Console/Program.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Threading;
+using System.Globalization;
+
+using YED.Console.Test;
+
+namespace YED
+{
+    class Program
+    {        
+        static void Main(string[] args)
+        {
+            //Необходимо для того, чтобы double и float парсились из формата 10.10, а не 10,10
+            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
+
+            new Test1_ReadWrite().Test(true, true);
+            new Test2_CreateGraph_and_ExportToYed().Test(true);            
+        }
+    }
+}
diff --git a/YED/YED.Console/Properties/AssemblyInfo.cs b/YED/YED.Console/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6c0fe8c
--- /dev/null
+++ b/YED/YED.Console/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("YED.Console")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("YED.Console")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("a28a776b-20c2-4dfb-b3af-f2ff75f830f4")]
+
+// Сведения о версии сборки состоят из следующих четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//   Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/YED/YED.Console/Test/Test1_ReadWrite.cs b/YED/YED.Console/Test/Test1_ReadWrite.cs
new file mode 100644
index 0000000..23c8f10
--- /dev/null
+++ b/YED/YED.Console/Test/Test1_ReadWrite.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Diagnostics;
+
+using yEd.XGML.IO;
+
+namespace YED.Console.Test
+{
+    /// <summary>
+    /// Проверка чтения записи yed XGML файла.
+    /// TestFile_Dst файл должен открываться в yed и должен быть схожим(одинаковым) с Src.
+    /// </summary>
+    public class Test1_ReadWrite
+    {
+        public void Test(bool OpenSrc = false, bool OpenDst = false)
+        {
+            string TestFile_Src = @"Documents\Document1.xgml";
+            string TestFile_Dst = @"Documents\Document1_Copy.xgml";
+
+            //Котыль
+            XGML_Reader.DropEncodingAttribute(TestFile_Src);
+
+            var xgml_model = new XGML_Reader().Read(TestFile_Src);
+            new XGML_Writer().Write(xgml_model, TestFile_Dst);
+
+            if (OpenSrc)
+                Process.Start(TestFile_Src);
+            if (OpenDst)
+                Process.Start(TestFile_Dst);
+        }
+    }
+}
diff --git a/YED/YED.Console/Test/Test2_CreateGraph_and_ExportToYed.cs b/YED/YED.Console/Test/Test2_CreateGraph_and_ExportToYed.cs
new file mode 100644
index 0000000..894f1cf
--- /dev/null
+++ b/YED/YED.Console/Test/Test2_CreateGraph_and_ExportToYed.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Diagnostics;
+using System.Drawing;
+
+using Graph.Simple.Entities;
+using Graph.Converter;
+using yEd.XGML.IO;
+using yEd.XGML.DocumentEntities.NodeEntitie;
+
+namespace YED.Console.Test
+{
+    /// <summary>
+    /// Тест 
+    /// 1) Создает Graph.Simple.Entities.Graph
+    /// 2) Конвертирует в yed xgml формат с помощью Graph.Converter
+    /// 3) Записывает получившийся document в файл
+    /// </summary>
+    public class Test2_CreateGraph_and_ExportToYed
+    {
+        public void Test(bool OpenDst = false)
+        {
+            string TestFile_Dst = @"Documents\Document2_Created.xgml";
+
+            //Создание графа
+            Graph.Simple.Entities.Graph graph = new Graph.Simple.Entities.Graph();
+
+            for (int i = 0; i < 3; i++)
+                graph.AddNode();
+
+            graph.AddEdge(graph.Nodes[1], graph.Nodes[0], 10);
+            graph.AddEdge(graph.Nodes[2], graph.Nodes[0], 20);
+
+
+            //Экспорт в XDGM Document
+            var doc = new Converter().GraphToYed(graph);
+
+
+            //Изменение на уровне XDGM Document
+            var nodes = doc.Elements.Values
+                .OfType<yEd.XGML.DocumentEntities.NodeEntitie.Node>()
+                .ToList();
+
+            nodes[0].graphics.fill = Color.Red;
+            nodes[1].graphics.x -= 100;
+            nodes[2].graphics.x += 100;
+
+            //Запись
+            new XGML_Writer().Write(doc, TestFile_Dst);
+
+            if (OpenDst)
+                Process.Start(TestFile_Dst);
+        }
+    }
+}
diff --git a/YED/YED.Console/YED.Console.csproj b/YED/YED.Console/YED.Console.csproj
new file mode 100644
index 0000000..bf67fcf
--- /dev/null
+++ b/YED/YED.Console/YED.Console.csproj
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>YED.Console</RootNamespace>
+    <AssemblyName>YED.Console</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Test\Test1_ReadWrite.cs" />
+    <Compile Include="Test\Test2_CreateGraph_and_ExportToYed.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="Documents\Document1.xgml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Graph.Converter\Graph.Converter.csproj">
+      <Project>{0ae53b32-bcb4-415e-8d19-1751222b3b96}</Project>
+      <Name>Graph.Converter</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Graph.Simple\Graph.Simple.csproj">
+      <Project>{b4f935a8-1ab9-4555-9260-684f1ea37b0f}</Project>
+      <Name>Graph.Simple</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\yEd.XGML\yEd.XGML.csproj">
+      <Project>{25c3deca-032a-4ade-bcd0-b8616ad0ffef}</Project>
+      <Name>yEd.XGML</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file

YED/YED.sln 55(+55 -0)

diff --git a/YED/YED.sln b/YED/YED.sln
new file mode 100644
index 0000000..ac18b78
--- /dev/null
+++ b/YED/YED.sln
@@ -0,0 +1,55 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.136
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "yEd.XGML", "yEd.XGML\yEd.XGML.csproj", "{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Graph.Simple", "Graph.Simple\Graph.Simple.csproj", "{B4F935A8-1AB9-4555-9260-684F1EA37B0F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Graph.Converter", "Graph.Converter\Graph.Converter.csproj", "{0AE53B32-BCB4-415E-8D19-1751222B3B96}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "YED", "YED", "{33CC1446-8A73-4531-953E-AC6364E2CAF3}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Graph", "Graph", "{7876A4C6-1224-4A90-83BC-8C74BA139FA0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test@Examples", "Test@Examples", "{387A40F0-7591-4D05-87D0-CB7559AAF450}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YED.Console", "YED.Console\YED.Console.csproj", "{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B4F935A8-1AB9-4555-9260-684F1EA37B0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B4F935A8-1AB9-4555-9260-684F1EA37B0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B4F935A8-1AB9-4555-9260-684F1EA37B0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B4F935A8-1AB9-4555-9260-684F1EA37B0F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0AE53B32-BCB4-415E-8D19-1751222B3B96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0AE53B32-BCB4-415E-8D19-1751222B3B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0AE53B32-BCB4-415E-8D19-1751222B3B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0AE53B32-BCB4-415E-8D19-1751222B3B96}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF} = {33CC1446-8A73-4531-953E-AC6364E2CAF3}
+		{B4F935A8-1AB9-4555-9260-684F1EA37B0F} = {7876A4C6-1224-4A90-83BC-8C74BA139FA0}
+		{0AE53B32-BCB4-415E-8D19-1751222B3B96} = {7876A4C6-1224-4A90-83BC-8C74BA139FA0}
+		{A28A776B-20C2-4DFB-B3AF-F2FF75F830F4} = {387A40F0-7591-4D05-87D0-CB7559AAF450}
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {4CEB63E6-AB0C-41C1-A6C6-3084B21F940A}
+	EndGlobalSection
+EndGlobal
diff --git a/YED/yEd.XGML/DocumentEntities/Base/IElement.cs b/YED/yEd.XGML/DocumentEntities/Base/IElement.cs
new file mode 100644
index 0000000..664e954
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/Base/IElement.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace yEd.XGML.DocumentEntities.Base
+{
+    public interface IElement
+    {
+        int id { set; get; }
+        string label { set; get; }
+
+
+        bool isGroup { get; }
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/Document.cs b/YED/yEd.XGML/DocumentEntities/Document.cs
new file mode 100644
index 0000000..6813dba
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/Document.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using yEd.XGML.DocumentEntities.Base;
+using yEd.XGML.DocumentEntities.NodeEntitie;
+using yEd.XGML.DocumentEntities.EdgeEntitie;
+using yEd.XGML.DocumentEntities.GroupNodeEntitie;
+
+namespace yEd.XGML.DocumentEntities
+{
+    public class Document
+    {
+        public string Creator { set; get; } = "yFiles";
+        public string Version { set; get; } = "2.14";
+
+
+        public int hierarchic => 1;
+        public string label => "";
+        public int directed => 1;
+
+
+        public Dictionary<int, IElement> Elements { private set; get; } = new Dictionary<int, IElement>();
+
+        //public IDictionary<int, Node> Nodes => Elements.OfType<>();
+
+
+        public List<Edge> Edges { private set; get; } = new List<Edge>();
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/EdgeEntitie/Edge.cs b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/Edge.cs
new file mode 100644
index 0000000..a4dabf6
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/Edge.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace yEd.XGML.DocumentEntities.EdgeEntitie
+{
+    public class Edge
+    {
+        /// <summary>
+        /// Src node
+        /// </summary>
+        public int source { set; get; }
+
+        /// <summary>
+        /// Target node
+        /// </summary>
+        public int target { set; get; }
+
+        public string label { set; get; }
+
+        public EdgeGraphics Graphics { set; get; } = new EdgeGraphics();
+        public EdgeLabelGraphics LabelGraphics { set; get; } = new EdgeLabelGraphics();
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeGraphics.cs b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeGraphics.cs
new file mode 100644
index 0000000..397c7f3
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeGraphics.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Drawing;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.EdgeEntitie
+{
+    public class EdgeGraphics
+    {
+        public Color fill { set; get; } = ColorTranslator.FromHtml("#000000");
+        public EnumArrowType targetArrow { set; get; } = EnumArrowType.standard;
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeLabelGraphics.cs b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeLabelGraphics.cs
new file mode 100644
index 0000000..57e7274
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/EdgeEntitie/EdgeLabelGraphics.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.EdgeEntitie
+{
+    public class EdgeLabelGraphics
+    {
+        //text" type="S
+
+        public int fontSize { set; get; } = 12;
+        public EnumFont fontName { set; get; } = EnumFont.Dialog;
+
+        public string configuration => "AutoFlippingLabel";
+        public double contentWidth { set; get; }
+        public double  contentHeight { set; get; }
+        //model"/>
+        //position"/>
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNode.cs b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNode.cs
new file mode 100644
index 0000000..4b5a517
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNode.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using yEd.XGML.DocumentEntities.Base;
+
+namespace yEd.XGML.DocumentEntities.GroupNodeEntitie
+{
+    public class GroupNode : IElement
+    {
+        public int id { set; get; }
+        public string label { set; get; }
+
+        public GroupsNodeGraphics graphics { set; get; } = new GroupsNodeGraphics();
+        public GroupNodeLabelGraphics LabelGraphics { set; get; } = new GroupNodeLabelGraphics();
+
+
+        /// <summary>
+        /// ID GroupNode, к которому принадлежит элемент. Null - в корне графа
+        /// </summary>
+        public int? gid { set; get; } = null;
+
+        public bool isGroup => true;
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNodeLabelGraphics.cs b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNodeLabelGraphics.cs
new file mode 100644
index 0000000..41aaae4
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupNodeLabelGraphics.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Drawing;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.GroupNodeEntitie
+{
+    public class GroupNodeLabelGraphics
+    {
+        public string text { set; get; }
+        public Color fill { set; get; } = ColorTranslator.FromHtml("#B7B69E");
+        public int fontSize { set; get; } = 15;
+        public EnumFont fontName { set; get; } = EnumFont.Dialog;
+        public string alignment => "right";
+        public string autoSizePolicy => "node_width";
+        public string anchor => "t";
+        public double borderDistance { set; get; }
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupsNodeGraphics.cs b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupsNodeGraphics.cs
new file mode 100644
index 0000000..a1e8fc7
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/GroupNodeEntitie/GroupsNodeGraphics.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Drawing;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.GroupNodeEntitie
+{
+    public class GroupsNodeGraphics
+    {
+        /// <summary>
+        /// X coordinate
+        /// </summary>
+        public double x { set; get; }
+        /// <summary>
+        /// Y coordinate
+        /// </summary>
+        public double y { set; get; }
+        /// <summary>
+        /// Widht
+        /// </summary>
+        public double w { set; get; } = 50;
+        /// <summary>
+        /// Height
+        /// </summary>
+        public double h { set; get; } = 50;
+        /// <summary>
+        /// Geometri type
+        /// </summary>
+        public EnumNodeType type { set; get; } = EnumNodeType.rectangle;
+
+        /// <summary>
+        /// Fill color
+        /// </summary>
+        public Color fill { set; get; } = ColorTranslator.FromHtml("#F2F0D8");
+        /// <summary>
+        /// Outline Color
+        /// </summary>
+        public Color outline { set; get; } = ColorTranslator.FromHtml("#000000");
+
+
+        public double topBorderInset { set; get; }
+        public double bottomBorderInset { set; get; }
+        public double leftBorderInset { set; get; }
+        public double rightBorderInset { set; get; }
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/NodeEntitie/Node.cs b/YED/yEd.XGML/DocumentEntities/NodeEntitie/Node.cs
new file mode 100644
index 0000000..7c21a81
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/NodeEntitie/Node.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using yEd.XGML.DocumentEntities.Base;
+
+namespace yEd.XGML.DocumentEntities.NodeEntitie
+{
+    public class Node : IElement
+    {
+        public int id { set; get; }
+        public string label { set; get; }
+
+        public NodeGraphics graphics { set; get; } = new NodeGraphics();
+        public NodeLabelGraphics LabelGraphics { set; get; } = new NodeLabelGraphics();
+
+
+        /// <summary>
+        /// ID GroupNode, к которому принадлежит элемент. Null - в корне графа
+        /// </summary>
+        public int? gid { set; get; } = null;
+
+        public bool isGroup => false;
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeGraphics.cs b/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeGraphics.cs
new file mode 100644
index 0000000..561c6f4
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeGraphics.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Drawing;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.NodeEntitie
+{
+    public class NodeGraphics
+    {
+        /// <summary>
+        /// X coordinate
+        /// </summary>
+        public double x { set; get; } = 0;
+        /// <summary>
+        /// Y coordinate
+        /// </summary>
+        public double y { set; get; } = 0;
+        /// <summary>
+        /// Widht
+        /// </summary>
+        public double w { set; get; } = 30;
+        /// <summary>
+        /// Height
+        /// </summary>
+        public double h { set; get; } = 30;
+        /// <summary>
+        /// Geometri type
+        /// </summary>
+        public EnumNodeType type { set; get; } = EnumNodeType.ellipse;
+        public bool raisedBorder { set; get; } = false;
+        /// <summary>
+        /// Fill color
+        /// </summary>
+        public Color fill { set; get; } = ColorTranslator.FromHtml("#FFCC00");
+        /// <summary>
+        /// Outline Color
+        /// </summary>
+        public Color outline { set; get; } = ColorTranslator.FromHtml("#000000");
+    }
+}
diff --git a/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeLabelGraphics.cs b/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeLabelGraphics.cs
new file mode 100644
index 0000000..c924e81
--- /dev/null
+++ b/YED/yEd.XGML/DocumentEntities/NodeEntitie/NodeLabelGraphics.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.DocumentEntities.NodeEntitie
+{
+    public class NodeLabelGraphics
+    {
+        //public string text { set; get; }
+
+        /// <summary>
+        /// Размер шрифты
+        /// </summary>
+        public int fontSize { set; get; } = 12;
+
+        /// <summary>
+        /// тип шрифта
+        /// </summary>
+        public EnumFont fontName { set; get; } = EnumFont.Dialog;
+
+        public string anchor => "c";
+    }
+}
diff --git a/YED/yEd.XGML/Enums/EnumArrowType.cs b/YED/yEd.XGML/Enums/EnumArrowType.cs
new file mode 100644
index 0000000..7530b84
--- /dev/null
+++ b/YED/yEd.XGML/Enums/EnumArrowType.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace yEd.XGML.Enums
+{
+    public enum EnumArrowType
+    {
+        standard
+    }
+}
diff --git a/YED/yEd.XGML/Enums/EnumFont.cs b/YED/yEd.XGML/Enums/EnumFont.cs
new file mode 100644
index 0000000..359a49a
--- /dev/null
+++ b/YED/yEd.XGML/Enums/EnumFont.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace yEd.XGML.Enums
+{
+    public enum EnumFont
+    {
+        Dialog
+    }
+}
diff --git a/YED/yEd.XGML/Enums/EnumFontStyle.cs b/YED/yEd.XGML/Enums/EnumFontStyle.cs
new file mode 100644
index 0000000..6ccf6d1
--- /dev/null
+++ b/YED/yEd.XGML/Enums/EnumFontStyle.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace yEd.XGML.Enums
+{
+    public enum EnumFontStyle
+    {
+        plain,
+        bold,
+        italic,
+        bolditalic
+    }
+}
diff --git a/YED/yEd.XGML/Enums/EnumNodeType.cs b/YED/yEd.XGML/Enums/EnumNodeType.cs
new file mode 100644
index 0000000..0e8319e
--- /dev/null
+++ b/YED/yEd.XGML/Enums/EnumNodeType.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace yEd.XGML.Enums
+{
+    public enum EnumNodeType
+    {
+        rectangle,
+        rectangle3d,
+        roundrectangle,
+        diamond,
+        ellipse,
+        fatarrow,
+        fatarrow2,
+        hexagon,
+        octagon,
+        parallelogram,
+        parallelogram2,
+        star5,
+        star6,
+        star8,
+        trapezoid,
+        trapezoid2,
+        triangle,
+        triangle2,
+    }
+}
diff --git a/YED/yEd.XGML/IO/Read/EdgeReader.cs b/YED/yEd.XGML/IO/Read/EdgeReader.cs
new file mode 100644
index 0000000..44e127d
--- /dev/null
+++ b/YED/yEd.XGML/IO/Read/EdgeReader.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+using System.Drawing;
+
+using yEd.XGML.DocumentEntities.EdgeEntitie;
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.IO.Read
+{
+    public class EdgeReader : IReader<Edge>
+    {
+        public Edge Read(XElement element)
+        {
+            Edge res = new Edge();
+
+            res.source = int.Parse(element.GetChild_Attribute("source").Value);
+            res.target = int.Parse(element.GetChild_Attribute("target").Value);
+            res.label = element.GetChild_Attribute("label")?.Value;
+
+            res.Graphics = Readgraphics(element.GetChild_Section("graphics"));
+            res.LabelGraphics = ReadLabelGraphics(element.GetChild_Section("LabelGraphics"));
+
+            return res;
+        }
+
+        private EdgeGraphics Readgraphics(XElement graphics)
+        {
+            EdgeGraphics res = new EdgeGraphics();
+
+            res.fill = ColorTranslator.FromHtml(graphics.GetChild_Attribute("fill").Value);
+            res.targetArrow = (EnumArrowType)Enum.Parse(typeof(EnumArrowType), graphics.GetChild_Attribute("targetArrow").Value);
+
+            return res;
+        }
+
+        private EdgeLabelGraphics ReadLabelGraphics(XElement label)
+        {
+            if (label == null)
+                return null;
+
+            EdgeLabelGraphics res = new EdgeLabelGraphics();
+
+            res.fontSize = int.Parse(label.GetChild_Attribute("fontSize").Value);
+            res.fontName = (EnumFont)Enum.Parse(typeof(EnumFont), label.GetChild_Attribute("fontName").Value);
+            res.contentWidth = double.Parse(label.GetChild_Attribute("contentWidth").Value);
+            res.contentHeight = double.Parse(label.GetChild_Attribute("contentHeight").Value);
+
+            return res;
+        }
+    }
+}
diff --git a/YED/yEd.XGML/IO/Read/IReader.cs b/YED/yEd.XGML/IO/Read/IReader.cs
new file mode 100644
index 0000000..0af4db1
--- /dev/null
+++ b/YED/yEd.XGML/IO/Read/IReader.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+namespace yEd.XGML.IO.Read
+{
+    internal interface IReader<T>
+    {
+        T Read(XElement element);
+    }
+}
diff --git a/YED/yEd.XGML/IO/Read/NodeGroupReader.cs b/YED/yEd.XGML/IO/Read/NodeGroupReader.cs
new file mode 100644
index 0000000..55e49ac
--- /dev/null
+++ b/YED/yEd.XGML/IO/Read/NodeGroupReader.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+using System.Drawing;
+
+using yEd.XGML.DocumentEntities.GroupNodeEntitie;
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.IO.Read
+{
+    internal class NodeGroupReader : IReader<GroupNode>
+    {
+        public GroupNode Read(XElement element)
+        {
+            GroupNode res = new GroupNode();
+
+            res.id = int.Parse(element.GetChild_Attribute("id").Value);
+            res.label = element.GetChild_Attribute("label").Value;
+
+            res.graphics = ReadGroupsNodeGraphics(element.GetChild_Section("graphics"));
+            res.LabelGraphics = ReadGroupNodeLabelGraphics(element.GetChild_Section("LabelGraphics"));
+
+            var gid_attrib = element.GetChild_Attribute("gid");
+            if (gid_attrib != null)
+                res.gid = int.Parse(gid_attrib.Value);
+
+            return res;
+        }
+
+        private GroupsNodeGraphics ReadGroupsNodeGraphics(XElement graphics)
+        {
+            GroupsNodeGraphics res = new GroupsNodeGraphics();
+
+            res.x = double.Parse(graphics.GetChild_Attribute("x").Value);
+            res.y = double.Parse(graphics.GetChild_Attribute("y").Value);
+            res.w = double.Parse(graphics.GetChild_Attribute("w").Value);
+            res.h = double.Parse(graphics.GetChild_Attribute("h").Value);
+            res.type = (EnumNodeType)Enum.Parse(typeof(EnumNodeType), graphics.GetChild_Attribute("type").Value);
+            res.fill = ColorTranslator.FromHtml(graphics.GetChild_Attribute("fill").Value);
+            res.outline = ColorTranslator.FromHtml(graphics.GetChild_Attribute("outline").Value);
+            res.topBorderInset = double.Parse(graphics.GetChild_Attribute("topBorderInset").Value);
+            res.bottomBorderInset = double.Parse(graphics.GetChild_Attribute("bottomBorderInset").Value);
+            res.leftBorderInset = double.Parse(graphics.GetChild_Attribute("leftBorderInset").Value);
+            res.rightBorderInset = double.Parse(graphics.GetChild_Attribute("rightBorderInset").Value);
+
+            return res;
+        }
+
+        private GroupNodeLabelGraphics ReadGroupNodeLabelGraphics(XElement LabelGraphics)
+        {
+            GroupNodeLabelGraphics res = new GroupNodeLabelGraphics();
+
+            res.fill = ColorTranslator.FromHtml(LabelGraphics.GetChild_Attribute("fill").Value);
+            res.fontSize = int.Parse(LabelGraphics.GetChild_Attribute("fontSize").Value);
+            res.fontName = (EnumFont)Enum.Parse(typeof(EnumFont), LabelGraphics.GetChild_Attribute("fontName").Value);
+            res.borderDistance = double.Parse(LabelGraphics.GetChild_Attribute("borderDistance").Value);
+
+            return res;
+        }
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/Read/NodeReader.cs b/YED/yEd.XGML/IO/Read/NodeReader.cs
new file mode 100644
index 0000000..623ef82
--- /dev/null
+++ b/YED/yEd.XGML/IO/Read/NodeReader.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+using System.Drawing;
+
+using yEd.XGML.DocumentEntities.NodeEntitie;
+using yEd.XGML.Enums;
+
+namespace yEd.XGML.IO.Read
+{
+    internal class NodeReader : IReader<Node>
+    {
+        public Node Read(XElement element)
+        {
+            Node res = new Node();
+
+            res.id = int.Parse(element.GetChild_Attribute("id").Value);
+            res.label = element.GetChild_Attribute("label").Value;
+
+
+            res.graphics = ReadGraphics(element.GetChild_Section("graphics"));
+            res.LabelGraphics = ReadLabelGraphics(element.GetChild_Section("LabelGraphics"));
+
+
+            var gid_attrib = element.GetChild_Attribute("gid");
+            if (gid_attrib != null)
+                res.gid = int.Parse(gid_attrib.Value);                       
+
+
+            return res;
+        }
+
+        private NodeGraphics ReadGraphics(XElement graphics)
+        {
+            NodeGraphics res = new NodeGraphics();
+
+            res.x = double.Parse(graphics.GetChild_Attribute("x").Value);
+            res.y = double.Parse(graphics.GetChild_Attribute("y").Value);
+            res.w = double.Parse(graphics.GetChild_Attribute("w").Value);
+            res.h = double.Parse(graphics.GetChild_Attribute("h").Value);
+            res.type = (EnumNodeType)Enum.Parse(typeof(EnumNodeType), graphics.GetChild_Attribute("type").Value);
+            res.raisedBorder = bool.Parse(graphics.GetChild_Attribute("raisedBorder").Value);
+            res.fill = ColorTranslator.FromHtml(graphics.GetChild_Attribute("fill").Value);
+            res.outline = ColorTranslator.FromHtml(graphics.GetChild_Attribute("outline").Value);
+
+            return res;
+        }
+
+        private NodeLabelGraphics ReadLabelGraphics(XElement LabelGraphics)
+        {
+            NodeLabelGraphics res = new NodeLabelGraphics();
+
+            res.fontSize = int.Parse(LabelGraphics.GetChild_Attribute("fontSize").Value);
+            res.fontName = (EnumFont)Enum.Parse(typeof(EnumFont), LabelGraphics.GetChild_Attribute("fontName").Value);
+
+            return res;
+        }
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/Read/XElement_Extension.cs b/YED/yEd.XGML/IO/Read/XElement_Extension.cs
new file mode 100644
index 0000000..54237c6
--- /dev/null
+++ b/YED/yEd.XGML/IO/Read/XElement_Extension.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+namespace yEd.XGML.IO.Read
+{
+    internal static class XElement_Extension
+    {
+        public static XElement GetChild_Section(this XElement element, string name) =>
+               element.Elements("section")
+                   .FirstOrDefault(e => e.Attribute("name")
+                       .Value == name);
+
+        public static XElement GetChild_Attribute(this XElement element, string key) =>
+            element.Elements("attribute")
+                .FirstOrDefault(e => e.Attribute("key")
+                    .Value == key);
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/EdgeWriter.cs b/YED/yEd.XGML/IO/Write/EdgeWriter.cs
new file mode 100644
index 0000000..29e39ce
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/EdgeWriter.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+using yEd.XGML.IO.Write.Tools;
+using yEd.XGML.DocumentEntities.EdgeEntitie;
+
+namespace yEd.XGML.IO.Write
+{
+    internal class EdgeWriter : IWriter<Edge>
+    {
+        public XElement Write(Edge elem)
+        {
+            XElement res = XElement_Tools.CreateSection("edge");
+
+            res.Add(XElement_Tools.CreateAttribute("source", "int", elem.source));
+            res.Add(XElement_Tools.CreateAttribute("target", "int", elem.target));
+            if (elem.label != null)
+                res.Add(XElement_Tools.CreateAttribute("label", "String", elem.label));
+
+
+            res.Add(WriteGraphics(elem.Graphics));
+            if (elem.label != null)
+                WriteLabelGraphics(elem);
+
+
+            return res;
+        }
+
+        private XElement WriteGraphics(EdgeGraphics graphics)
+        {
+            XElement res = XElement_Tools.CreateSection("graphics");
+
+            res.Add(XElement_Tools.CreateAttribute("fill", "String", Color_Tools.ColorToHex(graphics.fill)));
+            res.Add(XElement_Tools.CreateAttribute("targetArrow", "String", graphics.targetArrow));
+
+            return res;
+        }
+        private XElement WriteLabelGraphics(Edge elem)
+        {
+            XElement LabelGraphics = XElement_Tools.CreateSection("LabelGraphics");
+
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("text", "String", elem.label));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontSize", "int", elem.LabelGraphics.fontSize.ToString()));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontName", "String", elem.LabelGraphics.fontName));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("configuration", "String", elem.LabelGraphics.configuration));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("contentWidth", "String", elem.LabelGraphics.contentWidth));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("contentHeight", "String", elem.LabelGraphics.contentHeight));
+            LabelGraphics.Add(new XElement("attribute", new XAttribute("key", "model")));
+            LabelGraphics.Add(new XElement("attribute", new XAttribute("key", "position")));
+
+            return LabelGraphics;
+        }
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/GroupNodeWriter.cs b/YED/yEd.XGML/IO/Write/GroupNodeWriter.cs
new file mode 100644
index 0000000..3e796a1
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/GroupNodeWriter.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+using yEd.XGML.IO.Write.Tools;
+using yEd.XGML.DocumentEntities.GroupNodeEntitie;
+
+namespace yEd.XGML.IO.Write
+{
+    internal class GroupNodeWriter : IWriter<GroupNode>
+    {
+        public XElement Write(GroupNode elem)
+        {
+            var res = XElement_Tools.CreateSection("node");
+
+            res.Add(XElement_Tools.CreateAttribute("id", "int", elem.id.ToString()));
+            res.Add(XElement_Tools.CreateAttribute("label", "String", elem.label));
+
+
+            res.Add(WriteGraphics(elem.graphics));
+            res.Add(WriteLabelGraphics(elem));
+
+            res.Add(XElement_Tools.CreateAttribute("isGroup", "boolean", elem.isGroup.ToString().ToLower()));
+            if (elem.gid.HasValue)
+                res.Add(XElement_Tools.CreateAttribute("gid", "int", elem.gid));
+
+            return res;
+        }
+
+        private XElement WriteGraphics(GroupsNodeGraphics GroupsNodeGraphics)
+        {
+            XElement graphics = XElement_Tools.CreateSection("graphics");
+
+            graphics.Add(XElement_Tools.CreateAttribute("x", "double", GroupsNodeGraphics.x));
+            graphics.Add(XElement_Tools.CreateAttribute("y", "double", GroupsNodeGraphics.y));
+            graphics.Add(XElement_Tools.CreateAttribute("w", "double", GroupsNodeGraphics.w));
+            graphics.Add(XElement_Tools.CreateAttribute("h", "double", GroupsNodeGraphics.h));
+            graphics.Add(XElement_Tools.CreateAttribute("type", "String", GroupsNodeGraphics.type));
+            graphics.Add(XElement_Tools.CreateAttribute("fill", "String", Color_Tools.ColorToHex(GroupsNodeGraphics.fill)));
+            graphics.Add(XElement_Tools.CreateAttribute("outline", "String", Color_Tools.ColorToHex(GroupsNodeGraphics.outline)));
+            graphics.Add(XElement_Tools.CreateAttribute("topBorderInset", "double", GroupsNodeGraphics.topBorderInset));
+            graphics.Add(XElement_Tools.CreateAttribute("bottomBorderInset", "double", GroupsNodeGraphics.bottomBorderInset));
+            graphics.Add(XElement_Tools.CreateAttribute("leftBorderInset", "double", GroupsNodeGraphics.leftBorderInset));
+            graphics.Add(XElement_Tools.CreateAttribute("rightBorderInset", "double", GroupsNodeGraphics.rightBorderInset));
+
+            return graphics;
+        }
+        private XElement WriteLabelGraphics(GroupNode groupNode)
+        {
+            XElement LabelGraphics = XElement_Tools.CreateSection("LabelGraphics");
+
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("text", "String", groupNode.label));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fill", "String", Color_Tools.ColorToHex(groupNode.LabelGraphics.fill)));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontSize", "int", groupNode.LabelGraphics.fontSize.ToString()));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontName", "String", groupNode.LabelGraphics.fontName));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("alignment", "String", groupNode.LabelGraphics.alignment));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("autoSizePolicy", "String", groupNode.LabelGraphics.autoSizePolicy));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("anchor", "String", groupNode.LabelGraphics.anchor));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("borderDistance", "double", groupNode.LabelGraphics.borderDistance));
+
+            return LabelGraphics;
+        }
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/IWriter.cs b/YED/yEd.XGML/IO/Write/IWriter.cs
new file mode 100644
index 0000000..a8690cb
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/IWriter.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+namespace yEd.XGML.IO.Write
+{
+    internal interface IWriter<T>
+    {
+        XElement Write(T elem);
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/NodeWriter.cs b/YED/yEd.XGML/IO/Write/NodeWriter.cs
new file mode 100644
index 0000000..9dec769
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/NodeWriter.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+using yEd.XGML.IO.Write.Tools;
+using yEd.XGML.DocumentEntities.NodeEntitie;
+
+namespace yEd.XGML.IO.Write
+{
+    internal class NodeWriter : IWriter<Node>
+    {
+        public XElement Write(Node elem)
+        {
+            var res = XElement_Tools.CreateSection("node");
+
+            res.Add(XElement_Tools.CreateAttribute("id", "int", elem.id.ToString()));
+            res.Add(XElement_Tools.CreateAttribute("label", "String", elem.label));
+           
+            
+            res.Add(WriteGraphics(elem.graphics));
+            res.Add(WriteLabelGraphics(elem));
+
+            if (elem.gid.HasValue)            
+                res.Add(XElement_Tools.CreateAttribute("gid", "int", elem.gid));            
+
+            return res;
+        }
+
+        private XElement WriteGraphics(NodeGraphics node_graphics)
+        {
+            XElement graphics = XElement_Tools.CreateSection("graphics");
+
+            graphics.Add(XElement_Tools.CreateAttribute("x", "double", node_graphics.x));
+            graphics.Add(XElement_Tools.CreateAttribute("y", "double", node_graphics.y));
+            graphics.Add(XElement_Tools.CreateAttribute("w", "double", node_graphics.w));
+            graphics.Add(XElement_Tools.CreateAttribute("h", "double", node_graphics.h));
+            graphics.Add(XElement_Tools.CreateAttribute("type", "String", node_graphics.type));
+            graphics.Add(XElement_Tools.CreateAttribute("raisedBorder", "boolean", node_graphics.raisedBorder.ToString().ToLower()));
+            graphics.Add(XElement_Tools.CreateAttribute("fill", "String", Color_Tools.ColorToHex(node_graphics.fill)));
+            graphics.Add(XElement_Tools.CreateAttribute("outline", "String", Color_Tools.ColorToHex(node_graphics.outline)));
+
+            return graphics;
+        }
+        private XElement WriteLabelGraphics(Node node)
+        {
+            XElement LabelGraphics = XElement_Tools.CreateSection("LabelGraphics");
+
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("text", "String", node.label));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontSize", "int", node.LabelGraphics.fontSize.ToString()));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("fontName", "String", node.LabelGraphics.fontName));
+            LabelGraphics.Add(XElement_Tools.CreateAttribute("anchor", "String", node.LabelGraphics.anchor));
+
+            return LabelGraphics;
+        }
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/Tools/Color_Tools.cs b/YED/yEd.XGML/IO/Write/Tools/Color_Tools.cs
new file mode 100644
index 0000000..711f561
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/Tools/Color_Tools.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using System.Drawing;
+
+namespace yEd.XGML.IO.Write.Tools
+{
+    /// <summary>
+    /// ColorTranslator.ToHtml() не всегда возвращает hex, он может вернуть имя цвета.
+    /// А при экспорте требуется именно hex код
+    /// </summary>
+    public static class Color_Tools
+    {       
+        public static string ColorToHex(Color color) => 
+             "#" 
+            + color.R.ToString("X2") 
+            + color.G.ToString("X2") 
+            + color.B.ToString("X2");        
+    }
+}
diff --git a/YED/yEd.XGML/IO/Write/Tools/XElement_Tools.cs b/YED/yEd.XGML/IO/Write/Tools/XElement_Tools.cs
new file mode 100644
index 0000000..b34d3ba
--- /dev/null
+++ b/YED/yEd.XGML/IO/Write/Tools/XElement_Tools.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.Xml.Linq;
+
+namespace yEd.XGML.IO.Write.Tools
+{
+    internal static class XElement_Tools
+    {
+        public static XElement CreateSection(string name) =>
+            new XElement(
+                "section",
+                new XAttribute("name", name)
+            );
+
+
+        public static XElement CreateAttribute(string key, string type, string value) =>
+            new XElement(
+                "attribute",
+                new XAttribute("key", key),
+                new XAttribute("type", type)
+            )
+            { Value = value };
+
+        public static XElement CreateAttribute(string key, string type, object value) =>
+            CreateAttribute(key, type, value.ToString());
+
+    }
+}
diff --git a/YED/yEd.XGML/IO/XGML_Reader.cs b/YED/yEd.XGML/IO/XGML_Reader.cs
new file mode 100644
index 0000000..df89a37
--- /dev/null
+++ b/YED/yEd.XGML/IO/XGML_Reader.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.IO;
+using System.Xml.Linq;
+
+using yEd.XGML.IO.Read;
+using yEd.XGML.DocumentEntities;
+
+namespace yEd.XGML.IO
+{
+    /// <summary>
+    /// Класс для считывагия yed XGML файла в модель Document
+    /// </summary>
+    public class XGML_Reader
+    {
+        public Document Read(XDocument xdoc)
+        {
+            Document res = new Document();
+
+            XElement root = xdoc.Element("section");
+
+
+            res.Creator = root.GetChild_Attribute("Creator").Value;
+            res.Version = root.GetChild_Attribute("Version").Value;
+
+
+            var SectionGraph = root.GetChild_Section("graph");
+
+            var GraphElements = SectionGraph.Elements()
+                .Where(e => e.Name == "section");
+
+            NodeGroupReader nodeGroupReader = new NodeGroupReader();
+            NodeReader nodeReader = new NodeReader();
+            EdgeReader edgeReader = new EdgeReader();
+
+            foreach (XElement elem in GraphElements)
+            {
+                if (elem.Attribute("name").Value == "node")
+                {                   
+                    if (elem.GetChild_Attribute("isGroup") != null)
+                    {
+                        var group = nodeGroupReader.Read(elem);
+                        res.Elements.Add(group.id, group);
+                    }
+                    else
+                    {
+                        var node = nodeReader.Read(elem);
+                        res.Elements.Add(node.id, node);
+                    }
+                }
+                else if (elem.Attribute("name").Value == "edge")
+                {
+                    res.Edges.Add(edgeReader.Read(elem));
+                }
+            }
+
+            return res;
+        }
+
+        public Document Read(string file) =>
+            Read(XDocument.Load(file));
+        public Document Read(Stream stream) =>
+            Read(XDocument.Load(stream));
+
+
+
+        /// <summary>
+        /// Костыль из за того, что yEd ставит в аттрибуте кривую(для  c# xml) кодировку
+        /// </summary>
+        /// <param name="FileName"></param>
+        public static void DropEncodingAttribute(string FileName)
+        {
+            var xml_doc = File.ReadAllLines(FileName);
+            xml_doc[0] = "<?xml version=\"1.0\"?>";
+            File.WriteAllLines(FileName, xml_doc);
+        }
+
+    }
+
+}
diff --git a/YED/yEd.XGML/IO/XGML_Writer.cs b/YED/yEd.XGML/IO/XGML_Writer.cs
new file mode 100644
index 0000000..7c3f6b0
--- /dev/null
+++ b/YED/yEd.XGML/IO/XGML_Writer.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using System.IO;
+using System.Xml.Linq;
+
+using yEd.XGML.IO.Write;
+using yEd.XGML.IO.Write.Tools;
+using yEd.XGML.DocumentEntities;
+using yEd.XGML.DocumentEntities.NodeEntitie;
+using yEd.XGML.DocumentEntities.GroupNodeEntitie;
+
+namespace yEd.XGML.IO
+{
+    /// <summary>
+    /// Класс для записи Document в yed XGML файл
+    /// </summary>
+    public class XGML_Writer
+    {
+        public XDocument Write(Document document)
+        {
+            XDocument res = new XDocument();
+
+            XElement root = XElement_Tools.CreateSection("xgml");
+            res.Add(root);
+
+            root.Add(XElement_Tools.CreateAttribute("Creator", "String", document.Creator));
+            root.Add(XElement_Tools.CreateAttribute("Version", "String", document.Version));
+
+
+            XElement graph = XElement_Tools.CreateSection("graph");
+
+            graph.Add(XElement_Tools.CreateAttribute("hierarchic", "int", document.hierarchic));
+            graph.Add(XElement_Tools.CreateAttribute("label", "String", document.label));
+            graph.Add(XElement_Tools.CreateAttribute("directed", "int", document.directed));
+
+
+            NodeWriter nodeWriter = new NodeWriter();
+            GroupNodeWriter groupNodeWriter = new GroupNodeWriter();
+            EdgeWriter edgeWriter = new EdgeWriter();
+
+            foreach (var elem in document.Elements)
+            {
+                if (elem.Value.isGroup)
+                    graph.Add(groupNodeWriter.Write((GroupNode)elem.Value));
+                else
+                    graph.Add(nodeWriter.Write((Node)elem.Value));
+            }
+
+            foreach (var elem in document.Edges)
+            {
+                graph.Add(edgeWriter.Write(elem));
+            }
+
+            root.Add(graph);
+
+            return res;
+        }
+
+        public void Write(Document document, string file) =>
+            Write(document).Save(file);
+
+        public void Write(Document document, Stream stream) =>
+            Write(document).Save(stream);
+    }
+}
diff --git a/YED/yEd.XGML/Properties/AssemblyInfo.cs b/YED/yEd.XGML/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8d0fd47
--- /dev/null
+++ b/YED/yEd.XGML/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("yEd.XGML")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("yEd.XGML")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("25c3deca-032a-4ade-bcd0-b8616ad0ffef")]
+
+// Сведения о версии сборки состоят из следующих четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//   Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/YED/yEd.XGML/XMLExample/Document.xml b/YED/yEd.XGML/XMLExample/Document.xml
new file mode 100644
index 0000000..c5facfd
--- /dev/null
+++ b/YED/yEd.XGML/XMLExample/Document.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<section name="xgml">
+  <attribute key="Creator" type="String">yFiles</attribute>
+  <attribute key="Version" type="String">2.14</attribute>
+  <section name="graph">
+    <attribute key="hierarchic" type="int">1</attribute>
+    <attribute key="label" type="String"></attribute>
+    <attribute key="directed" type="int">1</attribute>
+    <!--
+    GroupNodes
+    Nodes
+    Edges
+    -->
+  </section>
+</section>
diff --git a/YED/yEd.XGML/XMLExample/Edge.xml b/YED/yEd.XGML/XMLExample/Edge.xml
new file mode 100644
index 0000000..666ffb2
--- /dev/null
+++ b/YED/yEd.XGML/XMLExample/Edge.xml
@@ -0,0 +1,19 @@
+<section name="edge">
+  <attribute key="source" type="int">3</attribute>
+  <attribute key="target" type="int">2</attribute>
+  <attribute key="label" type="String">abc</attribute>
+  <section name="graphics">
+    <attribute key="fill" type="String">#000000</attribute>
+    <attribute key="targetArrow" type="String">standard</attribute>
+  </section>
+  <section name="LabelGraphics">
+    <attribute key="text" type="String">abc</attribute>
+    <attribute key="fontSize" type="int">12</attribute>
+    <attribute key="fontName" type="String">Dialog</attribute>
+    <attribute key="configuration" type="String">AutoFlippingLabel</attribute>
+    <attribute key="contentWidth" type="double">23.34765625</attribute>
+    <attribute key="contentHeight" type="double">18.701171875</attribute>
+    <attribute key="model"/>
+    <attribute key="position"/>
+  </section>
+</section>
\ No newline at end of file
diff --git a/YED/yEd.XGML/XMLExample/GroupNode.xml b/YED/yEd.XGML/XMLExample/GroupNode.xml
new file mode 100644
index 0000000..0aa7c67
--- /dev/null
+++ b/YED/yEd.XGML/XMLExample/GroupNode.xml
@@ -0,0 +1,29 @@
+<section name="node">
+  <attribute key="id" type="int">7</attribute>
+  <attribute key="label" type="String">G</attribute>
+  <section name="graphics">
+    <attribute key="x" type="double">567.4860159999996</attribute>
+    <attribute key="y" type="double">216.00000000000003</attribute>
+    <attribute key="w" type="double">50.0</attribute>
+    <attribute key="h" type="double">50.0</attribute>
+    <attribute key="type" type="String">rectangle</attribute>
+    <attribute key="fill" type="String">#F2F0D8</attribute>
+    <attribute key="outline" type="String">#000000</attribute>
+    <attribute key="topBorderInset" type="double">0.0</attribute>
+    <attribute key="bottomBorderInset" type="double">0.0</attribute>
+    <attribute key="leftBorderInset" type="double">0.0</attribute>
+    <attribute key="rightBorderInset" type="double">0.0</attribute>
+  </section>
+  <section name="LabelGraphics">
+    <attribute key="text" type="String">G</attribute>
+    <attribute key="fill" type="String">#B7B69E</attribute>
+    <attribute key="fontSize" type="int">15</attribute>
+    <attribute key="fontName" type="String">Dialog</attribute>
+    <attribute key="alignment" type="String">right</attribute>
+    <attribute key="autoSizePolicy" type="String">node_width</attribute>
+    <attribute key="anchor" type="String">t</attribute>
+    <attribute key="borderDistance" type="double">0.0</attribute>
+  </section>
+  <attribute key="isGroup" type="boolean">true</attribute>
+  <attribute key="gid" type="int">1</attribute>
+</section>
\ No newline at end of file
diff --git a/YED/yEd.XGML/XMLExample/Node.xml b/YED/yEd.XGML/XMLExample/Node.xml
new file mode 100644
index 0000000..f14004f
--- /dev/null
+++ b/YED/yEd.XGML/XMLExample/Node.xml
@@ -0,0 +1,21 @@
+<section name="node">
+			<attribute key="id" type="int">6</attribute>
+			<attribute key="label" type="String">A4</attribute>
+			<section name="graphics">
+				<attribute key="x" type="double">649.6</attribute>
+				<attribute key="y" type="double">216.0</attribute>
+				<attribute key="w" type="double">30.0</attribute>
+				<attribute key="h" type="double">30.0</attribute>
+				<attribute key="type" type="String">roundrectangle</attribute>
+				<attribute key="raisedBorder" type="boolean">false</attribute>
+				<attribute key="fill" type="String">#FFCC00</attribute>
+				<attribute key="outline" type="String">#000000</attribute>
+			</section>
+			<section name="LabelGraphics">
+				<attribute key="text" type="String">A4</attribute>
+				<attribute key="fontSize" type="int">12</attribute>
+				<attribute key="fontName" type="String">Dialog</attribute>
+				<attribute key="anchor" type="String">c</attribute>
+			</section>
+			<attribute key="gid" type="int">1</attribute>
+</section>
\ No newline at end of file
diff --git a/YED/yEd.XGML/yEd.XGML.csproj b/YED/yEd.XGML/yEd.XGML.csproj
new file mode 100644
index 0000000..3acd846
--- /dev/null
+++ b/YED/yEd.XGML/yEd.XGML.csproj
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{25C3DECA-032A-4ADE-BCD0-B8616AD0FFEF}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>yEd.XGML</RootNamespace>
+    <AssemblyName>yEd.XGML</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="IO\XGML_Reader.cs" />
+    <Compile Include="IO\Read\EdgeReader.cs" />
+    <Compile Include="IO\Read\IReader.cs" />
+    <Compile Include="IO\Read\NodeGroupReader.cs" />
+    <Compile Include="IO\Read\NodeReader.cs" />
+    <Compile Include="IO\Read\XElement_Extension.cs" />
+    <Compile Include="IO\XGML_Writer.cs" />
+    <Compile Include="IO\Write\EdgeWriter.cs" />
+    <Compile Include="IO\Write\GroupNodeWriter.cs" />
+    <Compile Include="IO\Write\IWriter.cs" />
+    <Compile Include="IO\Write\NodeWriter.cs" />
+    <Compile Include="IO\Write\Tools\XElement_Tools.cs" />
+    <Compile Include="DocumentEntities\Base\IElement.cs" />
+    <Compile Include="DocumentEntities\Document.cs" />
+    <Compile Include="DocumentEntities\EdgeEntitie\Edge.cs" />
+    <Compile Include="DocumentEntities\EdgeEntitie\EdgeGraphics.cs" />
+    <Compile Include="DocumentEntities\EdgeEntitie\EdgeLabelGraphics.cs" />
+    <Compile Include="DocumentEntities\GroupNodeEntitie\GroupNode.cs" />
+    <Compile Include="DocumentEntities\GroupNodeEntitie\GroupNodeLabelGraphics.cs" />
+    <Compile Include="DocumentEntities\GroupNodeEntitie\GroupsNodeGraphics.cs" />
+    <Compile Include="DocumentEntities\NodeEntitie\Node.cs" />
+    <Compile Include="DocumentEntities\NodeEntitie\NodeGraphics.cs" />
+    <Compile Include="DocumentEntities\NodeEntitie\NodeLabelGraphics.cs" />
+    <Compile Include="Enums\EnumArrowType.cs" />
+    <Compile Include="Enums\EnumFont.cs" />
+    <Compile Include="Enums\EnumFontStyle.cs" />
+    <Compile Include="Enums\EnumNodeType.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="IO\Write\Tools\Color_Tools.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="XMLExample\Document.xml" />
+    <Content Include="XMLExample\Edge.xml" />
+    <Content Include="XMLExample\GroupNode.xml" />
+    <Content Include="XMLExample\Node.xml" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/YED/yEd.XGML/yEd.XGML.csproj.user b/YED/yEd.XGML/yEd.XGML.csproj.user
new file mode 100644
index 0000000..6cbe588
--- /dev/null
+++ b/YED/yEd.XGML/yEd.XGML.csproj.user
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+</Project>
\ No newline at end of file