Exemplo n.º 1
0
  { public static void SaveAs()
    {
        TabData Data = TabManager.GetSelectedTabData();

        SaveFileDialog Dlg = new SaveFileDialog();

        Dlg.Title    = AppMain.AppName + " - Save As";
        Dlg.Filter   = "DESolver Files (*.DES) |*.DES| All Files (*.*) |*.*";
        Dlg.FileName = Data.Filename;

        DialogResult Result = Dlg.ShowDialog();

        if (Result != DialogResult.OK)
        {
            return;
        }

        IO_Writer.Write(Dlg.FileName, Data.Box.Text);
        TabManager.NewFilename(Data.Filename, Dlg.FileName);

        Data.Box.Modified = false;
        State.RefreshSaves();

        FileTree.This.RefreshTree();
    }
Exemplo n.º 2
0
    private static DialogResult NoName(TabData Data)
    {
        String Msg = "";

        Msg += "Rename and save this document '";
        Msg += Data.Filename;
        Msg += "'?";

        DialogResult OK = MsgBox.YesNoCancel(Msg);

        if (OK == DialogResult.Cancel)
        {
            return(DialogResult.Cancel);
        }

        if (OK == DialogResult.Yes)
        {
            SaveFileDialog Dlg = new SaveFileDialog();

            Dlg.Title    = AppMain.AppName + " - Save As";
            Dlg.Filter   = "DESolver Files (*.DES) |*.DES| All Files (*.*) |*.*";
            Dlg.FileName = Data.Filename;

            DialogResult Result = Dlg.ShowDialog();

            if (Result != DialogResult.OK)
            {
                return(Result);
            }

            BasicSave(Data);
            TabManager.NewFilename(Data.Filename, Dlg.FileName);
            return(DialogResult.Yes);
        }

        return(DialogResult.No);
    }