Acceleratio.SPDG.UI.Common.DeserializeDefinition C# (CSharp) Method

DeserializeDefinition() public static method

public static DeserializeDefinition ( string path ) : void
path string
return void
        public static void DeserializeDefinition(string path)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(SerializeWrapper), new Type[] { typeof(ClientGeneratorDefinition), typeof(ServerGeneratorDefinition) });
            TextReader reader = new StreamReader(path);
            object obj = deserializer.Deserialize(reader);
            WorkingDefinition = ((SerializeWrapper)obj).Definition;
            reader.Close();
        }

Usage Example

Esempio n. 1
0
        private void loadDefinitionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Common.DeserializeDefinition(openFileDialog1.FileName);

                if (this is frm01Connect)
                {
                    ((frm01Connect)this).MoveAt(12, null);
                }
                else
                {
                    RootForm.MoveAt(12, this);
                    //RootForm.loadData();
                }
            }
        }