/// <summary> /// Creates a new project with complete file structure /// </summary> /// <param name="name"></param> /// <param name="rootdir"></param> /// <returns></returns> public static Project CreateProject(String name, String rootdir) { Project p = new Project(); p.Title = name; p.Directory = FileHelper.CreateSecondDirectory(rootdir); p.Created = DateTime.Now; return p; }
public NewProjectForm(Project p) : this() { this.Text = "Edit project"; project = p; tbProjectName.Text = p.Title; foreach (String id in project.FieldIDs) active_fields.Add(id, true); }
/// <summary> /// Removes all the project's contents from hdd /// </summary> /// <param name="project"></param> /// <param name="rootdir"></param> public static void DeleteProject(Project project, String rootdir) { }
public static Boolean PhotoDownloaded(String root, Project project, Photo photo) { return File.Exists(PathToPhoto(root, project, photo)); }
public static String PathToProject(Project project) { return Path.Combine(ProjectsDir(), project.Directory); }
public static String PathToPhoto(String root, Project project, Photo photo) { return Path.Combine(root, project.Directory, photo.MD5Hash); }
/// <summary> /// Returns path to a photo file. /// </summary> /// <param name="proj"></param> /// <param name="photo"></param> /// <returns></returns> public static String PathToPhoto(Project proj, Photo photo) { return Path.Combine(PathToProject(proj), photo.MD5Hash); }
private void LoadProject(Project p) { // remove all inputs relate to the previous project RemoveInputs(); active_project = p; InitOpenProjectMenu(); p.LastOpen = DateTime.Now; this.Text = "Shop processor: " + p.Title; slAppMode.Text = "Edit project"; projectDeleteMenu.Enabled = true; projectEditMenu.Enabled = true; tabControl.SelectTab(0); btnTake.Enabled = true; exportMenu.Enabled = true; lbProducts.DataSource = active_project.Products; lbProducts.DisplayMember = "Name"; lbProducts.SelectedIndex = -1; // generate inputs for a product's metadata according to the current project preferences MakeInputs(); }
/// <summary> /// Removes a project /// </summary> /// <param name="p"></param> private void DeleteProject(Project p) { tabControl.SelectTab(0); lbProducts.DataSource = null; deleted_project_id = active_project.ID; downloadWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(downloadWorker_RunWorkerCompleted); downloadWorker.CancelAsync(); ProjectHelper.DeleteProject(p, FileHelper.ProjectsDir()); projects.Remove(active_project); active_project = null; projectDeleteMenu.Enabled = false; projectEditMenu.Enabled = false; InitOpenProjectMenu(); this.Text = "Shop processor"; slAppMode.Text = "Ready"; btnTake.Enabled = false; exportMenu.Enabled = false; }