protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); int rowIndexFromMouseDown = this.HitTest(e.X, e.Y).RowIndex; if (rowIndexFromMouseDown != -1) { DataGridViewRow row = this.Rows[rowIndexFromMouseDown]; object[] dataRow = new object[row.Cells.Count]; for (int i = 0; i < dataRow.Length; i++) { dataRow[i] = row.Cells[i].Value; } CreatureTemplate creatureData = Core.CreateCreatureTemplate(dataRow); this.DoDragDrop(creatureData, DragDropEffects.Copy); } }
public CreatureTemplate CreateCreatureTemplate(object[] data) { long entry = long.Parse(data[0].ToString()); string name = data[1].ToString(); string subname = data[2].ToString(); int minlevel = int.Parse(data[25].ToString()); int maxlevel = int.Parse(data[26].ToString()); float mindmg = float.Parse(data[35].ToString()); float maxdmg = float.Parse(data[36].ToString()); int health = int.Parse(data[29].ToString()); int mana = int.Parse(data[30].ToString()); int[] modelids = new int[4]; for (int i = 0; i < modelids.Length; i++) { modelids[i] = int.Parse(data[10+i].ToString()); } CreatureTemplate ct = new CreatureTemplate(entry, name, subname, minlevel, maxlevel, mindmg, maxdmg, health, mana, modelids); return ct; }
public CreatureTemplate CreateCreatureTemplate(object[] data) { long entry = long.Parse(data[0].ToString()); string name = data[1].ToString(); string subname = data[2].ToString(); int minlevel = int.Parse(data[25].ToString()); int maxlevel = int.Parse(data[26].ToString()); float mindmg = float.Parse(data[35].ToString()); float maxdmg = float.Parse(data[36].ToString()); int health = int.Parse(data[29].ToString()); int mana = int.Parse(data[30].ToString()); int[] modelids = new int[4]; for (int i = 0; i < modelids.Length; i++) { modelids[i] = int.Parse(data[10 + i].ToString()); } CreatureTemplate ct = new CreatureTemplate(entry, name, subname, minlevel, maxlevel, mindmg, maxdmg, health, mana, modelids); return(ct); }