public RecentSolutionControl(CSProjSolution solution) { InitializeComponent(); Solution = solution; ProjectLocationLabel.Content = solution.CSProjSolutionFilePath; ProjectNameLabel.Content = solution.SolutionName; }
//Create private void Button_Click(object sender, RoutedEventArgs e) { if (ProjectNameText.Text.Contains(" ")) { MessageBox.Show("Project name can't contain spaces or special characters.", "Illegal Character(s)", MessageBoxButton.OK); return; } string projectDirectory = ProjectDirectoryText.Text; if (CreateFolderCheck.IsChecked == true) { projectDirectory = Path.Combine(projectDirectory, ProjectNameText.Text); } if (CreateFolderCheck.IsChecked == true && Directory.Exists(projectDirectory)) { MessageBox.Show("A folder with the specified project name already exists.", "Already Exists", MessageBoxButton.OK); return; } CSProjSolution solution = new CSProjSolution(ProjectNameText.Text, ProjectDirectoryText.Text, CreateFolderCheck.IsChecked, SolutionType); WorkspaceWindow workspace = new WorkspaceWindow(solution); workspace.Show(); this.Close(); if (MainWindow.Current != null) { MainWindow.Current.Close(); } Settings.CurrentSettings.PreviouslyOpenedSolutionPaths.Insert(0, solution.CSProjSolutionFilePath); Settings.Save(); }
internal static string CreateNewXamlCsFile(CSProjSolution currentSolution, string text, bool isUserControl = false) { if (isUserControl) { return(NewXamlCsFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$XamlFileName$", text.Replace(".xaml", "")).Replace("$InheritedType$", "UserControl")); } else { return(NewXamlCsFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$XamlFileName$", text.Replace(".xaml", "")).Replace("$InheritedType$", "Window")); } }
public WorkspaceWindow(CSProjSolution solution) { InitializeComponent(); Current = this; CurrentSolution = solution; ProjectNameLabel.Content = solution.SolutionType.ToString() + "- " + solution.SolutionName; if (!string.IsNullOrWhiteSpace(solution.IconFileName)) { IconNameText.Text = solution.IconFileName; IconPreviewImage.Source = new BitmapImage(new Uri(Path.Combine(CurrentSolution.WorkingDirectoryPath, "img", solution.IconFileName))); } foreach (string s in solution.Sources) { AddProjectFile(s); } }
public SelectableProjectFile(CSProjSolution solution, string fileName, bool isXamlFile) { InitializeComponent(); FileName = fileName; CurrentSolution = solution; if (isXamlFile) { XamlFileLabel.Content = fileName; NonXamlFileLabel.Visibility = Visibility.Collapsed; XamlFileLabel.Visibility = Visibility.Visible; PreviewButton.Visibility = Visibility.Visible; } else { NonXamlFileLabel.Content = fileName; } }
private void LoadRecentProjects() { if (Settings.CurrentSettings.PreviouslyOpenedSolutionPaths == null) { Settings.CurrentSettings.PreviouslyOpenedSolutionPaths = new List <string>(); } if (Settings.CurrentSettings.PreviouslyOpenedSolutionPaths.Count > 0) { foreach (string path in Settings.CurrentSettings.PreviouslyOpenedSolutionPaths) { string projJson = File.ReadAllText(path); CSProjSolution solution = JsonConvert.DeserializeObject <CSProjSolution>(projJson); if (solution != null) { //add to recent project list RecentSolutionControl control = new RecentSolutionControl(solution); RecentSolutionsStack.Children.Add(control); } } } }
internal static string CreateNewXamlControlFile(CSProjSolution currentSolution, string text) { return(NewXamlControlFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$XamlFileName$", text.Replace(".xaml", ""))); }
internal static string CreateNewClass(CSProjSolution currentSolution, string text) { return(NewClassFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$ClassFileName$", text.Replace(".cs", ""))); }
public AddNewWindow(CSProjSolution solution, WorkspaceWindow workspace) { InitializeComponent(); CurrentSolution = solution; CurrentWorkspace = workspace; }