示例#1
0
 public RecentSolutionControl(CSProjSolution solution)
 {
     InitializeComponent();
     Solution = solution;
     ProjectLocationLabel.Content = solution.CSProjSolutionFilePath;
     ProjectNameLabel.Content     = solution.SolutionName;
 }
示例#2
0
        //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();
        }
示例#3
0
 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"));
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 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;
     }
 }
示例#6
0
 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);
             }
         }
     }
 }
示例#7
0
 internal static string CreateNewXamlControlFile(CSProjSolution currentSolution, string text)
 {
     return(NewXamlControlFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$XamlFileName$", text.Replace(".xaml", "")));
 }
示例#8
0
 internal static string CreateNewClass(CSProjSolution currentSolution, string text)
 {
     return(NewClassFile.Replace("$ProjectName$", currentSolution.SolutionName).Replace("$ClassFileName$", text.Replace(".cs", "")));
 }
示例#9
0
 public AddNewWindow(CSProjSolution solution, WorkspaceWindow workspace)
 {
     InitializeComponent();
     CurrentSolution  = solution;
     CurrentWorkspace = workspace;
 }