Пример #1
0
        private void ButtonAddWidgetDataModel_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                LogicalLibrary.DataModelClasses.Table table = comboBoxDataModels.SelectedItem as LogicalLibrary.DataModelClasses.Table;
                if (table != null)
                {
                    DataSourceWpf dataSourceWPF = new DataSourceWpf(table);
                    dataSourceWPF.MakeCanvas();

                    document.AddWidget(dataSourceWPF);

                    comboBoxDataModels.Items.RemoveAt(comboBoxDataModels.SelectedIndex);
                    comboBoxDataModels.SelectedIndex = 0;
                }
            }
            catch (FileNotFoundException)
            {
                Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.InternalError);
                this.Close();
            }
            catch (ArgumentNullException)
            {
                Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.InternalError);
                this.Close();
            }
            catch (Exception error)
            {
                Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError +
                                     ": " + error.Message);
            }
        }
Пример #2
0
        private void btnListForm_Click(object sender, RoutedEventArgs e)
        {
            ListFormWpf listFormWPF = new ListFormWpf();

            try
            {
                listFormWPF.MakeCanvas();
            }
            catch (FileNotFoundException)
            {
                Util.ShowErrorMessage("No se pudo crear el canvas: FileNotFoundException");
            }
            catch (ArgumentNullException)
            {
                Util.ShowErrorMessage("No se pudo crear el canvas: ArgumentNullException");
            }
            document.AddWidget(listFormWPF);
        }