Beispiel #1
0
 public void LoadProjectCombo()
 {
     cbProject.SelectedIndex = -1;
     cbProject.Items.Clear();
     SlynchyProjectFiles.GetFiles();
     for (int i = 0; i < SlynchyProjectFiles.ProjectFiles.Count; i++)
     {
         cbProject.Items.Add(SlynchyProjectFiles.ProjectFiles[i]);
     }
 }
Beispiel #2
0
 private void butCreateProject_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(labPathFile.Text) && !String.IsNullOrEmpty(tbProjectName.Text))
     {
         var project = new SlynchyProject(tbProjectName.Text);
         ProjectFile     = tbFileName.Text + ".slynchy";
         ProjectPathFile = labPathFile.Text;
         ProjectName     = tbProjectName.Text;
         SlynchyProjectFiles.SaveProject(project, ProjectFile);
         this.Close();
     }
 }
Beispiel #3
0
 private void tbFileName_TextChanged(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(tbFileName.Text))
     {
         var path     = SlynchyProjectFiles.GetProjectFilesPath();
         var pathFile = Path.Combine(path, tbFileName.Text + ".slynchy");
         if (!File.Exists(pathFile))
         {
             labPathFile.Text = pathFile;
         }
     }
 }
Beispiel #4
0
 private void cbProject_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     //This will always be an existing project on the list, populate associated fields
     SlynchyProjectFiles.SaveProject(SlynchyTrack.Project, SlynchyTrack.ProjectFileName);
     if (!String.IsNullOrEmpty(cbProject.Text))
     {
         SlynchyProjectFiles.LoadProject(cbProject.Text);
         CurrProject = cbProject.Text;
         Project     = SlynchyTrack.Project;
         SetProjectFields();
     }
 }
Beispiel #5
0
        private void butDeleteProject_Click(object sender, System.EventArgs e)
        {
            var ProjectFileName = cbProject.Text;

            var DidDelete = SlynchyProjectFiles.DeleteProjectFile(ProjectFileName);

            if (DidDelete)
            {
                SlynchyTrack.Project         = null;
                SlynchyTrack.ProjectFileName = "";
                ClearFormFields();
                LoadProjectCombo();
            }
        }
Beispiel #6
0
        private void butAddTree_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(tbAddTreeName.Text) &&
                !String.IsNullOrEmpty(tbAddTreeRootDirectory.Text) &&
                !IsInTreeNameList(tbAddTreeName.Text) &&
                !IsInTreeDirList(tbAddTreeRootDirectory.Text))
            {
                var newTree           = new SlynchyDirectoryTree(tbAddTreeName.Text, tbAddTreeRootDirectory.Text);
                var CurrentComparison = SlynchyTrack.Project.FindComparison(cboSelectComparison.Text);
                CurrentComparison.Directories.Add(newTree);

                LoadDirTrees();
                tbAddTreeName.Text          = "";
                tbAddTreeRootDirectory.Text = "";
                SlynchyProjectFiles.SaveProject(SlynchyTrack.Project, SlynchyTrack.ProjectFileName);
                Application.DoEvents();
            }
        }
Beispiel #7
0
 private void SaveProject()
 {
     SlynchyProjectFiles.SaveProject(SlynchyTrack.Project, SlynchyTrack.ProjectFileName);
 }