Exemplo n.º 1
0
        public void createNoteClicked(object sender, RoutedEventArgs e)
        {
            AbstractActionSender actionSender = new ActionSender();

            if (ImportantCheckBox.IsChecked == true)
            {
                Console.WriteLine("important note checked");
                actionSender.Implementor = new ImportantImplementation(TopicAction, TextAction, IsImportantAction);
            }
            else
            {
                Console.WriteLine("not important note");
                actionSender.Implementor = new NotImportantImplementation(TopicAction, TextAction);
            }
            actionSender.SendNoteInfo(TopicFieldText, TextFieldText);

            DateTime deadline = new DateTime();

            try
            {
                deadline = (DateTime)DeadlinePicker.SelectedDate;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            if (deadline < DateTime.Today)
            {
                Console.WriteLine("Deadline is in the past, and is not been setted");
            }
            else
            {
                DeadlineAction(deadline);
            }

            this.Close();
        }
Exemplo n.º 2
0
 public override void CallSender()
 {
     TA = TSender;
     TA.BeginInvoke(null, null);
 }