void New() { try { CreateDbForm form = GetCreateDbForm(); if (form.ShowDialog() == DialogResult.OK) { if (form.IsDbProvider) { using (WaitCursor wr = new WaitCursor(this, Locale.Get("_createDb..."))) { ConnectionInfo gisConn = MapCreator.CreateGisDb(form.DbCreationProperties); app.CreateLib(gisConn); } } else { app.CreateLib(new ConnectionInfo(form.DbCreationProperties.dbName, form.FilePath)); } } } catch (Exception ex) { Log.Exception(ex); } }
void Export() { try { GLib lib = app.Lib; if (lib != null) { CreateDbForm form = GetCreateDbForm(); if (form.ShowDialog() == DialogResult.OK) { using (WaitCursor wc = new WaitCursor(this, Locale.Get("_exportingData..."))) { if (form.IsDbProvider) { ConnectionInfo gisConn = MapCreator.CreateGisDb(form.DbCreationProperties); using (Context context = lib.GetContext()) { context.TargetConn = gisConn.CreateConnection(); context.Filter = Filter.All; lib.Save(context); } app.UpdateConnectionList(gisConn); } else { Save(form.FilePath); } } } } } catch (Exception ex) { Log.Exception(ex); } }