コード例 #1
0
        StorageEditorForm CreateForm()
        {
            StorageEditorForm form = new StorageEditorForm();

            form.listBox1.ItemsSource = this.ReportStorage.DefaultView;
            return(form);
        }
コード例 #2
0
        public bool ShowSaveAsDialog(ref string recordName, IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.Owner = Window.GetWindow(designer as DependencyObject);
            form.listBox1.IsEnabled = true;
            form.textBox1.IsEnabled = true;
            bool?result = form.ShowDialog();

            recordName = form.textBox1.Text;
            return(result.Value);
        }
コード例 #3
0
        public string Open(IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.Owner = Window.GetWindow(designer as DependencyObject);
            form.textBox1.IsEnabled = false;
            bool?result = form.ShowDialog();

            if (result.HasValue && result.Value)
            {
                return((string)form.textBox1.Tag);
            }
            else
            {
                return(string.Empty);
            }
        }
コード例 #4
0
        public string ShowSaveDialog(string filePath, string reportTitle, IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.textBox1.Text      = reportTitle;
            form.listBox1.IsEnabled = false;
            bool?result = form.ShowDialog();

            if (result.HasValue && result.Value)
            {
                string title = form.textBox1.Text;
                if (!string.IsNullOrEmpty(title))
                {
                    return(title);
                }
                else
                {
                    MessageBox.Show("Incorrect report name", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Error);
                }
            }
            return(string.Empty);
        }