private void RefreshTable() { List <String> cardNames = CardGeneratorDB.Instance.getSingleColumnDataFromTable(CardGeneratorDB.TABLECardDefinitions, CardGeneratorDB.COLUMNCardDefinitionName); int iPos = 0; List <String> showCardNames = new List <String>(); TreeIter iter; store.GetIterFirst(out iter); bool bContinue = true; while (bContinue) { bool bChecked = (bool)store.GetValue(iter, 1); if (bChecked) { showCardNames.Add(cardNames[iPos]); } iPos++; bContinue = store.IterNext(ref iter); } CardOutput.BuildCardOutputTable(showCardNames, getOrderType()); String strTable = CardGeneratorDB.TABLECardOutput; List <String> columns = CardGeneratorDB.Instance.GetColumnNames(strTable); //List<Dictionary<String, String>> data = CardGeneratorDB.Instance.getDataFromTable (strTable); // add data System.Type[] types = new System.Type[columns.Count]; for (int i = 0; i < columns.Count; i++) { types [i] = columns [i].GetType(); } // Gtk.ListStore listStore = new Gtk.ListStore (types); // // Add some data to the store // foreach (Dictionary <String, String> entry in data) { // String[] row = new String[columns.Count]; // for (int i = 0; i < columns.Count; i++) { // row [i] = entry [columns [i]]; // } // listStore.AppendValues (row); // } // treeview1.Model = listStore; entryCardCount.Text = "" + CardGeneratorDB.Instance.GetRowCount(CardGeneratorDB.TABLECardOutput); }
protected void onBnExportANKI(object sender, EventArgs e) { // create a new database and load it Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the file to open", parentGtkWindow, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Save", ResponseType.Accept); if (fc.Run() == (int)ResponseType.Accept) { String fn = fc.Filename; CardOutput.saveToAnkiFile(fn); } fc.Destroy(); }
public DialogExportKLEIO() { this.Build(); textview1.Buffer.Text = CardOutput.textFromKLEIOOutput(); }