private void OnImport() { SetStatus("Importing..."); try { var fmt = Person.Format.CSV; var fileName = ""; var chfmt = new ChooseConversionFormat(this); chfmt.Parent = this; chfmt.TransientFor = this; chfmt.SetPosition(Gtk.WindowPosition.CenterOnParent); var result = (Gtk.ResponseType)chfmt.Run(); chfmt.Hide(); fmt = chfmt.Format; fileName = chfmt.FileName; chfmt.Destroy(); if (result != Gtk.ResponseType.Cancel) { this.Import(fileName, fmt); } } catch (Exception exc) { Util.MsgError(this, AppInfo.Name, exc.Message); } this.SetStatus(); }
private void OnExport() { var fmt = Person.Format.CSV; var fileName = ""; var chfmt = new ChooseConversionFormat(this); chfmt.Parent = this; chfmt.TransientFor = this; chfmt.SetPosition(Gtk.WindowPosition.CenterOnParent); var result = (Gtk.ResponseType)chfmt.Run(); chfmt.Hide(); fmt = chfmt.Format; fileName = chfmt.FileName; chfmt.Destroy(); if (result != Gtk.ResponseType.Cancel) { Convert(fmt, fileName); } }
private void OnImport() { SetStatus( "Importing..." ); try { var fmt = Person.Format.CSV; var fileName = ""; var chfmt = new ChooseConversionFormat( this ); chfmt.Parent = this; chfmt.TransientFor = this; chfmt.SetPosition( Gtk.WindowPosition.CenterOnParent ); var result = (Gtk.ResponseType) chfmt.Run(); chfmt.Hide(); fmt = chfmt.Format; fileName = chfmt.FileName; chfmt.Destroy(); if ( result != Gtk.ResponseType.Cancel ) { this.Import( fileName, fmt ); } } catch(Exception exc) { Util.MsgError( this, AppInfo.Name, exc.Message ); } this.SetStatus(); }
private void OnExport() { var fmt = Person.Format.CSV; var fileName = ""; var chfmt = new ChooseConversionFormat( this ); chfmt.Parent = this; chfmt.TransientFor = this; chfmt.SetPosition( Gtk.WindowPosition.CenterOnParent ); var result = (Gtk.ResponseType) chfmt.Run(); chfmt.Hide(); fmt = chfmt.Format; fileName = chfmt.FileName; chfmt.Destroy(); if ( result != Gtk.ResponseType.Cancel ) { Convert( fmt, fileName ); } }