public void OpenFile(String fileName) { Module.Scenes.Clear(); Module = Softrope.Load(Module, fileName); SyncUi(); Properties.Settings.Default.LastSavePath = System.IO.Path.GetDirectoryName(fileName); }
public static void Save(Module module, string path) { XmlSerializer serializer = new XmlSerializer(typeof(Module)); FileStream fs = new FileStream(path, FileMode.Create); TextWriter writer = new StreamWriter(fs, new UTF8Encoding()); serializer.Serialize(writer, module); writer.Close(); fs.Close(); }
public SoftropeMainUi() { this.InitializeComponent(); Softrope.InitialiseBass(); Softrope.SetBuffer(); Module = new Module(); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(GetType()); Status.Text = String.Format("{0}. Version {1}.", assembly.GetName().Name, assembly.GetName().Version ); }
public static Module Load(Module module, string path) { XmlSerializer serializer = new XmlSerializer(typeof(Module)); FileStream fs = new FileStream(path, FileMode.Open); return serializer.Deserialize(fs) as Module; }