void miSaveAs_Click(object sender, RoutedEventArgs e)
        {
            string strFile = (this.lbPresentations.SelectedItem as FrameworkElement).Tag.ToString();

            string strName = System.IO.Path.GetFileNameWithoutExtension(strFile);

            NameWindow nw = new NameWindow()
            {
                FileName = strName,
                Title    = "Presentation Save As",
                Owner    = this,
            };

            if (nw.ShowDialog().Value)
            {
                string strNewFile = Data.ProductInfo.PresentationPath + nw.FileName + @".Pres";

                if (System.IO.File.Exists(strNewFile))
                {
                    if (MessageBox.Show("This presentation already exists, do you want to overwrite it ?", "Webb Playbook", MessageBoxButton.YesNo) == MessageBoxResult.No)
                    {
                        return;
                    }
                }

                //
                System.IO.File.Copy(strFile, strNewFile, true);
                LoadPresentations();
            }
        }
예제 #2
0
 private void OnNewToolStripMenuItemClick(object sender, EventArgs e)
 {
     using (var nameDialog = new NameWindow())
     {
         if (nameDialog.ShowDialog() == DialogResult.OK)
         {
             SubjectiveSystem system = SubjectiveSystem.CreateNew(nameDialog.ObjectName);
             ShowSystem(system);
         }
     }
 }
        private void btnReportHeader_Click(object sender, RoutedEventArgs e)
        {
            NameWindow nameWindow = new NameWindow()
            {
                Title = "Report Header",
                Owner = this,
            };

            if (nameWindow.ShowDialog().Value)
            {
                reportHeader = nameWindow.FileName;
            }
        }
예제 #4
0
        private void btnSavePresentation_Click(object sender, RoutedEventArgs e)
        {
            if (this.lbSelectedFiles.Items.Count == 0)
            {
                MessageBox.Show("Please select games");

                return;
            }

            Presentation = GetPresentation();

            NameWindow nw = new NameWindow()
            {
                Title     = "Save Presentation",
                Owner     = this,
                SelectAll = true,
                FileName  = Presentation.Name,
            };

            if (nw.ShowDialog() == true)
            {
                Presentation.Name = nw.FileName;

                if (System.IO.File.Exists(PresentationPath))
                {
                    if (MessageBox.Show("This presentation already exists, do you want to overwrite the existing presentation ?", "Webb Playbook", MessageBoxButton.YesNo) == MessageBoxResult.No)
                    {
                        return;
                    }
                }

                this.DialogResult = true;

                CloseWindow();
            }
        }