Ejemplo n.º 1
0
 private void SaveClicked(object sender, RoutedEventArgs e)
 {
     if (currentSavedFileName != "")
     {
         WorldProperties.PersistChanges(currentSavedFileName);
     }
     else
     {
         SaveAsClicked(sender, e);
     }
 }
Ejemplo n.º 2
0
        private void SaveAsClicked(object sender, RoutedEventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (!String.IsNullOrEmpty(Properties.Settings.Default.UsualFolder))
            {
                sfd.InitialDirectory = Properties.Settings.Default.UsualFolder;
            }
            sfd.DefaultExt   = "trsim";
            sfd.AddExtension = true;
            sfd.Filter       = "Tribe Sim Settings files|*.trsim";
            if (sfd.ShowDialog() == true)
            {
                WorldProperties.PersistChanges(sfd.FileName);
                Properties.Settings.Default.UsualFolder = System.IO.Path.GetDirectoryName(sfd.FileName);
                currentOpenedFileName = currentSavedFileName = sfd.SafeFileName;
                SetTitle();
            }
        }