Exemplo n.º 1
0
        public EditTaskForm(TH_Task source, IEnumerable <string> ownerSource, IEnumerable <string> tagSource, TaskCardComponent component)
        {
            OwnerSource = ownerSource.ToList();
            TagSource   = tagSource.ToList();
            Source      = source;
            Component   = component;
            InitializeComponent();
            NameTextBox.Text        = source.Name;
            DescriptionTextBox.Text = source.Description;
            checkBox1.Checked       = source.HasDate;
            if (source.HasDate)
            {
                DatePicker.Value   = source.Date;
                DatePicker.Enabled = true;
            }
            else
            {
                DatePicker.Value   = DateTime.Now;
                DatePicker.Enabled = false;
            }

            LinkTextBox.Text = source.Link;
            StatusPicker.Items.AddRange(TaskStatusWriter.All);
            StatusPicker.SelectedItem = new TaskStatusWriter(source.Status);
            OwnerComboBox.Items.AddRange(ownerSource.ToArray());
            ColourPicker.Colour        = source.Color;
            OwnerComboBox.SelectedItem = source.Owner;
            TagComboBox.Items.AddRange(tagSource.ToArray());
            foreach (var tag in source.Tags)
            {
                TagLayoutPanel.Controls.Add(new RemovableTagStrip(tag, TagLayoutPanel));
            }

            this.FormClosing += ReturnUserData;
        }
Exemplo n.º 2
0
 public TH_Task(string name, string description, string owner, string link, Color color, TaskStatus status, IEnumerable <string> tags, TaskCardComponent source)
 {
     Name        = name;
     Description = description;
     Owner       = owner;
     Link        = link;
     Color       = color;
     HasDate     = false;
     Date        = default;
     Status      = status;
     StatusIn    = status;
     Source      = source;
     _tags       = new ImmutableHashSet <string>(tags);
 }