Esempio n. 1
0
        public TicketView(Ticket ticket)
        {
            InitializeComponent();

            Project = ticket;

            labelId.Text         = "#" + ticket.ProjectTicketId.ToString();
            labelName.Text       = ticket.Name.ToString();
            labelName.Foreground = ticket.State == TicketState.Open ? Brushes.Black : Brushes.Gray;
            borderId.Background  = ticket.Type == TicketType.Task ? Brushes.LightBlue : Brushes.LightPink;

            ContextMenu = new ContextMenu();

            if (Project.IsOpen)
            {
                ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Close", () => RequestClose(ticket)));
            }
            else
            {
                ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Reopen", () => RequestReopen(ticket)));
            }

            ContextMenu.Items.Add(new Separator());
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Edit", () => RequestEdit(ticket)));
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Remove", () => RequestRemove(ticket)));

            PreviewMouseMove += UserControl_PreviewMouseMove;
        }
Esempio n. 2
0
        private void EditProject()
        {
            ViewDirector.EditEntity(Board.Project, Board.Context);

            if (Board.Project == null)
            {
                return;
            }
        }
Esempio n. 3
0
        public void NewProject()
        {
            var project = ViewDirector.AddEntity <Project>(Board.Context);

            if (project == null)
            {
                return;
            }
        }
Esempio n. 4
0
        public CellView(Guid featureId)
        {
            InitializeComponent();

            FeatureId = featureId;

            AllowDrop  = true;
            Background = Brushes.Transparent;

            ContextMenu = new ContextMenu();
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("New Ticket", () => RequestNewTicket(FeatureId)));
        }
Esempio n. 5
0
        public ProjectTile(Project project)
        {
            InitializeComponent();

            Project = project;

            labelName.Text       = project.Name;
            labelName.Foreground = Brushes.White;

            ContextMenu = new ContextMenu();
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Edit", () => RequestEdit(project)));
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Remove", () => RequestRemove(project)));

            tileProject.Click += (s, e) => RequestOpenProject(project);
        }
Esempio n. 6
0
        public TicketTile(Ticket ticket)
        {
            InitializeComponent();

            Project = ticket;

            labelName.Text       = ticket.Name.ToString();
            labelName.Foreground = Brushes.White;

            if (ticket.State == TicketState.Closed)
            {
                tileTicket.Background = CreateBrush("#27ae60");
            }
            else if (ticket.IsBacklogged)
            {
                tileTicket.Background = CreateBrush("#7f8c8d");
            }
            else if (ticket.Type == TicketType.Bug)
            {
                tileTicket.Background = CreateBrush("#e74c3c");
            }
            else
            {
                tileTicket.Background = CreateBrush("#3498db");
            }

            ContextMenu = new ContextMenu();

            if (Project.IsOpen)
            {
                ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Close", () => RequestClose(ticket)));
            }
            else
            {
                ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Reopen", () => RequestReopen(ticket)));
            }

            ContextMenu.Items.Add(new Separator());
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Edit", () => RequestEdit(ticket)));
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Remove", () => RequestRemove(ticket)));
            ContextMenu.Items.Add(new Separator());
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Convert to subfeature", () => RequestMakeSubfeature(ticket)));

            tileTicket.Click += (s, e) => RequestEdit(ticket);
        }
Esempio n. 7
0
        public HeaderView(dynamic entity, Orientation orientation)
        {
            InitializeComponent();

            labelHeader.Content = entity.Name;
            Entity = entity;

            if (orientation == Orientation.Horizontal)
            {
                borderHeader.BorderThickness = new Thickness(0, 0, 1, 0);
            }
            else if (orientation == Orientation.Vertical)
            {
                borderHeader.BorderThickness = new Thickness(0, 0, 0, 1);
            }

            FontWeight = FontWeights.Bold;

            ContextMenu = new ContextMenu();
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Edit", () => RequestEdit(Entity)));
            ContextMenu.Items.Add(ViewDirector.CreateMenuItem("Remove", () => RequestRemove(Entity)));
        }
Esempio n. 8
0
        private UIElement CreateAddNewFeatureButton()
        {
            var addNewFeatureButton = new Label
            {
                Content    = "+ Add new feature",
                FontSize   = 16,
                Foreground = Brushes.Black,
            };

            addNewFeatureButton.MouseLeftButtonDown += (s, e) =>
            {
                var newFeature = ViewDirector.AddFeature(Context, (Sprint ?? Project.Backlog).ID);

                if (newFeature == null)
                {
                    return;
                }

                Update(newFeature);
            };

            return(addNewFeatureButton);
        }
Esempio n. 9
0
        private void TabSprints_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.IsNullOrEmpty())
            {
                return;
            }

            var sprintTab = e.AddedItems.Cast <SprintTab>().First();

            if (sprintTab == SprintTab.NewSprint)
            {
                var newSprint = ViewDirector.AddEntity <Sprint>(Context, Project.ID);

                var lastSelectedTab = e.RemovedItems.Cast <SprintTab>().FirstOrDefault();

                if (lastSelectedTab != null && lastSelectedTab != SprintTab.NewSprint)
                {
                    tabSprints.SelectedItem = lastSelectedTab;
                }
                else
                {
                    tabSprints.SelectedItem = SprintTab.AllSprints;
                }

                if (newSprint == null)
                {
                    return;
                }

                Update(newSprint);

                return;
            }

            Sprint = sprintTab.Sprint;
            UpdateFeatures();
        }
Esempio n. 10
0
        private void UpdateFeatures()
        {
            featureTicketsStack.Children.Clear();

            IEnumerable <Feature> sortedFeatures;

            if (Sprint != null)
            {
                sortedFeatures = Sprint.Features.OrderBy(x => x.Name);
            }
            else
            {
                sortedFeatures = Project.Features.OrderBy(x => x.Name);
            }

            foreach (var feature in sortedFeatures)
            {
                var featurePanel = new FeatureTicketsPanel(Context, feature, Sprint, ShowClosedTickets);

                if (!ShowEmptyFeatures && featurePanel.IsEmpty)
                {
                    continue;
                }

                var featureHeader = CreateFeatureHeader(feature);

                featurePanel.Updated += entity => Update(entity);
                featurePanel.SetVisiblity(!feature.IsMinimised);

                featureHeader.MouseRightButtonDown += (s, e) => ViewDirector.EditEntity(featurePanel.Feature, Context);

                featureTicketsStack.Children.Add(featureHeader);
                featureTicketsStack.Children.Add(featurePanel);
            }

            featureTicketsStack.Children.Add(CreateAddNewFeatureButton());
        }
Esempio n. 11
0
 public void NewFeature()
 {
     ViewDirector.AddEntity <Feature>(Context, Project.ID);
     Update();
 }
Esempio n. 12
0
 public void NewSprint()
 {
     ViewDirector.AddEntity <Sprint>(Context, Project.ID);
     Update();
 }
Esempio n. 13
0
 public void NewTicket(Guid featureId)
 {
     ViewDirector.AddTicket(Context, Project.ID, featureId);
     Update();
 }
Esempio n. 14
0
        private async void RemoveEntity <T>(T entity) where T : Entity
        {
            await ViewDirector.RemoveEntity(entity, Context);

            Update();
        }
Esempio n. 15
0
 private void EditEntity <T>(T entity) where T : Entity
 {
     ViewDirector.EditEntity(entity, Context);
     Update();
 }
Esempio n. 16
0
 private void EditTicket(Ticket ticket)
 {
     ViewDirector.EditTicket(ticket, Context);
     Update();
 }
Esempio n. 17
0
 private void EditProject(Project project)
 {
     ViewDirector.EditEntity(project, Context);
     Updated();
 }
Esempio n. 18
0
 public void NewTicket()
 {
     ViewDirector.AddTicket(Board.Context, Board.Project.ID);
     Board.Update();
 }
Esempio n. 19
0
 public void NewFeature()
 {
     ViewDirector.AddEntity <Feature>(Board.Context, Board.Project.ID);
     Board.Update();
 }
Esempio n. 20
0
 public void NewSprint()
 {
     ViewDirector.AddEntity <Sprint>(Board.Context, Board.Project.ID);
     Board.Update();
 }
Esempio n. 21
0
 public void NewTicket()
 {
     ViewDirector.AddTicket(Context, Project.ID);
     Update();
 }
Esempio n. 22
0
        public void NewProject()
        {
            var project = ViewDirector.AddEntity <Project>(Context);

            Update();
        }
Esempio n. 23
0
        private async Task RemoveEntity <T>(T entity) where T : Entity
        {
            await ViewDirector.RemoveEntity(entity, Context);

            Updated(null);
        }