예제 #1
0
        private void Button_Save_Click(object Sender, EventArgs Args)
        {
            Settings.Config.LaunchOnStartup = CheckBox_LaunchOnStartup.Checked;
            Settings.Config.MinimizeToTray  = CheckBox_MinimizeToTray.Checked;
            Settings.Config.AlwaysOnTop     = CheckBox_AlwaysOnTop.Checked;
            Settings.Config.SaveWindowPos   = CheckBox_SaveWindowPos.Checked;

            Settings.Config.AutoUpdate   = CheckBox_CheckForUpdates.Checked;
            Settings.Config.PromptUpdate = CheckBox_PromptUpdate.Checked;

            Settings.Config.PromptClear  = CheckBox_PromptClear.Checked;
            Settings.Config.PromptDelete = CheckBox_PromptDelete.Checked;
            Settings.Config.EnterToSave  = CheckBox_EnterToSave.Checked;

            Settings.Config.StorageFolder = TextBox_Folder.Text;

            Settings.Config.GroupTasks = CheckBox_GroupTasks.Checked;
            Settings.Config.GroupStyle = (Settings.GroupStyles)ComboBox_GroupStyle.SelectedIndex;             // WONDER IF THIS WORKS
            Settings.Config.AlwaysShowCompletedGroup = CheckBox_AlwaysShowCompletedGroup.Checked;
            Settings.Config.AlwaysShowOverdueGroup   = CheckBox_AlwaysShowOverdueGroup.Checked;
            Settings.Config.AlwaysShowTodayGroup     = CheckBox_AlwaysShowTodayGroup.Checked;
            Settings.Config.ShowItemCounts           = CheckBox_ShowItemCounts.Checked;

            Settings.Config.EnabledColumns = Settings.Columns.Description;             // always enable the description column

            if (ListBox_EnabledColumns.SelectedIndices.Contains(0))
            {
                Settings.Config.EnabledColumns |= Settings.Columns.Notes;
            }
            if (ListBox_EnabledColumns.SelectedIndices.Contains(1))
            {
                Settings.Config.EnabledColumns |= Settings.Columns.Category;
            }
            if (ListBox_EnabledColumns.SelectedIndices.Contains(2))
            {
                Settings.Config.EnabledColumns |= Settings.Columns.Due;
            }
            if (ListBox_EnabledColumns.SelectedIndices.Contains(3))
            {
                Settings.Config.EnabledColumns |= Settings.Columns.Time;
            }

            if (ChangedStorageFolder)
            {
                ArrayHandler.Save();
            }

            Settings.Save();
            MainForm.Settings_Apply();
            MainForm.ListView_UpdateColumnSettings();
            MainForm.UpdateGroupKeys();
            MainForm.ListView.BuildList();
            MainForm.ListView.RebuildColumns();
        }
예제 #2
0
 private void Button_Save_Click(object Sender, EventArgs Args)
 {
     if (Task != null)
     {
         Task.Link = TextBox.Text;
         ArrayHandler.Save();
     }
     else
     {
         Console.WriteLine("Button_Save_Click(): Somehow Task was null!");
     }
 }
예제 #3
0
 private void Save_Click(object Sender, EventArgs Args)
 {
     if (Origination == 1)
     {
         if (Task != null)
         {
             Task.Notes = TextBox.Text;
             ArrayHandler.Save();
         }
         else
         {
             Console.WriteLine("Done_Click(): Somehow Task was null!");
         }
     }
     else
     {
         CreateForm.Notes = TextBox.Text;
     }
 }
예제 #4
0
        private void Button_Save_Click(object Sender, EventArgs Args)
        {
            DateTime NewTime = new DateTime();

            NewTime = Calendar.SelectionStart;

            TimeSpan TimeOfDay = new TimeSpan();

            Console.WriteLine("DateTime: {0} - {1}", NewTime.ToShortDateString(), NewTime.ToLongTimeString());

            NewTime = NewTime - NewTime.TimeOfDay;

            if (CheckBox.Checked)
            {
                if (RadioButton_Specific.Checked)
                {
                    NewTime   = NewTime + DateTimePicker.Value.TimeOfDay;
                    TimeOfDay = DateTimePicker.Value.TimeOfDay;
                    //_Task.Time.TimeOfDay = DateTimePicker.Value.TimeOfDay;
                }
                else
                {
                    NewTime   = NewTime + TimeSpan.FromSeconds(86399);
                    TimeOfDay = TimeSpan.FromSeconds(86399);
                    //_Task.Time.TimeOfDay = TimeSpan.FromSeconds(86399);
                }

                if (NewTime < DateTime.Now)
                {
                    Console.WriteLine("Can't have a date that is before now!");
                    MessageBox.Show(MainForm,
                                    "Scheduled time cannot be in the past",
                                    "Tasual",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Asterisk
                                    );
                    return;
                }
                else
                {
                    _Task.Time.Modified  = DateTime.Now;
                    _Task.Time.Next      = NewTime;
                    _Task.Time.TimeOfDay = TimeOfDay;
                }
            }
            else
            {
                _Task.Time = new TimeInfo(
                    DateTime.MinValue,
                    _Task.Time.Created,
                    DateTime.Now,
                    DateTime.MinValue,
                    DateTime.MinValue,
                    DateTime.MinValue);
            }

            ArrayHandler.Save();
            MainForm.UpdateGroupKeys(_Task);
            MainForm.ListView.BuildList();
            MainForm.ListView.EnsureModelVisible(_Task);
            Close();
        }