Refresh() public method

public Refresh ( ) : string
return string
Beispiel #1
0
        private void OKEditButton_Click(object sender, EventArgs e)
        {
            if (this.ListsList.SelectedItem == null)
            {
                return;
            }
            ListElement listItem = (ListElement)this.ListsList.SelectedItem;

            if (string.IsNullOrEmpty(this.NameTextBox.Text))
            {
                MessageBox.Show(Properties.Resources.ListManageOKButton1);
                return;
            }

            listItem.Name        = this.NameTextBox.Text;
            listItem.IsPublic    = this.PublicRadioButton.Checked;
            listItem.Description = this.DescriptionText.Text;

            string rslt = listItem.Refresh();

            if (!string.IsNullOrEmpty(rslt))
            {
                MessageBox.Show(String.Format(Properties.Resources.ListManageOKButton2, rslt));
                return;
            }

            this.ListsList.Items.Clear();
            this.ListManage_Load(null, EventArgs.Empty);

            this.EditCheckBox.AutoCheck = true;
            this.EditCheckBox.Checked   = false;
        }
Beispiel #2
0
        private async void OKEditButton_Click(object sender, EventArgs e)
        {
            if (this.ListsList.SelectedItem == null)
            {
                return;
            }

            using (ControlTransaction.Disabled(this))
            {
                ListElement listItem = (ListElement)this.ListsList.SelectedItem;

                if (string.IsNullOrEmpty(this.NameTextBox.Text))
                {
                    MessageBox.Show(Properties.Resources.ListManageOKButton1);
                    return;
                }

                listItem.Name        = this.NameTextBox.Text;
                listItem.IsPublic    = this.PublicRadioButton.Checked;
                listItem.Description = this.DescriptionText.Text;

                try
                {
                    await listItem.Refresh();
                }
                catch (WebApiException ex)
                {
                    MessageBox.Show(string.Format(Properties.Resources.ListManageOKButton2, ex.Message));
                    return;
                }

                this.ListsList.Items.Clear();
                this.ListManage_Load(null, EventArgs.Empty);

                this.EditCheckBox.AutoCheck = true;
                this.EditCheckBox.Checked   = false;
            }
        }