public CategoryData ToData() { return(new CategoryData(Name, WazeraUtils.HexToColor(DisplayColor)) { ID = ID }); }
private PriorityData(long id, string displayName, string iconName) { ID = id; DisplayName = displayName; bitmapImage = WazeraUtils.GetResource(iconName); Priorities.Add(this); PriorityMap.Add(ID, this); }
public UserModel(UserData userData) { ID = userData.ID; LoginName = userData.LoginName; FirstName = userData.FirstName; LastName = userData.LastName; Password = Convert.ToBase64String(Encoding.UTF8.GetBytes(userData.Password)); Avatar = WazeraUtils.GetResource("default_avatar.png"); }
public Ellipse GetLogoEllipse(int diameter) { return(new Ellipse { HorizontalAlignment = HorizontalAlignment.Right, Width = diameter, Height = diameter, Fill = new ImageBrush(Logo ?? WazeraUtils.GetResource("default_project.png")), Stroke = Brushes.LightSlateGray, StrokeThickness = 1 }); }
public TreeViewItem AddChild(ItemCollection parent, string title, string icon) { StackPanel verticalPanel = new StackPanel { Orientation = Orientation.Vertical, Background = Brushes.LightGray }; verticalPanel.MouseEnter += (sender, e) => verticalPanel.Background = new SolidColorBrush(Color.FromArgb(255, 190, 230, 253)); verticalPanel.MouseLeave += (sender, e) => verticalPanel.Background = Brushes.LightGray; StackPanel horizontalPanel = new StackPanel { Orientation = Orientation.Horizontal }; verticalPanel.Children.Add(horizontalPanel); verticalPanel.Children.Add(new Rectangle { Height = 3, Fill = Brushes.LightSkyBlue }); Label label = new Label { Content = title, Padding = new Thickness(5), FontWeight = FontWeights.DemiBold }; horizontalPanel.Children.Add(WazeraUtils.GetImage(icon, 16)); horizontalPanel.Children.Add(label); TreeViewItem item = new TreeViewItem { Header = verticalPanel, HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch, Padding = new Thickness(3) }; item.Selected += (sender, e) => item.IsSelected = false; parent.Add(item); return(item); }
private Button AddMenuButton(string displayName, string iconName) { StackPanel panel = new StackPanel() { HorizontalAlignment = HorizontalAlignment.Stretch, Orientation = Orientation.Horizontal, }; panel.Children.Add(new Image { Source = WazeraUtils.GetResource(iconName), Margin = new Thickness(5), Width = 24, Height = 24 }); panel.Children.Add(new Label { HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(5), Content = displayName, FontSize = 18, FontWeight = FontWeights.Bold, Foreground = Brushes.DarkSlateGray }); Button button = new Button { HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Left, Margin = new Thickness(5, 5, 5, 0), Content = panel, Background = Brushes.LightGray, BorderBrush = Brushes.SkyBlue, BorderThickness = new Thickness(0) }; projectPanel.Children.Add(button); return(button); }
public CategoryModel(CategoryData categoryData) { ID = categoryData.ID; Name = categoryData.Name; DisplayColor = WazeraUtils.ColorToHex(categoryData.DisplayColor); }
public CreateProjectDialog(ProjectList projects, ProjectData project) { Projects = projects; Project = project; InitializeComponent(); if (Project != null) { StatusModel.FillProject(Project); headerLabel.Content = "Edit Project " + Project.Key; deleteButton.IsEnabled = true; nameInput.Text = Project.Name; keyInput.Text = Project.Key; KanbanColumnOptions releaseColumn = null; List <StatusData> statuses = Project.GetAllStatuses(); foreach (StatusData status in statuses) { bool editable = !status.IsBacklog; string title = status.Title; string description = null; if (status.IsBacklog) { description = BacklogDescription; } else if (statuses.IndexOf(status) == 1) { description = PlannedDescription; } else if (status.IsRelease) { description = ReleaseDescription; } KanbanColumnOptions columnOptions = new KanbanColumnOptions(editable, title, description) { ID = status.ID }; columnOptions.SetMinCards(status.MinCards); columnOptions.SetMaxCards(status.MaxCards); if (status.IsRelease) { releaseColumn = columnOptions; } else { columnList.Children.Add(columnOptions); } } columnList.Children.Add(releaseColumn); } else { columnList.Children.Add(new KanbanColumnOptions(false, "Backlog", BacklogDescription)); columnList.Children.Add(new KanbanColumnOptions(true, "Planned", PlannedDescription)); columnList.Children.Add(new KanbanColumnOptions(true, "Done", ReleaseDescription)); } ImageBrush logoBrush = new ImageBrush(WazeraUtils.GetResource("default_project.png")); logoPreview.Fill = logoBrush; logoPreviewSmall.Fill = logoBrush; AddCategories(); nameInput.TextChanged += (sender, e) => GenerateKey(); keyInput.TextChanged += (sender, e) => FormatKey(); saveButton.Click += (sender, e) => SaveButtonClick(); }
public static UserData GetDefaultUser() { return(new UserData("test", "Peter", "Penguin", WazeraUtils.GetResource("default_avatar.png"))); }