Exemplo n.º 1
0
        // edit the current data source properties
        void _btnEditSource_Click(object sender, RoutedEventArgs e)
        {
            var ds = Model.DataSources.CurrentItem as DataSource;

            if (ds != null)
            {
                var dlg = new ModalDialog("Data Source Settings", new DataSourceEditor(), ds);
                dlg.ShowDialog(MessageBoxButton.OKCancel);
            }
        }
Exemplo n.º 2
0
 // add a data source to the model
 void _btnAddSource_Click(object sender, RoutedEventArgs e)
 {
     var ds = new DataSource(Model);
     var dlg = new ModalDialog("Add Data Source", new DataSourceEditor(), ds);
     dlg.ShowDialog(MessageBoxButton.OKCancel);
     dlg.Closed += (ss, ee) =>
     {
         if (!ee.Cancel)
         {
             Model.AddDataSource(ds);
         }
     };
 }
Exemplo n.º 3
0
        // add a data source to the model
        void _btnAddSource_Click(object sender, RoutedEventArgs e)
        {
            var ds  = new DataSource(Model);
            var dlg = new ModalDialog("Add Data Source", new DataSourceEditor(), ds);

            dlg.ShowDialog(MessageBoxButton.OKCancel);
            dlg.Closed += (ss, ee) =>
            {
                if (!ee.Cancel)
                {
                    Model.AddDataSource(ds);
                }
            };
        }
Exemplo n.º 4
0
 // edit the current table properties
 void _btnEditTable_Click(object sender, RoutedEventArgs e)
 {
     var ds = Model.DataSources.CurrentItem as DataSource;
     if (ds != null && ds.Tables.CurrentItem != null)
     {
         var dlg = new ModalDialog("DataTable Settings", new DataTableEditor(), ds.Tables.CurrentItem);
         dlg.ShowDialog(MessageBoxButton.OKCancel);
     }
 }