private void abrirToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog sfd = new OpenFileDialog(); sfd.Filter = "XML Files|*.xml"; sfd.ShowDialog(); if (sfd.FileName != null && sfd.FileName != "") { Serializer s = new Serializer(); SaveDataAutomato sd = (SaveDataAutomato) s.Busca(sfd.FileName, typeof(SaveDataAutomato )); AutomatoInstanciado = sd.ConvertSaveDataAutomato(sd); AtualizaAutomato(); } }
private void salvarToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "XML Files|*.xml"; sfd.ShowDialog(); if (sfd.FileName != null && sfd.FileName != "") { Serializer s = new Serializer(); SaveDataAutomato sd = new SaveDataAutomato(); sd = sd.ConvertAutomato(AutomatoInstanciado); s.Grava(sd, sfd.FileName); } }