Example #1
0
        public NewIssueControlHost(Project project)
        {
            if (project == null) throw new ArgumentNullException("project");

            InitializeComponent();
            this.Project = project;
        }
Example #2
0
        public ProjectHomeView(Project project)
        {
            if (project == null) throw new ArgumentNullException("project");

            InitializeComponent();

            this.Project = project;
            this.mListBoxOpenIssues.ToggleDoubleBuffering(true);
            this.SelectedFilter = IssueFilter.All;
        }
Example #3
0
        /// <summary>
        /// When the create button is clicked, we inform the world to commit changes.
        /// </summary>
        private void ButtonCreate_Click(object sender, EventArgs e)
        {
            var lProject = new Project();
            lProject.Name = this.mTextBoxTitle.Name;
            lProject.Description = this.mTextPreviewViewBody.Text;
            lProject.CreationDateTIme = DateTime.UtcNow;

            using (var lDataContext = new IssueTrackerDataContext())
            {
                var lProjectUser = new ProjectUser();
                lProjectUser.Project = lProject;
                lProjectUser.User = lDataContext.CurrentUser;

                lDataContext.Projects.InsertOnSubmit(lProject);
                lDataContext.ProjectUsers.InsertOnSubmit(lProjectUser);

                lDataContext.SubmitChanges();
            }

            this.ProjectCreated.Fire(this, ReadOnlyValueEventArgs.Create(lProject));
        }
 partial void DeleteProject(Project instance);
 partial void UpdateProject(Project instance);
 partial void InsertProject(Project instance);
Example #7
0
 /// <summary>
 /// Opens the given project.
 /// </summary>
 /// <param name="project">The project to open.</param>
 private void OpenProject(Project project)
 {
     var lProjectHomeView = new ProjectHomeView(project);
     this.PopToRootControlHost();
     this.PushControlHost(lProjectHomeView);
 }
Example #8
0
 /// <summary>
 /// Performs all actions for when a project is created.
 /// </summary>
 /// <param name="project">The project which was created.</param>
 private void OnProjectCreated(Project project)
 {
     this.mListBoxProjects.Items.Insert(0, WrapProject(project));
     this.mListBoxProjects.SelectedIndex = 0;
     this.OpenProject(project);
 }
Example #9
0
 /// <summary>
 /// Wraps the given valid project object.
 /// </summary>
 /// <param name="project">The project to wrap.</param>
 /// <returns>The wrapped project.</returns>
 private static GenericWrapper<Project> WrapProject(Project project)
 {
     System.Diagnostics.Debug.Assert(project != null, "This function only wraps valid project objects.");
     return new GenericWrapper<Project>(project, x => x.Name);
 }