Example #1
0
		/// <summary>
		/// Opens a diagram which was saved to XML previously (XML deserialization)
		/// </summary>
		/// <param name="filePath"></param>
		public void OpenGraph(string filePath)
		{
			XmlTextReader reader = new XmlTextReader(filePath);
			GraphSerializer ser = new GraphSerializer(this);
			graphAbstract = ser.Deserialize(reader) as GraphAbstract;
			reader.Close();
			DrawTree();
			Invalidate();
		}
Example #2
0
		/// <summary>
		/// Saves the diagram to file in XML format (XML serialization)
		/// </summary>
		/// <param name="filePath"></param>
		public void SaveGraphAs(string filePath)
		{
			XmlTextWriter tw = new XmlTextWriter(filePath,System.Text.Encoding.Unicode);
			GraphSerializer g = new GraphSerializer(this);
			g.Serialize(tw);
			tw.Close();
		}