Exemplo n.º 1
0
        public EntryInfoPanel(EventEntry e, TimeSpan span)
        {
            tagBorder.Padding = new Thickness(6, 3, 6, 3);
            tagBorder.Margin = new Thickness(18, 3, 6, 3);
            tbkTimeOffset.Margin = new Thickness(12, 6, 0, 6);
            tbkDescription.Margin = new Thickness(18, 6, 0, 6);

            switch (e.GetTag())
            {
                case "Deadline":
                    tagBorder.Background = new SolidColorBrush(Colors.OrangeRed);
                    if (span.Days < 4)
                    {
                        tagBorder.Background = new SolidColorBrush(Colors.Red);
                    }
                    break;
                case "Exam/Test":
                    tagBorder.Background = new SolidColorBrush(Color.FromArgb(255, 255, 201, 14));
                    break;
                default:
                    tagBorder.Background = new SolidColorBrush(Color.FromArgb(255, 200, 200, 200));
                    break;
            }
            tagText.Foreground = new SolidColorBrush(Colors.White);

            tagText.Text = e.GetTag();
            DateTime date = e.GetDateTime();
            if (span.Days == 0)
            {
                tbkTimeOffset.Text = (span.Hours != 0 ? (span.Hours + " hours ") : "") + span.Minutes + " minutes left";
            }
            else
            {
                tbkTimeOffset.Text = span.Days + " days " + (span.Hours != 0 ? (span.Hours + " hours ") : "") + "left";
            }
            tbkDescription.Text = "[ " + e.GetDescription() + " ]";

            tagBorder.Child = tagText;

            Orientation = Orientation.Horizontal;
            //
            Children.Add(tagBorder);
            Children.Add(tbkTimeOffset);
            Children.Add(tbkDescription);
        }
Exemplo n.º 2
0
        public void SetInfo(EventEntry e)
        {
            datePicker.Date = e.GetDateTime();
            timePicker.Time = new TimeSpan(datePicker.Date.Value.Hour, datePicker.Date.Value.Minute, 0);

            if ("True".Equals(e.Content[2]))
            {
                isFinished = true;
            }
            else
            {
                isFinished = false;
            }
            ckbxFinished.IsChecked = isFinished;

            tbxDescription.Text = e.Content[3].ToString();

            cbbxTags.SelectedItem = e.Content[4];
        }