STDRuleslist.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. using OTS.WinFormsUI.Docking;
  2. using SourceGrid;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace OTSPartA_STDEditor
  13. {
  14. public partial class STDRuleslist : DockContent
  15. {
  16. public int PreRow = 1;//之前选中的位置
  17. public Form_Main m_MainForm = null;
  18. ValueChangedEvent m_ValueChangedEvent = null;//单元格内容改变事件
  19. public STDRuleslist(Form_Main mainForm)
  20. {
  21. InitializeComponent();
  22. m_MainForm = mainForm;
  23. m_ValueChangedEvent = new ValueChangedEvent(this);
  24. }
  25. System.Collections.Hashtable table_STDRuleslist;
  26. private void STDRuleslist_Load(object sender, EventArgs e)
  27. {
  28. m_MainForm.lan = new Language(this);
  29. table_STDRuleslist = m_MainForm.lan.GetNameTable("Attributes");
  30. Grid_Minerals.Redim(m_MainForm._sTDEditor.STDDictionary.Count + 1, 2);
  31. SourceGrid.Cells.ColumnHeader head1 = null;
  32. if (m_MainForm.lan.GetNameTable("Form_Main")["language"].ToString() == "EN")
  33. {
  34. head1 = new SourceGrid.Cells.ColumnHeader("Rule Name");
  35. }
  36. else
  37. {
  38. head1 = new SourceGrid.Cells.ColumnHeader("规则名称");
  39. }
  40. Grid_Minerals[0, 0] = head1;
  41. SourceGrid.Cells.ColumnHeader head2 = null;
  42. if (m_MainForm.lan.GetNameTable("Form_Main")["language"].ToString() == "EN")
  43. {
  44. head2 = new SourceGrid.Cells.ColumnHeader("Color");
  45. }
  46. else
  47. {
  48. head2 = new SourceGrid.Cells.ColumnHeader("颜色");
  49. }
  50. Grid_Minerals[0, 1] = head2;
  51. SourceGrid.Cells.Views.ColumnHeader boldHeader = new SourceGrid.Cells.Views.ColumnHeader();
  52. boldHeader.Font = new Font("Microsoft YaHei UI", 11, FontStyle.Bold);
  53. boldHeader.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
  54. Grid_Minerals[0, 0].View = boldHeader;
  55. Grid_Minerals[0, 1].View = boldHeader;
  56. Grid_Minerals.Rows.SetHeight(0, 25);
  57. head1.AutomaticSortEnabled = false;
  58. head2.AutomaticSortEnabled = false;
  59. Grid_Minerals.Selection.EnableMultiSelection = false;
  60. Grid_Minerals.AutoStretchColumnsToFitWidth = true;
  61. Grid_Minerals.Columns[0].Width = this.Width/2-10;
  62. Grid_Minerals.Columns[1].Width = this.Width/2-20;
  63. int i = 1;
  64. foreach (KeyValuePair<int, STDdata> kv in m_MainForm._sTDEditor.STDDictionary)
  65. {
  66. Grid_Minerals[i, 0] = new SourceGrid.Cells.Cell(kv.Value.StrName, typeof(string));
  67. Grid_Minerals.Rows[i].Height = 25;
  68. Grid_Minerals[i, 0].Tag = kv.Key;
  69. Grid_Minerals[i, 1] = new SourceGrid.Cells.Cell();
  70. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  71. view.BackColor = colorHx16toRGB(kv.Value.Color);
  72. Grid_Minerals[i, 1].View = view;
  73. i++;
  74. }
  75. Grid_Minerals.Controller.AddController(m_ValueChangedEvent);
  76. Grid_Minerals.FixedRows = 1;// 第一行是列标题不可以滚动
  77. Grid_Minerals.Selection.FocusStyle = FocusStyle.None;
  78. button_UpOrder.Enabled = false;
  79. button_DownOrder.Enabled = false;
  80. }
  81. /// <summary>
  82. /// [颜色:16进制转成RGB]
  83. /// </summary>
  84. /// <param name="strColor">设置16进制颜色 [返回RGB]</param>
  85. /// <returns></returns>
  86. public static System.Drawing.Color colorHx16toRGB(string strHxColor)
  87. {
  88. try
  89. {
  90. if (strHxColor.Length == 0)
  91. {//如果为空
  92. return System.Drawing.Color.FromArgb(255, 255, 204);//设为白色
  93. }
  94. else
  95. {//转换颜色
  96. return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
  97. }
  98. }
  99. catch
  100. {//设为白色
  101. return System.Drawing.Color.FromArgb(255, 255, 204);
  102. }
  103. }
  104. private void MineralsGrid_Click(object sender, EventArgs e)
  105. {
  106. }
  107. /// <summary>
  108. /// 新建
  109. /// </summary>
  110. /// <param name="sender"></param>
  111. /// <param name="e"></param>
  112. private void ToolStripMenuItem_New_Click(object sender, EventArgs e)
  113. {
  114. int i = Grid_Minerals.Selection.ActivePosition.Row;
  115. int j = Grid_Minerals.Selection.ActivePosition.Column;
  116. /// 保证鼠标点击的GRID行和列是有效的
  117. if (i >= 0 && j >= 0)
  118. {
  119. ////规则名称不为空
  120. //if (Grid_Minerals[i, j].Value.ToString().Replace(" ", "").Trim() != "")
  121. //{
  122. // if (m_MainForm.CheckAttributes())
  123. // {
  124. // if (m_MainForm.Checktextbox_STDEditor())
  125. // {
  126. m_MainForm.SaveDataOfSelRule(i, j);
  127. int STDId = m_MainForm._sTDEditor.AddSTDDictionaryItem();
  128. AddNewRow(STDId, "NewRuleName", Attributes.colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[STDId].Color));
  129. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  130. // }
  131. // }
  132. //}
  133. }
  134. else
  135. {
  136. int STDId = m_MainForm._sTDEditor.AddSTDDictionaryItem();
  137. AddNewRow(STDId, "NewRuleName", Attributes.colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[STDId].Color));
  138. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  139. }
  140. //SetOrderButtonsStatus();
  141. }
  142. public void AddNewRow(int STDId, string RuleName, Color color)
  143. {
  144. Grid_Minerals.Rows.Insert(Grid_Minerals.Rows.Count);
  145. Grid_Minerals[Grid_Minerals.Rows.Count - 1, 0] = new SourceGrid.Cells.Cell(RuleName, typeof(string));
  146. Grid_Minerals[Grid_Minerals.Rows.Count - 1, 0].Tag = STDId;
  147. Grid_Minerals.Rows[Grid_Minerals.Rows.Count - 1].Height = 25;
  148. Grid_Minerals[Grid_Minerals.Rows.Count - 1, 1] = new SourceGrid.Cells.Cell();
  149. //Grid_Minerals[Grid_Minerals.Rows.Count - 1, 1].AddController(SourceGrid.Cells.Controllers.Unselectable.Default);
  150. m_MainForm._sTDEditor.STDDictionary[STDId].StrName = RuleName;
  151. m_MainForm.ChangeSTDEditorAndGrid_Attributes(STDId);
  152. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  153. view.BackColor = color;
  154. Grid_Minerals[Grid_Minerals.Rows.Count - 1, 1].View = view;
  155. Position pos = new Position(Grid_Minerals.Rows.Count - 1, 0);
  156. Grid_Minerals.Selection.Focus(pos, true);
  157. PreRow = Grid_Minerals.Rows.Count - 1;
  158. SetOrderButtonsStatus();
  159. }
  160. void Grid_MineralsDelRow()
  161. {
  162. int x = Grid_Minerals.Selection.ActivePosition.Row;
  163. if (x > 0)
  164. {
  165. m_MainForm.RemoveSTDDictionaryItem((int)Grid_Minerals[x, 0].Tag);
  166. Grid_Minerals.Rows.Remove(x);
  167. if (Grid_Minerals.RowsCount > 1)
  168. {
  169. if (x != Grid_Minerals.RowsCount)
  170. {
  171. Position pos = new Position(x, 0);
  172. Grid_Minerals.Selection.Focus(pos, true);
  173. Grid_Minerals[x, 0].Grid.Select();
  174. m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[x, 0].Tag.ToString()));
  175. PreRow = x;
  176. }
  177. else
  178. {
  179. Position pos = new Position(x - 1, 0);
  180. Grid_Minerals.Selection.Focus(pos, true);
  181. Grid_Minerals[x - 1, 0].Grid.Select();
  182. m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[x - 1, 0].Tag.ToString()));
  183. PreRow = x - 1;
  184. }
  185. }
  186. else
  187. {
  188. m_MainForm.SetNull();
  189. PreRow = -1;
  190. }
  191. }
  192. else
  193. {
  194. MessageBox.Show("There is no rule to delete!", "Tip");
  195. }
  196. SetOrderButtonsStatus();
  197. }
  198. private void ToolStripMenuItem_Del_Click(object sender, EventArgs e)
  199. {
  200. Grid_MineralsDelRow();
  201. }
  202. public class ValueChangedEvent : SourceGrid.Cells.Controllers.ControllerBase
  203. {
  204. protected STDRuleslist m_parentWnd = null;
  205. public ValueChangedEvent(STDRuleslist parentWnd)
  206. {
  207. m_parentWnd = parentWnd;
  208. }
  209. public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
  210. {
  211. base.OnValueChanged(sender, e);
  212. if (sender.Value != null&& sender.Value.ToString().Replace(" ", "").Trim() != "")
  213. {
  214. m_parentWnd.ChangeStrName(sender.Position.Row, sender.Value.ToString());
  215. }
  216. else
  217. {
  218. m_parentWnd.ChangeStrName(sender.Position.Row, "NewRuleName");
  219. m_parentWnd.Grid_Minerals[sender.Position.Row,0].Value = "NewRuleName";
  220. }
  221. }
  222. }
  223. public void ChangeStrName(int RowNum, string NewStrName)
  224. {
  225. m_MainForm.ChangeStrName(RowNum, NewStrName);
  226. }
  227. private void Grid_Minerals_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
  228. {
  229. SourceGrid.Grid ls_gd = (SourceGrid.Grid)sender;
  230. ls_gd.Focus();
  231. int i = ls_gd.Selection.ActivePosition.Row;
  232. int j = ls_gd.Selection.ActivePosition.Column;
  233. if(i==-1)
  234. {
  235. return;
  236. }
  237. if (e.KeyCode == Keys.Up)
  238. {
  239. /// 保证鼠标点击的GRID行和列是有效的
  240. if (i >= 2 && j >= 0)
  241. {
  242. //规则名称不为空
  243. if (Grid_Minerals[i, 0].Value.ToString().Replace(" ", "").Trim() != "")
  244. {
  245. m_MainForm.SaveDataOfSelRule(i, 0);
  246. m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[i - 1, 0].Tag.ToString()));
  247. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  248. PreRow = i;
  249. if (i == 2)
  250. {
  251. button_UpOrder.Enabled = false;
  252. }
  253. if (i == ls_gd.RowsCount - 1)
  254. {
  255. button_DownOrder.Enabled = true;
  256. }
  257. }
  258. else
  259. {
  260. Position pos = new Position(i + 1, 0);
  261. Grid_Minerals.Selection.Focus(pos, true);
  262. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  263. }
  264. }
  265. }
  266. if (e.KeyCode == Keys.Down)
  267. {
  268. if (i < ls_gd.RowsCount - 1 && j >= 0)
  269. {
  270. //规则名称不为空
  271. if (Grid_Minerals[i, 0].Value.ToString().Replace(" ", "").Trim() != "")
  272. {
  273. m_MainForm.SaveDataOfSelRule(i, 0);
  274. m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[i + 1, 0].Tag.ToString()));
  275. PreRow = i;
  276. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  277. if (i == 1)
  278. {
  279. button_UpOrder.Enabled = true;
  280. }
  281. if (i == ls_gd.RowsCount - 2)
  282. {
  283. button_DownOrder.Enabled = false;
  284. }
  285. }
  286. else
  287. {
  288. Position pos = new Position(i - 1, 0);
  289. Grid_Minerals.Selection.Focus(pos, true);
  290. m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
  291. }
  292. }
  293. }
  294. if (e.KeyCode == Keys.Delete)
  295. {
  296. Grid_MineralsDelRow();
  297. }
  298. }
  299. public int ChangeSTDRulesLISTBackColor()
  300. {
  301. if (Grid_Minerals.RowsCount > 1)
  302. {
  303. Position pos = new Position(1, 0);
  304. Grid_Minerals[1, 0].Grid.Select();
  305. Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 1].View.BackColor = m_MainForm.m_Attributes.Grid_Attributes[3, 1].View.BackColor;
  306. m_MainForm._sTDEditor.STDDictionary[(int)Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 0].Tag].Color= Attributes.colorRGBtoHx16(m_MainForm.m_Attributes.Grid_Attributes[3, 1].View.BackColor.R, m_MainForm.m_Attributes.Grid_Attributes[3, 1].View.BackColor.G, m_MainForm.m_Attributes.Grid_Attributes[3, 1].View.BackColor.B);
  307. Grid_Minerals.Refresh();
  308. return (int)Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 0].Tag;
  309. }
  310. else
  311. {
  312. return -1;
  313. }
  314. }
  315. private void MenuStrip_STDRulelist_Resize(object sender, EventArgs e)
  316. {
  317. }
  318. private void button_UpOrder_Click(object sender, EventArgs e)
  319. {
  320. Grid_Minerals.Focus(true);
  321. int selrow = Grid_Minerals.Selection.ActivePosition.Row;
  322. int id = (int)Grid_Minerals[selrow, 0].Tag;
  323. int id2 = (int)Grid_Minerals[selrow - 1, 0].Tag;
  324. string sname = Grid_Minerals[selrow, 0].Value.ToString();
  325. Grid_Minerals[selrow, 0].Value = Grid_Minerals[selrow - 1, 0].Value;
  326. Grid_Minerals[selrow, 0].Tag = id2;
  327. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  328. view.BackColor = colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[id2].Color);
  329. Grid_Minerals[selrow, 1].View = view;
  330. Grid_Minerals[selrow - 1, 0].Value = sname;
  331. Grid_Minerals[selrow - 1, 0].Tag = id;
  332. SourceGrid.Cells.Views.Cell view2 = new SourceGrid.Cells.Views.Cell();
  333. view2.BackColor = colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[id].Color);
  334. Grid_Minerals[selrow - 1, 1].View = view2;
  335. m_MainForm._sTDEditor.STDDictionary[id].StrName = Grid_Minerals[selrow - 1, 0].Value.ToString();
  336. m_MainForm._sTDEditor.STDDictionary[id2].StrName = Grid_Minerals[selrow, 0].Value.ToString();
  337. Position pos = new Position(selrow - 1, 1);
  338. Grid_Minerals[selrow - 1, 0].Grid.Select();
  339. Grid_Minerals.Selection.Focus(pos, true);
  340. PreRow = selrow - 1;
  341. button_DownOrder.Enabled = true;
  342. if (selrow - 1 == 1)
  343. {
  344. button_UpOrder.Enabled = false;
  345. }
  346. m_MainForm.IsModified = true;
  347. Grid_Minerals.Refresh();
  348. //m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[selrow-1, 0].Tag.ToString()));
  349. }
  350. private void button_DownOrder_Click(object sender, EventArgs e)
  351. {
  352. Grid_Minerals.Focus(true);
  353. int selrow = Grid_Minerals.Selection.ActivePosition.Row;
  354. int id = (int)Grid_Minerals[selrow, 0].Tag;
  355. int id2 = (int)Grid_Minerals[selrow + 1, 0].Tag;
  356. string sname = Grid_Minerals[selrow, 0].Value.ToString();
  357. Grid_Minerals[selrow, 0].Value = Grid_Minerals[selrow + 1, 0].Value;
  358. Grid_Minerals[selrow, 0].Tag = id2;
  359. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  360. view.BackColor = colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[id2].Color);
  361. Grid_Minerals[selrow, 1].View = view;
  362. Grid_Minerals[selrow + 1, 0].Value = sname;
  363. Grid_Minerals[selrow + 1, 0].Tag = id;
  364. SourceGrid.Cells.Views.Cell view2 = new SourceGrid.Cells.Views.Cell();
  365. view2.BackColor = colorHx16toRGB(m_MainForm._sTDEditor.STDDictionary[id].Color);
  366. Grid_Minerals[selrow + 1, 1].View = view2;
  367. m_MainForm._sTDEditor.STDDictionary[id].StrName = Grid_Minerals[selrow + 1, 0].Value.ToString();
  368. m_MainForm._sTDEditor.STDDictionary[id2].StrName = Grid_Minerals[selrow, 0].Value.ToString();
  369. Position pos = new Position(selrow + 1, 0);
  370. Grid_Minerals[selrow + 1, 0].Grid.Select();
  371. Grid_Minerals.Selection.Focus(pos, true);
  372. PreRow = selrow + 1;
  373. button_UpOrder.Enabled = true;
  374. if (selrow + 1 == Grid_Minerals.RowsCount - 1)
  375. {
  376. button_DownOrder.Enabled = false;
  377. }
  378. #region 添加修改stdid顺序 ,由于需求改变只完成一部分(差相应修改能谱部分)
  379. //DialogResult result=MessageBox.Show("检测到顺序已修改,是否调整STDId?", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
  380. //if (result == DialogResult.Yes)
  381. //{
  382. // ChangeSTDidFromNum changeSTDidFromNum = new ChangeSTDidFromNum();
  383. // DialogResult res=changeSTDidFromNum.ShowDialog();
  384. // {
  385. // if (res == DialogResult.OK)
  386. // {
  387. // int StartId = int.Parse(changeSTDidFromNum.textBox_NewFirstSTDId.Text);
  388. // Dictionary<int, STDdata> STDDictionaryCopy = new Dictionary<int, STDdata>();
  389. // for (int i = 0; i < Grid_Minerals.RowsCount-1; i++)
  390. // {
  391. // STDdata dataCopy = m_MainForm._sTDEditor.STDDictionary[(int)Grid_Minerals[i+1, 0].Tag];
  392. // STDDictionaryCopy.Add(StartId + i, dataCopy);
  393. // }
  394. // m_MainForm._sTDEditor.STDDictionary.Clear();
  395. // m_MainForm._sTDEditor.STDDictionary = STDDictionaryCopy;
  396. // }
  397. // }
  398. //}
  399. #endregion
  400. m_MainForm.IsModified = true;
  401. Grid_Minerals.Refresh();
  402. }
  403. public void InsertNewRow(int STDId, string RuleName, Color color)
  404. {
  405. Grid_Minerals.Focus(true);
  406. Grid_Minerals.Rows.InsertRange(Grid_Minerals.Selection.ActivePosition.Row, 1);
  407. //Grid_Minerals.Rows.Insert(Grid_Minerals.Rows.Count);
  408. int i = Grid_Minerals.Selection.ActivePosition.Row;
  409. Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 0] = new SourceGrid.Cells.Cell(RuleName, typeof(string));
  410. Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 0].Tag = STDId;
  411. Grid_Minerals.Rows[Grid_Minerals.Selection.ActivePosition.Row].Height = 25;
  412. Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 1] = new SourceGrid.Cells.Cell();
  413. m_MainForm.ChangeSTDEditorAndGrid_Attributes(STDId);
  414. Grid_Minerals.Focus(true);
  415. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  416. view.BackColor = color;
  417. Grid_Minerals[Grid_Minerals.Selection.ActivePosition.Row, 1].View = view;
  418. Position pos = new Position(Grid_Minerals.Selection.ActivePosition.Row, 0);
  419. Grid_Minerals.Selection.Focus(pos, true);
  420. PreRow = Grid_Minerals.Selection.ActivePosition.Row - 1;
  421. SetOrderButtonsStatus();
  422. }
  423. private void Grid_Minerals_VScrollPositionChanged(object sender, ScrollPositionChangedEventArgs e)
  424. {
  425. //Grid_Minerals.Refresh();
  426. }
  427. void SetOrderButtonsStatus()
  428. {
  429. Grid_Minerals.Focus();
  430. int i = Grid_Minerals.Selection.ActivePosition.Row;
  431. int j = Grid_Minerals.Selection.ActivePosition.Column;
  432. if (i != -1)
  433. {
  434. if (i == 1)
  435. {
  436. button_UpOrder.Enabled = false;
  437. }
  438. else
  439. {
  440. button_UpOrder.Enabled = true;
  441. }
  442. if (i == Grid_Minerals.RowsCount - 1)
  443. {
  444. button_DownOrder.Enabled = false;
  445. }
  446. else
  447. {
  448. button_DownOrder.Enabled = true;
  449. }
  450. }
  451. else
  452. {
  453. button_UpOrder.Enabled = false;
  454. button_DownOrder.Enabled = false;
  455. }
  456. }
  457. private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
  458. {
  459. if (tabControl1.SelectedIndex == 0)
  460. {
  461. InitGroupEditorView();
  462. }
  463. else if (tabControl1.SelectedIndex == 1)
  464. {
  465. }
  466. }
  467. void InitGroupEditorView()
  468. {
  469. }
  470. }
  471. }