public LoginDialog (SqlSharpGtk sqlSharpGtk) { sqlSharp = sqlSharpGtk; grid = new DataGrid (); providerCombo = ComboBox.NewText (); PopulateProviders (); PopulateAppSettings (); CreateGui (); SetStatusBarText ("Ready."); }
DataGrid CreateOutputResultsDataGrid () { DataGrid grid = new DataGrid (); grid.View.ButtonPressEvent += new Gtk.ButtonPressEventHandler (OnDataGridButtonPress); grid.View.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnDataGridButtonRelease); return grid; }
void OnDataGridButtonPress (object o, ButtonPressEventArgs args) { EventButton but = args.Event; /* Right Mouse Button is 3 */ if(but.Button == 3) { args.RetVal = true; // need to determine which grid was clicked if (currentEditorTab.grid != null) selectedGrid = currentEditorTab.grid; else if (currentEditorTab.gridResults != null) selectedGrid = currentEditorTab.gridResults.FindGrid ((TreeView) o); } }
void Dialog_Cancel (object o, EventArgs args) { grid.Clear (); grid.DataSource = null; grid.DataMember = ""; grid = null; dialog.Destroy (); dialog = null; }
void Connect_Action (object o, EventArgs args) { try { SetStatusBarText ("Connecting..."); sqlSharp.OpenDataSource (providers[providerSelected], connection_entry.Text, selectedSetting); SetStatusBarText ("Connected."); } catch (Exception e) { string emsg = "Error: Unable to connect. Reason: " + e; SetStatusBarText (emsg); sqlSharp.AppendText (emsg); } grid.Clear (); grid.DataSource = null; grid.DataMember = ""; grid = null; dialog.Destroy (); dialog = null; }