Пример #1
0
 private void ShowAvailableUpdate(string version, string url_setup, int size_setup, string url_portable, int size_portable)
 {
     lblNewVersion.Text         = string.Format(Lang.Get("updates_new_version"), version);
     btnDownloadSetup.Text      = " " + string.Format(Lang.Get("updates_download_setup"), version, size_setup);
     btnDownloadPortable.Text   = " " + string.Format(Lang.Get("updates_download_portable"), version, size_portable);
     btnDownloadSetup.Click    += delegate { System.Diagnostics.Process.Start(url_setup); };
     btnDownloadPortable.Click += delegate { System.Diagnostics.Process.Start(url_portable); };
     ShowPanel(panNewVersion);
 }
Пример #2
0
        /// <summary>
        /// Update properties of the Category object.
        /// </summary>
        public bool Save()
        {
            // Check compulsory fields
            if (txtName.Text == "")
            {
                Utils.MsgDialog.Warning(Lang.Get("invalid_entry"), Lang.Get("warning"));
                txtName.Focus();
                return(false);
            }

            // Update fileld from GUI
            category.Name   = txtName.Text;
            category.Colour = (Color)(((ImageComboItem)cmbColour.SelectedItem).Tag);

            return(true);
        }
Пример #3
0
        /// <summary>
        /// Edit a Category object.
        /// </summary>
        /// <param name="category">Category to edit</param>
        public CategoryForm(Languages.Language language, Category category)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Setup task
            this.category = category;

            // Create form icon
            this.Icon = IconColoured.GetSquaredIcon(category.Colour);

            // Setup language
            Lang                 = language;
            Text                 = Lang.Get((category.Id == 0) ? "category_add" : "category_edit");
            btnOk.Text           = " " + Lang.Get((category.Id == 0) ? "add" : "edit");
            btnCancel.Text       = Lang.Get("cancel");
            btnChooseColour.Text = " " + Lang.Get("colour_choose");
            lblName.Text         = Lang.Get("name") + ":";
            lblColour.Text       = Lang.Get("colour") + ":";

            // Populate colours combo
            int index = 0;

            cmbColour.ImageList.ColorDepth = ColorDepth.Depth32Bit;
            foreach (Category cat in Todomoo.Categories)
            {
                cmbColour.ImageList.Images.Add(IconColoured.GetSquared(cat.Colour));
                ImageComboItem item = new ImageComboItem(Lang.Get("colour_as") + " " + cat.Name, index);
                item.Tag = cat.Colour;
                cmbColour.Items.Add(item);
                index++;
            }
            if (cmbColour.Items.Count == 0)
            {
                cmbColour.ImageList.Images.Add(IconColoured.GetSquared(Color.Gray));
                ImageComboItem item = new ImageComboItem(Lang.Get("default"), index);
                item.Tag = Color.Gray;
                cmbColour.Items.Add(item);
            }
            cmbColour.SelectedIndex = 0;

            // Fill in GUI fields
            txtName.Text = category.Name;
            foreach (ImageComboItem item in cmbColour.Items)
            {
                if (item.Text == Lang.Get("colour_as") + " " + category.Name)
                {
                    cmbColour.SelectedItem = item;
                }
            }
        }
Пример #4
0
        public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Show first panel
            ShowPanel(panChecking);

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang = language;
            Text = Lang.Get("updates");
            btnClose.Text = Lang.Get("close");

            // Language setup
            lblChecking.Text = Lang.Get("updates_checking") + "...";
            lblUpdated.Text = Lang.Get("updates_updated");
            lblError.Text = Lang.Get("updates_error");
            chkAuto.Text = Lang.Get("updates_auto");

            // Auto check
            chkAuto.Checked = (Settings.Get("updates_auto").ToString() == "1");
            chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
        }
Пример #5
0
        public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Show first panel
            ShowPanel(panChecking);

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang          = language;
            Text          = Lang.Get("updates");
            btnClose.Text = Lang.Get("close");

            // Language setup
            lblChecking.Text = Lang.Get("updates_checking") + "...";
            lblUpdated.Text  = Lang.Get("updates_updated");
            lblError.Text    = Lang.Get("updates_error");
            chkAuto.Text     = Lang.Get("updates_auto");

            // Auto check
            chkAuto.Checked         = (Settings.Get("updates_auto").ToString() == "1");
            chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
        }
Пример #6
0
        public AboutForm(Languages.Language language)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Version no
            Version v = new Version(Application.ProductVersion);

            lblBuild.Text = v.Major + "." + v.Minor;

            // Language
            btnClose.Text = language.Get("close");
            Text          = language.Get("help_about");

            // Credits
            string htmlCredits = @"
				<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd"">
				<html lang=""en"">
				<head>
					<style type=""text/css"">
						body {
							font-size: 11px;
							font-family: Tahoma, sans-serif;
							margin: 0;
							padding: 10px 10px;
							background-color: #f6f6f6;
							color: #000000;
						}
						p {
							padding: 0;
							margin: 0 0 10px;
						}
					</style>
				</head>
				<body>
					<p>
						Best beta tester ever: <b>Davide &quot;Gege&quot; De Gennaro</b><br>
						Cutest beta tester ever: <b>Serena Mantovani</b>
					</p>
					<p>
						French translation: <b>MML67</b><br>
						Portuguese translation: <b>Edson Braga Zampieri</b><br>
						Spanish translation: <b>Ian</b><br>
						Chinese translation: <b>Chunhui Zhao</b><br>
						Dutch translation: <b>Rick Spaan</b><br>
						Thai translation: <b>Prakrit Dungsutha</b><br>
						Polish translation: <b>Eugeniusz Wieczorek</b><br>
						Greek translation: <b>geogeo.gr</b><br>
						Romanian translation: <b>Oprea Nicolae</b><br>
						German translation: <b>Wolfgang Gaida</b><br>
						Russian translation: <b>Василий Павлов</b>
					</p>
					<p>
						<a href=""http://www.famfamfam.com/lab/icons/silk/"">Silk icons</a> by FamFamFam.<br>
						<a href=""http://www.codeproject.com/KB/list/ObjectListView.aspx"">Object list view</a> by Phillip Piper (GNU GPL).
					</p>
				</body>
				</html>
			"            ;

            webCredits.DocumentText = htmlCredits.Trim(new char[] { '\n', '\r', '\t', ' ' }).Trim();
            webCredits.Navigating  += delegate(object sender, WebBrowserNavigatingEventArgs e) {
                System.Diagnostics.Process.Start(e.Url.ToString());
                e.Cancel = true;
            };
        }
Пример #7
0
        // Constructor
        public OptionsForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang           = language;
            Text           = Lang.Get("options");
            btnOk.Text     = Lang.Get("ok");
            btnCancel.Text = Lang.Get("cancel");

            // Setup language for GUI
            tabGui.Text                 = Lang.Get("options_gui");
            boxAppearance.Text          = Lang.Get("options_appearance");
            lblMenuStyle.Text           = Lang.Get("options_menu") + ":";
            lblToolbarStyle.Text        = Lang.Get("options_toolbar") + ":";
            lblCategoriesStyle.Text     = Lang.Get("options_categories_bar") + ":";
            cmbMenuStyle.Items[0]       = Lang.Get("options_style_standard");
            cmbMenuStyle.Items[1]       = Lang.Get("options_style_flat");
            cmbToolbarStyle.Items[0]    = Lang.Get("options_style_standard");
            cmbToolbarStyle.Items[1]    = Lang.Get("options_style_flat");
            cmbCategoriesStyle.Items[0] = Lang.Get("options_style_standard");
            cmbCategoriesStyle.Items[1] = Lang.Get("options_style_flat");
            boxLanguage.Text            = Lang.Get("options_language");
            lblCurrency.Text            = Lang.Get("options_currency") + ":";

            // Setup language for backup
            tabBackup.Text          = Lang.Get("options_backups");
            cmdBackupDirectory.Text = Lang.Get("options_backup_dir");
            lblBackupTip.Text       = Lang.Get("options_backup_tip");
            boxAutomaticBackup.Text = Lang.Get("options_automatic_backup");
            chkAutomaticBackup.Text = Lang.Get("options_automatic_backup_text");

            // Setup language for minimize to tray
            boxBehaviour.Text       = Lang.Get("options_behaviour");
            lblClosing.Text         = Lang.Get("options_closing") + ":";
            optClosingMinimize.Text = Lang.Get("minimize_to_tray");
            optClosingClose.Text    = Lang.Get("close_program");

            // Fill in fields for the GUI
            cmbMenuStyle.SelectedIndex       = (Settings.Get("style_menu").ToString() == "0" ? 0 : 1);
            cmbToolbarStyle.SelectedIndex    = (Settings.Get("style_toolbar").ToString() == "0" ? 0 : 1);
            cmbCategoriesStyle.SelectedIndex = (Settings.Get("style_categories").ToString() == "0" ? 0 : 1);
            cmbCurrency.SelectedIndex        = 0;
            if (Settings.Get("currency").ToString() == "€")
            {
                cmbCurrency.SelectedIndex = 0;
            }
            if (Settings.Get("currency").ToString() == "$")
            {
                cmbCurrency.SelectedIndex = 1;
            }
            if (Settings.Get("currency").ToString() == "£")
            {
                cmbCurrency.SelectedIndex = 2;
            }
            if (Settings.Get("currency").ToString() == "¥")
            {
                cmbCurrency.SelectedIndex = 3;
            }
            if (Settings.Get("currency").ToString() == "R$")
            {
                cmbCurrency.SelectedIndex = 4;
            }
            if (Settings.Get("currency").ToString() == "฿")
            {
                cmbCurrency.SelectedIndex = 5;
            }

            // Fill in languages combo
            cmbLanguage.Items.Clear();
            foreach (Languages.AvailableLanguage l in Languages.AvailableLanguage.GetAll())
            {
                cmbLanguage.Items.Add(l);
                if (Settings.Get("lang").ToString() == l.Code)
                {
                    cmbLanguage.SelectedItem = l;
                }
            }

            // Fill in minimize radio
            if (Settings.Get("window_minimize_when_closing").ToString() == "0")
            {
                optClosingClose.Checked = true;
            }
            else
            {
                optClosingMinimize.Checked = true;
            }

            // Fill in fields for the backup
            chkAutomaticBackup.Checked = (Settings.Get("backup_automatic").ToString() == "1");
            try {
                long          sum        = 0;
                DirectoryInfo backup_dir = new DirectoryInfo(MainForm.BackupDirectory);
                if (!backup_dir.Exists)
                {
                    backup_dir.Create();
                }
                FileInfo[] files = backup_dir.GetFiles("*.sqlite");
                foreach (FileInfo file in files)
                {
                    sum += file.Length;
                }
                lblBackupSize.Text = ((float)sum / (1024F * 1024F)).ToString("0.00").Replace(',', '.') + " MB";
            } catch {
                lblBackupSize.Text = "? MB";
            }
        }
Пример #8
0
        // Constructor
        public OptionsForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang = language;
            Text = Lang.Get("options");
            btnOk.Text = Lang.Get("ok");
            btnCancel.Text = Lang.Get("cancel");

            // Setup language for GUI
            tabGui.Text = Lang.Get("options_gui");
            boxAppearance.Text = Lang.Get("options_appearance");
            lblMenuStyle.Text = Lang.Get("options_menu") + ":";
            lblToolbarStyle.Text = Lang.Get("options_toolbar") + ":";
            lblCategoriesStyle.Text = Lang.Get("options_categories_bar") + ":";
            cmbMenuStyle.Items[0] = Lang.Get("options_style_standard");
            cmbMenuStyle.Items[1] = Lang.Get("options_style_flat");
            cmbToolbarStyle.Items[0] = Lang.Get("options_style_standard");
            cmbToolbarStyle.Items[1] = Lang.Get("options_style_flat");
            cmbCategoriesStyle.Items[0] = Lang.Get("options_style_standard");
            cmbCategoriesStyle.Items[1] = Lang.Get("options_style_flat");
            boxLanguage.Text = Lang.Get("options_language");
            lblCurrency.Text = Lang.Get("options_currency") + ":";

            // Setup language for backup
            tabBackup.Text = Lang.Get("options_backups");
            cmdBackupDirectory.Text = Lang.Get("options_backup_dir");
            lblBackupTip.Text = Lang.Get("options_backup_tip");
            boxAutomaticBackup.Text = Lang.Get("options_automatic_backup");
            chkAutomaticBackup.Text = Lang.Get("options_automatic_backup_text");

            // Setup language for minimize to tray
            boxBehaviour.Text = Lang.Get("options_behaviour");
            lblClosing.Text = Lang.Get("options_closing") + ":";
            optClosingMinimize.Text = Lang.Get("minimize_to_tray");
            optClosingClose.Text = Lang.Get("close_program");

            // Fill in fields for the GUI
            cmbMenuStyle.SelectedIndex = (Settings.Get("style_menu").ToString() == "0" ? 0 : 1);
            cmbToolbarStyle.SelectedIndex = (Settings.Get("style_toolbar").ToString() == "0" ? 0 : 1);
            cmbCategoriesStyle.SelectedIndex = (Settings.Get("style_categories").ToString() == "0" ? 0 : 1);
            cmbCurrency.SelectedIndex = 0;
            if (Settings.Get("currency").ToString() == "€" ) cmbCurrency.SelectedIndex = 0;
            if (Settings.Get("currency").ToString() == "$" ) cmbCurrency.SelectedIndex = 1;
            if (Settings.Get("currency").ToString() == "£" ) cmbCurrency.SelectedIndex = 2;
            if (Settings.Get("currency").ToString() == "¥" ) cmbCurrency.SelectedIndex = 3;
            if (Settings.Get("currency").ToString() == "R$") cmbCurrency.SelectedIndex = 4;
            if (Settings.Get("currency").ToString() == "฿" ) cmbCurrency.SelectedIndex = 5;

            // Fill in languages combo
            cmbLanguage.Items.Clear();
            foreach (Languages.AvailableLanguage l in Languages.AvailableLanguage.GetAll()) {
                cmbLanguage.Items.Add(l);
                if (Settings.Get("lang").ToString() == l.Code) cmbLanguage.SelectedItem = l;
            }

            // Fill in minimize radio
            if (Settings.Get("window_minimize_when_closing").ToString() == "0") optClosingClose.Checked = true;
            else optClosingMinimize.Checked = true;

            // Fill in fields for the backup
            chkAutomaticBackup.Checked = (Settings.Get("backup_automatic").ToString() == "1");
            try {
                long sum = 0;
                DirectoryInfo backup_dir = new DirectoryInfo(MainForm.BackupDirectory);
                if (!backup_dir.Exists) backup_dir.Create();
                FileInfo[] files = backup_dir.GetFiles("*.sqlite");
                foreach (FileInfo file in files) sum += file.Length;
                lblBackupSize.Text = ((float)sum / (1024F * 1024F)).ToString("0.00").Replace(',', '.') + " MB";
            } catch {
                lblBackupSize.Text = "? MB";
            }
        }
Пример #9
0
        /// <summary>
        /// Edit a Task object showing a specific section.
        /// </summary>
        /// <param name="task">Task to edit</param>
        /// <param name="start_tab">The forst section to show</param>
        public TaskForm(Languages.Language language, Utils.AppSettings settings, Task task, StartingTab start_tab)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Setup task
            this.task = task;

            // Form icon
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaskForm));
            Icon = (task.Id == 0) ? ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))) : ((System.Drawing.Icon)(resources.GetObject("$this.Icon2")));

            // Language
            Lang           = language;
            Text           = Lang.Get((task.Id == 0) ? "task_add" : "task_edit");
            btnOk.Text     = " " + Lang.Get((task.Id == 0) ? "add" : "edit");
            btnCancel.Text = Lang.Get("cancel");
            ApplyLanguage();

            // Settings
            Settings         = settings;
            lblCurrency.Text = Settings.Get("currency").ToString();

            // Starting tab
            switch (start_tab)
            {
            case StartingTab.DatesTime:   tabs.SelectedTab = tabDatesTime; break;

            case StartingTab.Payment:     tabs.SelectedTab = tabPayment;   break;

            case StartingTab.Notes:       tabs.SelectedTab = tabNotes;     break;
            }

            // Populate combos
            PopulateColourCombo();
            PopulatePriorityCombo();
            PopulatePaymentCombo();
            if (task.IsRoot())
            {
                PopulateCategoryCombo(task.CategoryId);                            // Category combo also for root tasks
            }
            // Fill in GUI fields (general)
            txtName.Text = task.Name;
            try { txtDescription.Text = task.Description; } catch { txtDescription.Text = ""; }
            foreach (ImageComboItem item in cmbColour.Items)
            {
                if (item.Text == Lang.Get("colour_as") + " " + task.Name)
                {
                    cmbColour.SelectedItem = item;
                }
            }
            cmbPriority.SelectedIndex = task.Priority % 3;

            // Fill in GUI fields (dates and time)
            dtCreationDate.Value = task.CreationDate;
            try { dtDueDate.Value = task.DueDate; chkDueDateNot.Checked = false; } catch { chkDueDateNot.Checked = true; }
            try { dtCompleted.Value = task.Completed; chkCompletedNot.Checked = false; } catch { chkCompletedNot.Checked = true; }
            try { int t = task.Timer; chkUseTimer.Checked = true; } catch { chkUseTimer.Checked = false; }
            try { numTimerS.Value = task.Timer % 60;
                  numTimerM.Value = ((task.Timer - numTimerS.Value) / 60) % 60;
                  numTimerH.Value = (task.Timer - numTimerS.Value - numTimerM.Value * 60) / (60 * 60); } catch { }

            // If the timer is running, disable timer fields.
            if (task.IsTimerRunning())
            {
                chkUseTimer.Enabled        = false;
                lblTimer.Visible           = btnTimerReset.Visible = btnSumTimers.Visible = false;
                numTimerS.Visible          = numTimerM.Visible = numTimerH.Visible = false;
                lblTimerS.Visible          = lblTimerM.Visible = lblTimerH.Visible = false;
                panCannotEditTimer.Visible = true;
                lblCannotEditTimer.Text    = Lang.Get("task_timer_is_running");
            }

            // Fill in GUI fields (payment)
            try {
                chkPerHour.Checked = task.PricingByHour;
                if (task.PricingByHour)
                {
                    numPrice.Value = (Decimal)task.PriceByHour;
                }
                else
                {
                    numPrice.Value = (Decimal)task.Price;
                }
                chkPriceNot.Checked = false;
            } catch { chkPriceNot.Checked = true; }
            try { dtPaid.Value = task.Paid; chkPaidNot.Checked = false; }  catch { chkPaidNot.Checked = true; }
            try { cmbPaymentType.Text = task.Payment; } catch { }
            try { txtPaymentNote.Text = task.PaymentNote; } catch { txtPaymentNote.Text = ""; }
            chkPerHour.Enabled = !chkPriceNot.Checked;

            // Show/hide task parent
            if (task.ParentId != 0)
            {
                cmbCategory.Hide();
            }
            lblCategory.Visible    = btnAddCategory.Visible = (task.ParentId == 0);
            btnAddCategory.Enabled = (task.ParentId == 0);
            lblSubTaskOf.Visible   = panParent.Visible = (task.ParentId != 0);

            // Setup task parent
            if (!task.IsRoot())
            {
                try {
                    Task parent = new Task(task.ParentId);
                    lblParentName.Text  = parent.Name;
                    boxParentIcon.Image = IconColoured.GetSquared(parent.Colour);
                    task.CategoryId     = parent.CategoryId;                 // Same category of the parent!
                    if (task.Id == 0)
                    {
                        foreach (ImageComboItem item in cmbColour.Items)
                        {
                            if (item.Text == Lang.Get("colour_as") + " " + parent.Name)
                            {
                                cmbColour.SelectedItem = item;
                            }
                        }
                    }
                } catch {
                    lblParentName.Text  = Lang.Get("task_loading_error");
                    boxParentIcon.Image = IconColoured.GetSquared(Color.Gray);
                }
            }

            // Notes settings (this is not so good, calling MainForm in this way...)
            try { notes_monospace_font = new FontFamily("Consolas"); } catch { }
            chkMonospace.Checked = (Todomoo.mainForm.Settings.Get("note_monospace").ToString() == "1");
            chkWordWrap.Checked  = (Todomoo.mainForm.Settings.Get("note_word_wrap").ToString() == "1");

            // Draw note accordion
            DrawNotesAccordion();

            // Form size and "sizeability"
            TabsSelectedIndexChanged();
            TaskFormResize();
        }
Пример #10
0
        /// <summary>
        /// Update properties of the Task object.
        /// </summary>
        public bool Save()
        {
            // Check compulsory fields
            if (txtName.Text == "")
            {
                Utils.MsgDialog.Warning(Lang.Get("invalid_entry"), Lang.Get("warning"));
                tabs.SelectedTab = tabGeneral;
                txtName.Focus();
                return(false);
            }

            // Check if there is no category
            if (cmbCategory.Enabled == false)
            {
                Utils.MsgDialog.Warning(Lang.Get("category_must_create"), Lang.Get("warning"));
                tabs.SelectedTab = tabGeneral;
                if (btnAddCategory.Visible && btnAddCategory.Enabled)
                {
                    btnAddCategory.Focus();
                }
                return(false);
            }

            // Update fields from the GUI (General)
            task.Name = txtName.Text;
            if (txtDescription.Text != "")
            {
                task.Description = txtDescription.Text;
            }
            else
            {
                task.RemoveDescription();
            }
            task.Colour   = (Color)(((ImageComboItem)cmbColour.SelectedItem).Tag);
            task.Priority = cmbPriority.SelectedIndex;

            // Category switch
            if (task.IsRoot())
            {
                int newCategory = (int)(((ImageComboItem)cmbCategory.SelectedItem).Tag);
                if (newCategory != task.CategoryId)
                {
                    Todomoo.ChangeCategoryToHierarchy(task, newCategory);
                }
            }

            // Update fields from the GUI (Dates and time)
            task.CreationDate = dtCreationDate.Value;
            if (!chkDueDateNot.Checked)
            {
                task.DueDate = dtDueDate.Value;
            }
            else
            {
                task.RemoveDueDate();
            }
            if (!chkCompletedNot.Checked)
            {
                task.Completed = dtCompleted.Value;
            }
            else
            {
                task.RemoveCompleted();
            }
            if (!task.IsTimerRunning())
            {
                if (chkUseTimer.Checked)
                {
                    task.Timer = (int)numTimerS.Value + (int)numTimerM.Value * 60 + (int)numTimerH.Value * 60 * 60;
                }
                else
                {
                    task.RemoveTimer();
                }
            }

            // Update fields from the GUI (Payment)
            if (!chkPriceNot.Checked)
            {
                task.PricingByHour = chkPerHour.Checked;
                if (task.PricingByHour)
                {
                    task.PriceByHour = (float)numPrice.Value;
                }
                else
                {
                    task.Price = (float)numPrice.Value;
                }
            }
            else
            {
                task.RemovePrice();
            }
            if ((!chkPaidNot.Checked) && (!chkPriceNot.Checked))
            {
                task.Paid = dtPaid.Value;
            }
            else
            {
                task.RemovePaid();
            }
            if ((!chkPaidNot.Checked) && (!chkPriceNot.Checked))
            {
                task.Payment = cmbPaymentType.Text;
            }
            else
            {
                task.RemovePayment();
            }
            if (txtPaymentNote.Text != "")
            {
                task.PaymentNote = txtPaymentNote.Text;
            }
            else
            {
                task.RemovePaymentNote();
            }

            // Say to the task object the notes to update
            ArrayList pending_notes = new ArrayList();

            foreach (Control item in accordion.Controls)
            {
                if (item is AccordionItem)
                {
                    try { pending_notes.Add((Note)item.Tag); } catch { }
                }
            }
            task.SetUnsavedNotes(pending_notes);

            return(true);
        }