StorageEditorForm CreateForm()
        {
            StorageEditorForm form = new StorageEditorForm();

            foreach (string item in GetUrls())
            {
                form.listBox1.Items.Add(item);
            }
            return(form);
        }
        public override string GetNewUrl()
        {
            // Show the report selection dialog and return a URL for a selected report.
            StorageEditorForm form = CreateForm();

            form.textBox1.Enabled = false;
            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                return(form.textBox1.Text);
            }
            return(string.Empty);
        }
        public override string SetNewData(XtraReport report, string defaultUrl)
        {
            StorageEditorForm form = CreateForm();

            form.textBox1.Text    = defaultUrl;
            form.listBox1.Enabled = false;
            // Show the save dialog to get a URL for a new report.
            if (form.ShowDialog() == DialogResult.OK)
            {
                string url = form.textBox1.Text;
                if (!string.IsNullOrEmpty(url) && !form.listBox1.Items.Contains(url))
                {
                    TypeDescriptor.GetProperties(typeof(XtraReport))["DisplayName"].SetValue(report, url);
                    SetData(report, url);
                    return(url);
                }
                else
                {
                    MessageBox.Show("Incorrect report name", "Error",
                                    MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                }
            }
            return(string.Empty);
        }