Exemplo n.º 1
0
        void showNewProjectDialog()
        {
            slideEditController.stopPlayingTimelines();

            Browser     browse      = new Browser("Project Types", "Create Authoring Project");
            BrowserNode defaultNode = new BrowserNode("Slideshow", new SlideshowProjectTemplate());

            browse.addNode(null, null, defaultNode);
            browse.DefaultSelection = defaultNode;

            NewProjectDialog.ShowDialog(browse, (projectDialog) =>
            {
                ProjectTemplate template = projectDialog.SelectedValue;
                String fullProjectName   = projectDialog.FullProjectName;

                if (projectDialog.MakeSingleFile && !fullProjectName.EndsWith(".sl", StringComparison.InvariantCultureIgnoreCase))
                {
                    fullProjectName += ".sl";
                }
                if (slideEditController.projectExists(fullProjectName))
                {
                    MessageBox.show(String.Format("A project already exists at the location.\n{0}\n\nWould you like to delete it and create a new one?", fullProjectName), "Overwrite?", MessageBoxStyle.IconQuest | MessageBoxStyle.Yes | MessageBoxStyle.No, result =>
                    {
                        if (result == MessageBoxStyle.Yes)
                        {
                            slideEditController.createNewProject(fullProjectName, true, template);
                        }
                    });
                }
                else
                {
                    slideEditController.createNewProject(fullProjectName, false, template);
                }
            });
        }
Exemplo n.º 2
0
        public override void Run()
        {
            TreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;

            while (node != null && !(node is ISolutionFolderNode))
            {
                node = node.Parent;
            }
            ISolutionFolderNode solutionFolderNode = node as ISolutionFolderNode;

            if (node != null)
            {
                using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
                    npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);

                    // show the dialog to request project type and name
                    if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK)
                    {
                        if (npdlg.NewProjectLocation.Length == 0)
                        {
                            MessageService.ShowError("No project has been created, there is nothing to add.");
                            return;
                        }
                        AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
                        ProjectService.SaveSolution();
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            try
            {
                NewProjectDialog dialog = new NewProjectDialog();
                dialog.ShowDialog();
                var dialogResult = dialog.Result;

                if (dialogResult.Cancelled)
                {
                    throw new WizardBackoutException();
                }

                replacementsDictionary.Add("passthrough:CreateAndroidProject", dialogResult.CreateAndroid.ToString());
                replacementsDictionary.Add("passthrough:CreateiOSProject", dialogResult.CreateiOS.ToString());
                replacementsDictionary.Add("passthrough:CreateUWPProject", dialogResult.CreateUwp.ToString());
                replacementsDictionary.Add("passthrough:Container", dialogResult.ContainerType.ToString());
            }
            catch
            {
                string solutionDirectory = replacementsDictionary["$solutiondirectory$"];

                if (Directory.Exists(solutionDirectory))
                {
                    Directory.Delete(solutionDirectory, true);
                }

                throw;
            }
        }
Exemplo n.º 4
0
        private void ProjectToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            using (var dlg = new NewProjectDialog())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (dlg.SelectedTemplate != null)
                    {
                        Project p = dlg.SelectedTemplate.CreateProject(dlg.ProjectFilePath, dlg.ProjectName, WorkspaceManager);
                        if (p != null)
                        {
                            if (!Directory.Exists(Path.Combine(dlg.WorkspacePath, dlg.WorkspaceName)) && dlg.CreateWorkspace)
                            {
                                Directory.CreateDirectory(Path.Combine(dlg.WorkspacePath, dlg.ProjectName));
                                WorkspaceManager.CreateNewWorkspace(dlg.WorkspaceFilePath);
                            }
                            WorkspaceManager.AddProject(p);
                        }
                    }

                    else
                    {
                        MessageBox.Show("An existing project with this name already exists at this location!");
                        return;
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void newProjectMenuItem_Click(object sender, EventArgs e)
        {
            var np = new NewProjectDialog();

            if (np.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var f = new Project();
                f.Name = np.Filename;
                f.Type = np.Type;

                Workspace.Solution.Projects.Add(f);

                explorerTreeView.Nodes.Clear();
                explorerTreeView.Nodes.Add(SolutionExplorer.Build(Workspace.Solution, solutionContextMenu, projectContextMenu, fileContextMenu));

                var path = new FileInfo(Workspace.SolutionPath).Directory.FullName;

                Directory.CreateDirectory(path + "\\" + f.Name);
                Directory.CreateDirectory(path + "\\" + f.Name + "\\Properties");

                np.Plugin.Events.Fire("OnCreateProject", f);

                Workspace.Solution.Save(Workspace.SolutionPath);
            }
        }
Exemplo n.º 6
0
 public override void Run()
 {
     using (NewProjectDialog npdlg = new NewProjectDialog(true)) {
         npdlg.Owner = (Form)WorkbenchSingleton.Workbench;
         npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
     }
 }
Exemplo n.º 7
0
 public void Command_NewProject()
 {
     NewProjectCommand = new CommandBase((parameter, command) =>
     {
         var dialog = new NewProjectDialog(Model.Window);
         dialog.ShowDialog();
     });
 }
Exemplo n.º 8
0
 public void AddProject()
 {
     using (var dlg = new NewProjectDialog())
     {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
         }
     }
 }
Exemplo n.º 9
0
        private void NewProjectCommandExecuted(object obj)
        {
            var dialog = new NewProjectDialog();

            if (dialog.ShowDialog() == true)
            {
                ConnectionParameters = dialog.ViewModel.ConnectionParameters;
            }
        }
Exemplo n.º 10
0
        public void ShowDialog(Action <String> newProjectPathCallback)
        {
            NewProjectDialog newProjectDialog = new NewProjectDialog();

            if (newProjectDialog.ShowDialog() == true && this.IsProjectNameValid)
            {
                String newProjectPath = Path.Combine(SettingsViewModel.GetInstance().ProjectRoot, this.NewProjectName);

                newProjectPathCallback?.Invoke(newProjectPath);
            }
        }
Exemplo n.º 11
0
        private void OnCreateProject(object sender, EventArgs e)
        {
            var dlg = new NewProjectDialog(WeSay.Project.WeSayWordsProject.NewProjectDirectory);

            if (DialogResult.OK != dlg.ShowDialog())
            {
                return;
            }
            CreateAndOpenProject(dlg.PathToNewProjectDirectory, dlg.Iso639Code, dlg.LanguageName);

            PointOutOpenWeSayButton();
        }
Exemplo n.º 12
0
        public bool GetSaveProjectDir(out string path)
        {
            var dialog = new NewProjectDialog();

            if (dialog.ShowDialog() == true)
            {
                path = dialog.ProjectDir;
                return(true);
            }

            path = null;
            return(false);
        }
Exemplo n.º 13
0
        private void NewProjectEvent(object sender, ExecutedRoutedEventArgs e)
        {
            NewProjectDialog popup = new NewProjectDialog();

            popup.File = Directory.GetCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + "NewZerothProject.zproj";
            popup.ShowDialog();
            if (popup.cancelled || popup.invalid)
            {
                return;
            }
            Logger.log($"[Editor] Creating new project '{popup.ProjectName}' at '{popup.File}'");
            LoadedProject newProject = LoadedProject.newProject(popup.File, popup.ProjectName);

            switchProject(newProject);
        }
Exemplo n.º 14
0
        //================================================================================================================================================
        // Delegate Command Methods
        //================================================================================================================================================
        #region OnAddProject(object parameter)
        protected void OnAddProject(object parameter)
        {
            Project p = new Project();

            Projects.Add(p);
            //Items.Add(p);
            NewProjectDialog npd = new NewProjectDialog(p);

            npd.ShowDialog();
            TreeViewItem tvi = new TreeViewItem();

            tvi.Header      = p.Name;
            tvi.DataContext = p;
            TreeViewItems.Add(tvi);

            CurrentItem = tvi;
        }
Exemplo n.º 15
0
        private void newProjectMenuItem_Click(object sender, RoutedEventArgs e)
        {
            NewProjectDialog newProjectDialog = new NewProjectDialog();

            // Show new project dialog to the user.
            if (newProjectDialog.ShowDialog().Value)
            {
                // Dialog OK, got some correct properties for creating editor.

                // Dispose old project and show warning dialog to the user.
                if (project != null)
                {
                    if (MessageBox.Show("All unsaved work will be lost, continue?", "Warning", MessageBoxButton.YesNo) == MessageBoxResult.No)
                    {
                        return;
                    }

                    CleanupLastProject();
                }

                // Create new project.
                NewProjectProperties properties = newProjectDialog.NewProjectProperties;

                switch (properties.MapType)
                {
                case MapType.Tile:
                    project = ProjectBuilder.BuildTileMapProject(properties, xnaControl.Handle);
                    break;

                case MapType.Object:
                case MapType.Hex:
                default:
                    throw new NotImplementedException("Feature is not implemented.");
                }

                // Initialize the project.
                InitializeNewProject();

                // Set resolution.
                // TODO: set resolution once its XNA controls size valid.
                project.Game.ChangeGraphics(1280, 720);
            }

            // Invalid results, continue.
        }
Exemplo n.º 16
0
        private void radMenuItem12_Click(object sender, EventArgs e)
        {
            var np = new NewProjectDialog();

            if (np.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var f = new Project();
                f.Name = np.Filename;
                f.Type = np.Type;

                Workspace.Solution.Projects.Add(f);

                radTreeView1.Nodes.Clear();
                radTreeView1.Nodes.Add(SolutionExplorer.Build(Workspace.Solution));

                Workspace.Solution.Save(Workspace.SolutionPath);
            }
        }
Exemplo n.º 17
0
        public void CreateNewProject(WizardEventHandler wizardEventHandler)
        {
            NewProjectDialog npd = new NewProjectDialog(null);

            npd = new NewProjectDialog(null);
            if (this.CurrentWizard != null)
            {
                this.CurrentWizard.DialogOpened(npd);
            }
            toolStripStatusLabel.Text = "Creating new project";
            if (npd.ShowDialog() == DialogResult.OK)
            {
                //OpeningSpectraCount = 0;
                tsMainProgressBar.Maximum = 0;
                tsMainProgressBar.Visible = true;
                //toolStripStatusLabel.Text = String.Format("Creating Project {0}...", npd.projectNameTextBox.Text);
                foreach (SpectraContainerDescription scd in npd.ContainerDescriptions)
                {
                    tsMainProgressBar.Maximum += scd.spectraPaths.Length;
                }
                string   defaultProjectName = getDefaultProjectName();
                IProject project            = AvailableAssemblies.getProject(
                    npd.ProjectType.ToString(),
                    new object[] {
                    defaultProjectName,     //npd.projectNameTextBox.Text,
                    npd.ContainerDescriptions
                });
                //project.Save(System.IO.Path.Combine(npd.projectPathTextBox.Text, npd.projectNameTextBox.Text), false);
                ProjectForm form = CreateProjectWindow(project);
                form.NotSavedChanges      = true;
                tsMainProgressBar.Visible = false;
                if (wizardEventHandler != null)
                {
                    wizardEventHandler(this, new WizardEventArgs(form, WizardEventType.Created));
                }
            }
            if (CurrentWizard != null)
            {
                CurrentWizard.DialogClosed();
            }
            npd.Dispose();
            toolStripStatusLabel.Text = "Ready";
        }
Exemplo n.º 18
0
        private void radMenuItem12_Click(object sender, EventArgs e)
        {
            var np = new NewProjectDialog();

            if (np.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var f = new Project();
                f.Name = np.Filename;
                f.Type = np.Type;

                Workspace.Solution.Projects.Add(f);

                explorerTreeView.Nodes.Clear();
                explorerTreeView.Nodes.Add(SolutionExplorer.Build(Workspace.Solution, radContextMenu1));

                np.Plugin.Events.Fire("OnCreateProject", f);

                Workspace.Solution.Save(Workspace.SolutionPath);
            }
        }
Exemplo n.º 19
0
        public Project NewProject()
        {
            NewProjectDialog dialog = new NewProjectDialog();

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                try
                {
                    ProjectCreator creator = new ProjectCreator();
                    return(creator.CreateProject(dialog.TemplateDirectory,
                                                 dialog.ProjectLocation, dialog.ProjectName));
                }
                catch (Exception exception)
                {
                    ErrorHandler.ShowInfo("Could not create the requested project: " + exception.Message);
                }
            }

            return(null);
        }
        public override void Run()
        {
            AbstractProjectBrowserTreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
            ISolutionFolderNode            solutionFolderNode = node as ISolutionFolderNode;

            if (node != null)
            {
                using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
                    npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);

                    // show the dialog to request project type and name
                    if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK)
                    {
                        if (npdlg.NewProjectLocation.Length == 0)
                        {
                            MessageService.ShowError("No project has been created, there is nothing to add.");
                            return;
                        }
                        AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
                        ProjectService.SaveSolution();

                        if (SDLite.UpdateInfo.ExpandNewProjectByDefaut)
                        {
                            IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;

                            if (window != null && window.ActiveViewContent != null)
                            {
                                ProjectBrowserPad.Instance.ProjectBrowserControl.SelectFile(window.ActiveViewContent.PrimaryFileName);
                            }

                            node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;

                            if (node is ProjectNode)
                            {
                                node.Expand();
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 21
0
        public override void Run()
        {
            AbstractProjectBrowserTreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
            ISolutionFolderNode            solutionFolderNode = node as ISolutionFolderNode;

            if (node != null)
            {
                using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
                    if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK)
                    {
                        if (npdlg.NewProjectLocation.Length == 0)
                        {
                            MessageService.ShowError("No project has been created, there is nothing to add.");
                            return;
                        }
                        AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
                        ProjectService.SaveSolution();
                    }
                }
            }
        }
Exemplo n.º 22
0
        public Project NewProject()
        {
            NewProjectDialog dialog = new NewProjectDialog();

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                try
                {
                    FlashDevelopActions.CheckAuthorName();
                    ProjectCreator creator = new ProjectCreator();
                    return(creator.CreateProject(dialog.TemplateDirectory, dialog.ProjectLocation, dialog.ProjectName, dialog.PackageName));
                }
                catch (Exception exception)
                {
                    string msg = TextHelper.GetString("Info.CouldNotCreateProject");
                    ErrorManager.ShowInfo(msg + " " + exception.Message);
                }
            }

            return(null);
        }
Exemplo n.º 23
0
        public ProjectTemplateResult ShowNewProjectDialog(ISolutionFolder solutionFolder, IEnumerable <TemplateCategory> templates)
        {
                        #if DEBUG
            SD.Templates.UpdateTemplates();
                        #endif
            using (NewProjectDialog npdlg = new NewProjectDialog(templates ?? SD.Templates.TemplateCategories, createNewSolution: solutionFolder == null)) {
                npdlg.SolutionFolder = solutionFolder;
                if (solutionFolder != null)
                {
                    npdlg.InitialProjectLocationDirectory = AddNewProjectToSolution.GetInitialDirectorySuggestion(solutionFolder);
                }

                // show the dialog to request project type and name
                if (npdlg.ShowDialog(SD.WinForms.MainWin32Window) == DialogResult.OK)
                {
                    return(npdlg.result);
                }
                else
                {
                    return(null);
                }
            }
        }
Exemplo n.º 24
0
        void c_NewProject(object sender, EventArgs e)
        {
            NewProjectDialog    newProjectDialogWindow = new NewProjectDialog();
            NewProjectEventArgs args = (NewProjectEventArgs)e;
            var newProjectViewModel  = new NewProjectViewModel(args.Project);

            EventHandler handler = null;

            handler = delegate
            {
                newProjectViewModel.RequestClose -= handler;
                newProjectDialogWindow.Close();
                if (newProjectViewModel.Saved)
                {
                    viewModel.CreateMainClassWorkspace();
                }
            };

            newProjectViewModel.RequestClose += handler;

            newProjectDialogWindow.DataContext = newProjectViewModel;
            newProjectDialogWindow.ShowDialog();
        }
Exemplo n.º 25
0
        public void refresh()
        {
            ThisWasLastController twl = new ThisWasLastController("load");

            path = twl.GetFromHere();

            BinaryFormatter fm = new BinaryFormatter();
            FileStream      sm = null;

            try
            {
                sm = File.OpenRead(path);
                Model.MasterClass x = (Model.MasterClass)fm.Deserialize(sm);
                GlowingEarth.getInstance().getMaster().setTags(x.getTags());
                GlowingEarth.getInstance().getMaster().setTypes(x.getTypes());
                GlowingEarth.getInstance().getMaster().setResources(x.getResources());
                GlowingEarth.getInstance().getMaster().setTitle(x.getTitle());
                GlowingEarth.getInstance().getMaster().setSerPath(x.getSerPath());
                GlowingEarth.getInstance().getMaster().setMapItems(x.getMapItems());
            }
            catch (Exception e)
            {
                NewProjectDialog npd = new NewProjectDialog();
                npd.ShowDialog();
                twl.save();
            }
            finally
            {
                if (sm != null)
                {
                    sm.Dispose();
                    sm.Close();
                }
            }
            this.DataContext = this;
        }
Exemplo n.º 26
0
        public void PerformTest()
        {
            NewProjectDialog f = new NewProjectDialog();

            f.ShowDialog();
        }
Exemplo n.º 27
0
        private void NewProject_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var dialog = new NewProjectDialog(ProjectService, PathsService);

            dialog.ShowDialog();
        }
Exemplo n.º 28
0
        protected override void Execute()
        {
            NewProjectDialog template = new NewProjectDialog();

            template.ShowDialog();
        }
Exemplo n.º 29
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     NewProjectDialog dlg = new NewProjectDialog();
     dlg.Owner = this;
     dlg.ShowDialog();
 }
Exemplo n.º 30
0
        /*-------------------Akcije-------------------*/
        private void NewFile_Click(object sender, RoutedEventArgs e)
        {
            NewProjectDialog npd = new NewProjectDialog();

            npd.ShowDialog();
        }