public override void Execute()
        {
            ConvertToXml convert = new ConvertToXml(Context.Model);

            _SaveFileDialog.FileName = GetXmlFileNameFor(Context.Model);

            string lastXMLFileDirectory = (string)Properties.Settings.Default["LastXMLFileDirectory"];

            if (lastXMLFileDirectory.Length == 0)
            {
                lastXMLFileDirectory = Environment.CurrentDirectory;
            }

            _SaveFileDialog.InitialDirectory = lastXMLFileDirectory;

            DialogResult dialogResult = _SaveFileDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                string fileName    = _SaveFileDialog.FileName;
                string genFileName = fileName + ".generated";
                string text        = null;

                bool ok = false;
                text = convert.Convert();
                ok   = true;

                if (ok && text != null)
                {
                    using (StreamWriter sw = new StreamWriter(genFileName))
                    {
                        sw.WriteLine(text);
                    }

                    if (File.Exists(fileName))
                    {
                        File.Delete(fileName);
                    }
                    File.Move(genFileName, fileName);
                    SaveXmlFileMapping(Context.Model, fileName);

                    Properties.Settings.Default["LastXMLFileDirectory"] = Path.GetDirectoryName(fileName);
                    Properties.Settings.Default.Save();
                }
                else
                {
                    MessageBox.Show("XmlFile was not saved", "Cannot save generated xml file.");
                }
            }
        }
        public override void Execute()
        {
            ConvertToXml convert = new ConvertToXml (Context.Model);

            _SaveFileDialog.FileName = GetXmlFileNameFor (Context.Model);
            DialogResult dialogResult = _SaveFileDialog.ShowDialog ();
            if (dialogResult == DialogResult.OK)
            {
                string fileName = _SaveFileDialog.FileName;
                string genFileName = fileName + ".generated";
                string text = null;

                bool ok = false;
                text = convert.Convert ();
                ok = true;

                if (ok && text != null)
                {
                    using (StreamWriter sw = new StreamWriter (genFileName))
                    {
                        sw.WriteLine (text);
                    }

                    if (File.Exists (fileName))
                    {
                        File.Delete (fileName);
                    }
                    File.Move (genFileName, fileName);
                    SaveXmlFileMapping (Context.Model, fileName);
                }
                else
                {
                    MessageBox.Show ("XmlFile was not saved", "Cannot save generated xml file.");
                }
            }
        }