void ISerializer.Save(IPatchGraphManager patchGraphManager, string filename)
        {
            PatchGraph patchGraph = new PatchGraph();

            Patch[] patches = patchGraphManager.GetPatches();
            patchGraph.patches = new SerializedPatch[patches.Length];
            SerializedPatch serializedPatch;
            Patch           patch;
            int             j;

            for (int i = 0; i < patches.Length; i++)
            {
                patch           = patches[i];
                serializedPatch = new SerializedPatch()
                {
                    id         = patch.Id,
                    code       = patch.Code,
                    PosX       = patch.PosX,
                    PosY       = patch.PosY,
                    parameters = new Parameter[patch.Values.Count]
                };
                j = 0;
                foreach (KeyValuePair <string, float> pair in patch.Values)
                {
                    serializedPatch.parameters[j++] = new Parameter()
                    {
                        name  = pair.Key,
                        value = pair.Value
                    };
                }
                patchGraph.patches[i] = serializedPatch;
            }
            patchGraph.connections = patchGraphManager.GetConnections();
            patchGraph.maxId       = ((PatchGraphManager)patchGraphManager).maxId;
            string        xml;
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(PatchGraph));

            using (MemoryStream memoryStream = new MemoryStream())
            {
                xmlSerializer.Serialize(memoryStream, patchGraph);
                memoryStream.Position = 0;
                using (StreamReader streamReader = new StreamReader(memoryStream))
                {
                    xml = streamReader.ReadToEnd();
                }
            }
            try
            {
                Tracer.Log("Application.persistentDataPath + Others.SavesFolder + filename" + Application.persistentDataPath + Others.SavesFolder + filename);
                File.WriteAllText(Application.persistentDataPath + Others.SavesFolder + filename, xml, Encoding.UTF8);
            }
            catch (Exception e)
            {
                Tracer.Log(e.Message + e.StackTrace);
            }
        }
 public void Load(string filename)
 {
     processor.Clear(patchGraphManager.GetPatches());
     patchGraphManager.Clear();
     patchCreator.Clear();
     WireDrawer.GetInstance().Clear();
     patchGraphManager = serializer.Load(filename);
     Patch[] patches = patchGraphManager.GetPatches();
     processor.LoadPatches(patches);
     patchCreator.Load(patches);
     Connection[] connections = patchGraphManager.GetConnections();
     processor.LoadConnections(connections);
     WireDrawer.GetInstance().Load(connections);
 }