Пример #1
0
        private void _toolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            if (e.Button == _saveButton)
            {
                string         fileName;
                SaveFileDialog dialog;

                dialog       = new SaveFileDialog();
                dialog.Title = "Save Game";

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    fileName = dialog.FileName;
                    _gameRoot.SaveGame(fileName);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Invokes the command.
        /// </summary>
        public override void Invoke()
        {
            OnInvoking();
            ClientApplication client = ClientApplication.Instance;
            ISaveGameWindow   wnd    = (ISaveGameWindow)client.GetControl(typeof(ISaveGameWindow));

            wnd.ShowSimilizationControl();
            GameRoot root = client.ServerInstance;

            if (wnd.SavedGameFile.Length > 0)
            {
                root.SaveGame(wnd.SavedGameFile);
                OnInvoked();
            }
            else
            {
                OnCanceled();
            }
        }