예제 #1
0
        private void OnSelection(FileNewData fileNewData)
        {
            // Hide dialog
            _mainViewModel.DialogContent = null;

            _mainViewModel.MenuFileNew2(fileNewData);
        }
예제 #2
0
        internal void MenuFileNew2(FileNewData fileNewData)
        {
            IModuleFileNew moduleFile = null;

            moduleFile = fileNewData.FileCreateModule;

            if (moduleFile == null)
            {
                return;
            }

            if (((IModuleFileProject)moduleFile).SpawnNewMainWindow)
            {
                // get executable path
                String[] cmds        = Environment.GetCommandLineArgs();
                FileInfo fi          = new FileInfo(cmds[0]);
                string   exefilename = cmds[0];
                exefilename = exefilename.Replace(".vshost.", ".");

                // spawn a new process
                string           docfilename = "";
                ProcessStartInfo pinfo       = new ProcessStartInfo(exefilename, docfilename);
                System.Diagnostics.Process.Start(pinfo);
                return;
            }

            var fileViewModel = moduleFile.FileNew();

            return;
        }
예제 #3
0
        public FileNewDialogViewModel(MainViewModel mainViewModel) : base("New")
        {
            _mainViewModel = mainViewModel;

            IconSource = CreateImageSource(@"/ProtonType.Editor;component/icons/NewDocument.png");
            IconSource.Freeze();

            // create list of file extensions
            var fileDocumentsMgr = mainViewModel.Model.FileDocumentsMgr;

            foreach (var fileCreateModule in fileDocumentsMgr.FileCreateModules)
            {
                foreach (var fileExtension in fileCreateModule.FileExtensions)
                {
                    var fileNewList = new FileNewData(fileCreateModule, fileExtension);
                    _fileNewList.Add(fileNewList);
                }
            }
        }