Ejemplo n.º 1
0
        public override bool Send(SendCommandArgs args)
        {
            base.Send(args);

            NewFileDialog nfd = new NewFileDialog(main.Settings);
            DialogResult  dr  = nfd.ShowModal(main);

            if (dr == DialogResult.Ok)
            {
                if (FileModifiedDialog.Show(main) == DialogResult.Ok)
                {
                    args.Message.Write(nfd.SelectedDocumentType.ID);
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        protected override void Execute(CommandExecuteArgs args)
        {
            NewFileDialog nfd = new NewFileDialog(main.Settings);
            DialogResult  dr  = nfd.ShowModal(main);

            if (dr == DialogResult.Ok)
            {
                if (FileModifiedDialog.Show(main) == DialogResult.Ok)
                {
                    // create a new document then edit it
                    main.FileList.SelectedIndex = -1;

                    var doc = nfd.SelectedDocumentType.Create(main.Platform);
                    doc.IsNew    = true;
                    doc.EditMode = true;

                    main.SetDocument(doc, true);
                }
            }
        }