protected void Import_Click2(object sender, EventArgs e) { List <Dragon> lst = MobaImport.import(this.txtImport.Buffer.Text); foreach (var d in lst) { string id = d.id.ToLower(); if (!id.Equals("dragon") && !dragons.Contains(id)) { dragons.Add(d); } } StringBuilder sb = new StringBuilder(); foreach (var d in dragons.Values) { sb.Append(d.ToIonicClassString()).Append(Environment.NewLine); } txtDragons.Buffer.Text = sb.ToString(); }
protected void Import_Click(object sender, EventArgs e) { List <Dragon> lst = MobaImport.import(this.txtImport.Buffer.Text); foreach (var d in lst) { string id = d.id.ToLower(); if (!id.Equals("dragon") && !dragons.Contains(id)) { dragons.Add(d); } } // dragons.SaveToFile("dragons.xml"); // StringBuilder sb = new StringBuilder(); foreach (var d in dragons.Values) { sb.Append(d.ToString()).Append(Environment.NewLine); } txtDragons.Buffer.Text = sb.ToString(); this.treeview1.Model = dragons.getModel(); // // Gtk.TreeViewColumn idColumn = new Gtk.TreeViewColumn (); // idColumn.Title = "id"; // Gtk.CellRendererText idCell = new Gtk.CellRendererText (); // idColumn.PackStart (idCell, true); // // Gtk.TreeViewColumn iconColumn = new Gtk.TreeViewColumn (); // iconColumn.Title = "icon"; // Gtk.CellRendererText iconCell = new Gtk.CellRendererText (); // iconColumn.PackStart (iconCell, true); // idColumn.SetCellDataFunc(idCell, new TreeCellDataFunc(renderDragonID)); // this.treeview1.AppendColumn(idColumn); // iconColumn.SetCellDataFunc(iconCell, new TreeCellDataFunc(renderDragonIconText)); // this.treeview1.AppendColumn(iconColumn); // this.treeview1.AppendColumn(getCol("id")); // this.treeview1.AppendColumn(getCol("Breeding")); // this.treeview1.AppendColumn(getCol("Hatching")); // this.treeview1.AppendColumn(getCol("isLimitedTime")); // this.treeview1.AppendColumn(getCol("isClanShop")); // this.treeview1.AppendColumn(getCol("isVip")); // this.treeview1.AppendColumn(getCol("isDungeon")); // this.treeview1.AppendColumn(getCol("isSeasonal")); // this.treeview1.AppendColumn(getCol("isDailyQuestPuzzle")); // this.treeview1.AppendColumn(getCol("isFriendShipTotem")); // this.treeview1.AppendColumn(getCol("isReferal")); // this.treeview1.AppendColumn(getCol("isDailyLogin")); // this.treeview1.AppendColumn(getCol("dailyLoginCount")); // this.treeview1.AppendColumn(getCol("isEnchatmentBreed")); // this.treeview1.AppendColumn(getCol("isEnchatmentLeague")); // this.treeview1.AppendColumn(getCol("isArena")); // this.treeview1.AppendColumn(getCol("DragonType")); // this.treeview1.AppendColumn(getCol("Attack")); // this.treeview1.AppendColumn(getCol("Health")); // this.treeview1.AppendColumn(getCol("Cost")); // this.treeview1.AppendColumn(getCol("CostType")); // this.treeview1.AppendColumn(getCol("Elements")); // this.treeview1.AppendColumn(getCol("isUnreleased")); // this.treeview1.AppendColumn(getCol("isNormalBreadable")); Dragon data = new Dragon(); foreach (FieldInfo info in typeof(Dragon).GetFields()) { this.treeview1.AppendColumn(getCol(info)); // System.Diagnostics.Debug.WriteLine(info.Name); } }