1 using Endv.Tools; 2 using System; 3 using System.Data; 4 using System.Drawing; 5 using System.IO; 6 using System.Windows.Forms; 7 8 namespace Endv 9 { 10 11 public class Form1 : System.Windows.Forms.Form 12 { 13 14 private string DBConStr = ""; 15 private string AppPath = ""; 16 private ContextMenu tvSample1Menu = new ContextMenu(); 17 private ContextMenu tvSample2Menu = new ContextMenu(); 18 private System.ComponentModel.IContainer components; 19 private System.Windows.Forms.Label label1; 20 private System.Windows.Forms.TreeView TreeView1; 21 private System.Windows.Forms.Button button1; 22 private System.Windows.Forms.Button button2; 23 private System.Windows.Forms.TreeView TreeView2; 24 private System.Windows.Forms.Label label2; 25 private System.Windows.Forms.Button button3; 26 private System.Windows.Forms.Button button4; 27 private System.Windows.Forms.Button button5; 28 private System.Windows.Forms.Button button6; 29 private DataGridView dataGridView1; 30 private System.Windows.Forms.ImageList imageList1; 31 32 33 #region Form Load 34 private void Form1_Load(object sender, System.EventArgs e) 35 { 36 37 UI.Hourglass(true);// 获取等待光标,通常是沙漏形状 38 39 40 try 41 { 42 43 AppPath = UI.GetAppPath(); 44 DBConStr = SqlHelper.connectionString; 45 //DBConStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + AppPath + "sample.mdb"; 46 //DBConStr = "Provider= Data Source=(local);Initial Catalog=oittest;User ID=sa;Password=123"; 47 48 tvSample1Menu.MenuItems.Add("Insert", 49 new EventHandler(tvSample1RightClickInsert)); 50 51 tvSample1Menu.MenuItems.Add("Edit", 52 new EventHandler(tvSample1RightClickEdit)); 53 54 tvSample1Menu.MenuItems.Add("Nudge Up", 55 new EventHandler(tvSample1RightClickNudgeUp)); 56 57 tvSample1Menu.MenuItems.Add("Nudge Down", 58 new EventHandler(tvSample1RightClickNudgeDown)); 59 60 tvSample1Menu.MenuItems.Add("Delete", 61 new EventHandler(tvSample1RightClickDelete)); 62 63 tvSample2Menu.MenuItems.Add("Insert", 64 new EventHandler(tvSample2RightClickInsert)); 65 66 tvSample2Menu.MenuItems.Add("Edit", 67 new EventHandler(tvSample2RightClickEdit)); 68 69 tvSample2Menu.MenuItems.Add("Nudge Up", 70 new EventHandler(tvSample2RightClickNudgeUp)); 71 72 tvSample2Menu.MenuItems.Add("Nudge Down", 73 new EventHandler(tvSample2RightClickNudgeDown)); 74 75 tvSample2Menu.MenuItems.Add("Delete", 76 new EventHandler(tvSample2RightClickDelete)); 77 78 LoadAllTrees(); 79 80 TreeView1.AllowDrop = true; 81 TreeView2.AllowDrop = true; 82 83 } 84 catch (Exception err) { UI.Hourglass(false); UI.ShowError(err.Message); } 85 finally { UI.Hourglass(false); } 86 } 87 #endregion 88 89 #region Load All Trees 90 private void LoadAllTrees() 91 { 92 93 try 94 { 95 LoadTree(TreeView1, Datas.emp.GetHierarchy()); 96 LoadTree(TreeView2, Datas.emp.GetHierarchy( )); 97 //Datas.emp.GetHierarchy(DBConStr, "A01") 98 } 99 catch (Exception) // 100 { throw; } 101 } 102 #endregion 103 104 #region Load Tree 105 private void LoadTree(TreeView tv, DataSet ds) 106 { 107 108 UI.Hourglass(true); 109 110 try 111 { 112 113 TreeViewUtil.LoadFromDataSet(tv, ds, "Description");//描述 114 115 if (tv.Nodes.Count > 0) 116 { 117 tv.Nodes[0].Expand(); 118 } 119 120 } 121 catch (Exception) { throw; } 122 finally 123 { 124 UI.Hourglass(false); 125 } 126 } 127 #endregion 128 129 #region TreeView1 右键删除 Right Click Delete 130 private void tvSample1RightClickDelete(object sender, System.EventArgs e) 131 { 132 133 UI.Hourglass(true); 134 135 try 136 { 137 TreeViewUtil.DeleteNode(TreeView1, true); 138 } 139 catch (Exception err) { UI.ShowError(err.Message); } 140 finally { UI.Hourglass(false); } 141 } 142 #endregion 143 144 #region TreeView2 右键删除 Right Click Delete 145 private void tvSample2RightClickDelete(object sender, System.EventArgs e) 146 { 147 148 UI.Hourglass(true); 149 150 try 151 { 152 TreeViewUtil.DeleteNode(TreeView2, true); 153 } 154 catch (Exception err) { UI.ShowError(err.Message); } 155 finally { UI.Hourglass(false); } 156 } 157 #endregion 158 159 #region tvSample1 Right Click Edit 160 private void tvSample1RightClickEdit(object sender, System.EventArgs e) 161 { 162 163 UI.Hourglass(true); 164 165 try 166 { 167 168 TreeNode node = TreeView1.SelectedNode; 169 170 if (node == null) { return; } 171 172 node.TreeView.LabelEdit = true; 173 174 node.BeginEdit(); 175 176 } 177 catch (Exception err) { UI.ShowError(err.Message); } 178 finally { UI.Hourglass(false); } 179 } 180 #endregion 181 182 #region tvSample2 Right Click Edit 183 private void tvSample2RightClickEdit(object sender, System.EventArgs e) 184 { 185 186 UI.Hourglass(true); 187 188 try 189 { 190 191 TreeNode node = TreeView2.SelectedNode; 192 193 if (node == null) { return; } 194 195 node.TreeView.LabelEdit = true; 196 197 node.BeginEdit(); 198 199 } 200 catch (Exception err) { UI.ShowError(err.Message); } 201 finally { UI.Hourglass(false); } 202 } 203 #endregion 204 205 #region tvSample1 Right Click Nudge Up 206 private void tvSample1RightClickNudgeUp(object sender, System.EventArgs e) 207 { 208 209 UI.Hourglass(true); 210 211 try 212 { 213 TreeViewUtil.NudgeUp(TreeView1.SelectedNode); 214 } 215 catch (Exception err) { UI.ShowError(err.Message); } 216 finally { UI.Hourglass(false); } 217 } 218 #endregion 219 220 #region tvSample1 Right Click Nudge Down 221 private void tvSample1RightClickNudgeDown(object sender, System.EventArgs e) 222 { 223 224 UI.Hourglass(true); 225 226 try 227 { 228 TreeViewUtil.NudgeDown(TreeView1.SelectedNode); 229 } 230 catch (Exception err) { UI.ShowError(err.Message); } 231 finally { UI.Hourglass(false); } 232 } 233 #endregion 234 235 #region tvSample2 Right Click Nudge Up 236 private void tvSample2RightClickNudgeUp(object sender, System.EventArgs e) 237 { 238 239 UI.Hourglass(true); 240 241 try 242 { 243 TreeViewUtil.NudgeUp(TreeView2.SelectedNode); 244 } 245 catch (Exception err) { UI.ShowError(err.Message); } 246 finally { UI.Hourglass(false); } 247 } 248 #endregion 249 250 #region tvSample2 Right Click Nudge Down 251 private void tvSample2RightClickNudgeDown(object sender, System.EventArgs e) 252 { 253 254 UI.Hourglass(true); 255 256 try 257 { 258 TreeViewUtil.NudgeDown(TreeView2.SelectedNode); 259 } 260 catch (Exception err) { UI.ShowError(err.Message); } 261 finally { UI.Hourglass(false); } 262 } 263 #endregion 264 265 #region tvSample1 Right Click Insert 266 private void tvSample1RightClickInsert(object sender, System.EventArgs e) 267 { 268 269 UI.Hourglass(true); 270 271 try 272 { 273 274 TreeNode node = TreeView1.SelectedNode; 275 276 if (node == null) { return; } 277 278 InsertNewNode(node); 279 280 } 281 catch (Exception err) { UI.ShowError(err.Message); } 282 finally { UI.Hourglass(false); } 283 } 284 #endregion 285 286 #region tvSample2 Right Click Insert 287 private void tvSample2RightClickInsert(object sender, System.EventArgs e) 288 { 289 290 UI.Hourglass(true); 291 292 try 293 { 294 295 TreeNode node = TreeView2.SelectedNode; 296 297 if (node == null) { return; } 298 299 InsertNewNode(node); 300 301 } 302 catch (Exception err) { UI.ShowError(err.Message); } 303 finally { UI.Hourglass(false); } 304 } 305 #endregion 306 307 #region Insert New Node 308 private void InsertNewNode(TreeNode node) 309 { 310 311 DataRow row = null; 312 DataRow ParentRow = null; 313 DataTable dt = null; 314 int newindex = 0; 315 316 try 317 { 318 319 ParentRow = (DataRow)node.Tag; 320 321 if (ParentRow == null) { return; } 322 323 newindex = int.Parse(ParentRow["SortOrder"].ToString()) + 1; 324 325 dt = ParentRow.Table; 326 327 row = dt.NewRow(); 328 329 row["ObjectID"] = Guid.NewGuid().ToString(); 330 row["ObjectTypeID"] = 1; 331 row["ModelID"] = int.Parse(ParentRow["ModelID"].ToString()); 332 row["NodeID"] = Guid.NewGuid().ToString(); 333 row["ParentNodeID"] = ParentRow[dt.PrimaryKey[0].ColumnName].ToString(); 334 row["Description"] = "New Node"; 335 row["ForeColor"] = "#000000"; 336 row["BackColor"] = "#FFFFFF"; 337 row["ImageIndex"] = 0; 338 row["SelectedImageIndex"] = 1; 339 row["Checked"] = true; 340 row["ActiveID"] = 1; 341 row["NamedRange"] = ""; 342 row["NodeValue"] = ""; 343 row["LastUpdateTime"] = DateTime.Now; 344 row["SortOrder"] = newindex; 345 346 dt.Rows.Add(row); 347 348 node.Nodes.Add(TreeViewUtil.GetTreeNodeFromDataRow(row, "Description")); 349 350 } 351 catch (Exception) 352 { 353 throw; 354 } 355 356 } 357 #endregion 358 359 #region Edit Node 360 private void EditNode(TreeNode node, string newText) 361 { 362 DataRow row = null; 363 364 try 365 { 366 367 if (node == null) { return; } 368 369 row = (DataRow)node.Tag; 370 371 if (row == null) { return; } 372 373 row["Description"] = newText; 374 375 } 376 catch (Exception) { throw; } 377 378 } 379 #endregion 380 381 #region 重载测试数据 Button Reload Test Data 382 private void button1_Click(object sender, System.EventArgs e) 383 { 384 LoadAllTrees(); 385 } 386 #endregion 387 388 #region 导出树 Button Export Trees To Xml 389 private void button2_Click(object sender, System.EventArgs e) 390 { 391 392 string filename = ""; 393 DataSet ds; 394 DataRow row; 395 DataSet compareds; 396 397 try 398 { 399 400 UI.Hourglass(true); 401 402 // Write out the contents of tvSample to disk 403 404 filename = Path.Combine(AppPath, "treeview1.xml"); 405 406 if (File.Exists(filename)) { File.Delete(filename); } 407 408 if (TreeView1.Nodes.Count == 0) { return; } 409 410 row = (DataRow)TreeView1.Nodes[0].Tag; 411 412 ds = row.Table.DataSet; 413 414 compareds = ds.GetChanges(); 415 416 if (compareds != null) 417 { 418 compareds.WriteXml(filename, XmlWriteMode.DiffGram); 419 } 420 421 // Write out the contents of tvSample2 to disk 422 423 filename = Path.Combine(AppPath, "treeview2.xml"); 424 425 if (File.Exists(filename)) { File.Delete(filename); } 426 427 if (TreeView2.Nodes.Count == 0) { return; } 428 429 row = (DataRow)TreeView2.Nodes[0].Tag; 430 431 ds = row.Table.DataSet; 432 433 compareds = ds.GetChanges(); 434 435 if (compareds != null) 436 { 437 compareds.WriteXml(filename, XmlWriteMode.DiffGram); 438 } 439 440 441 } 442 catch (Exception err) { UI.ShowError(err.Message); } 443 finally { UI.Hourglass(false); } 444 } 445 #endregion 446 447 #region tvSample Mouse Down 448 private void tvSample_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) 449 { 450 451 TreeViewUtil.SetSelectedNodeByPosition(TreeView1, e.X, e.Y); 452 453 if (TreeView1.SelectedNode == null) { return; } 454 455 if (e.Button == MouseButtons.Right) { return; } 456 457 } 458 #endregion 459 460 #region tvSample MouseUp 461 private void tvSample_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) 462 { 463 464 switch (e.Button) 465 { 466 case MouseButtons.Right: 467 468 tvSample1Menu.Show(TreeView1, new Point(e.X, e.Y)); 469 return; 470 471 default: 472 break; 473 } 474 475 } 476 #endregion 477 478 #region tvSample2 Mouse Down 479 private void tvSample2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) 480 { 481 482 TreeViewUtil.SetSelectedNodeByPosition(TreeView2, e.X, e.Y); 483 484 if (TreeView2.SelectedNode == null) { return; } 485 486 if (e.Button == MouseButtons.Right) { return; } 487 488 } 489 #endregion 490 491 #region tvSample2 MouseUp 492 private void tvSample2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) 493 { 494 495 switch (e.Button) 496 { 497 case MouseButtons.Right: 498 499 tvSample2Menu.Show(TreeView2, new Point(e.X, e.Y)); 500 break; 501 502 default: 503 break; 504 } 505 } 506 #endregion 507 508 #region tvSample Drag And Drop Events 509 private void tvSample_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) 510 { 511 DoDragDrop(e.Item, DragDropEffects.Move); 512 } 513 514 private void tvSample_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) 515 { 516 TreeViewUtil.DragEnter((TreeView)sender, e); 517 } 518 519 private void tvSample_DragOver(object sender, System.Windows.Forms.DragEventArgs e) 520 { 521 TreeViewUtil.DragOver((TreeView)sender, e); 522 } 523 524 private void tvSample_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) 525 { 526 DataRow row; 527 bool dropOnNewControl = false; 528 529 try 530 { 531 532 UI.Hourglass(true); 533 534 TreeViewUtil.DragDrop((TreeView)sender, e, ref dropOnNewControl); 535 536 if (dropOnNewControl) 537 { 538 row = (DataRow)TreeView2.Nodes[0].Tag; 539 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 540 row = (DataRow)TreeView1.Nodes[0].Tag; 541 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 542 } 543 544 // this.LoadAllTrees(); 545 546 UI.Hourglass(false); 547 } 548 catch (Exception err) { UI.ShowError(err.Message); } 549 finally { UI.Hourglass(false); } 550 } 551 #endregion 552 553 #region tvSample2 Drag And Drop Events 554 private void tvSample2_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) 555 { 556 DoDragDrop(e.Item, DragDropEffects.Move); 557 } 558 559 private void tvSample2_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) 560 { 561 TreeViewUtil.DragEnter((TreeView)sender, e); 562 } 563 564 private void tvSample2_DragOver(object sender, System.Windows.Forms.DragEventArgs e) 565 { 566 TreeViewUtil.DragOver((TreeView)sender, e); 567 } 568 569 private void tvSample2_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) 570 { 571 DataRow row; 572 bool dropOnNewControl = false; 573 574 try 575 { 576 577 UI.Hourglass(true); 578 579 TreeViewUtil.DragDrop((TreeView)sender, e, ref dropOnNewControl); 580 581 if (dropOnNewControl) 582 { 583 row = (DataRow)TreeView1.Nodes[0].Tag; 584 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 585 row = (DataRow)TreeView2.Nodes[0].Tag; 586 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 587 } 588 589 UI.Hourglass(false); 590 } 591 catch (Exception err) { UI.ShowError(err.Message); } 592 finally { UI.Hourglass(false); } 593 } 594 #endregion 595 596 #region tvSample1 After Label Edit 597 private void tvSample_AfterLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e) 598 { 599 try 600 { 601 if (e.Label.Trim().Length < 1) { e.CancelEdit = true; } 602 EditNode(TreeView1.SelectedNode, e.Label); 603 TreeView1.SelectedNode.EndEdit(false); 604 TreeView1.LabelEdit = false; 605 } 606 catch (Exception err) { UI.ShowError(err.Message); } 607 } 608 #endregion 609 610 #region tvSample2 After Label Edit 611 private void tvSample2_AfterLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e) 612 { 613 try 614 { 615 if (e.Label.Trim().Length < 1) { e.CancelEdit = true; } 616 EditNode(TreeView2.SelectedNode, e.Label); 617 TreeView2.SelectedNode.EndEdit(false); 618 TreeView2.LabelEdit = false; 619 } 620 catch (Exception err) { UI.ShowError(err.Message); } 621 } 622 #endregion 623 624 #region tvSample1 Accept Changes 625 private void button3_Click(object sender, System.EventArgs e) 626 { 627 628 DataRow row = null; 629 UI.Hourglass(true); 630 631 try 632 { 633 634 if (TreeView1.Nodes.Count == 0) { return; } 635 636 row = (DataRow)TreeView1.Nodes[0].Tag; 637 638 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 639 640 } 641 catch (Exception err) { UI.ShowError(err.Message); } 642 finally { UI.Hourglass(false); } 643 644 } 645 #endregion 646 647 #region tvSample1 拒绝更改 Reject Changes 648 private void button4_Click(object sender, System.EventArgs e) 649 { 650 651 DataRow row = null; 652 UI.Hourglass(true); 653 654 try 655 { 656 657 if (TreeView1.Nodes.Count < 1) { return; } 658 659 row = (DataRow)TreeView1.Nodes[0].Tag; 660 661 row.Table.DataSet.RejectChanges(); 662 663 LoadTree(TreeView1, row.Table.DataSet); 664 665 } 666 catch (Exception err) { UI.ShowError(err.Message); } 667 finally { UI.Hourglass(false); } 668 } 669 #endregion 670 671 #region tvSample2 接受变化 Accept Changes 672 private void button6_Click(object sender, System.EventArgs e) 673 { 674 675 DataRow row = null; 676 UI.Hourglass(true); 677 678 try 679 { 680 681 if (TreeView2.Nodes.Count == 0) { return; } 682 683 row = (DataRow)TreeView2.Nodes[0].Tag; 684 685 Datas.emp.CommitHierarchy(DBConStr, row.Table.DataSet); 686 687 } 688 catch (Exception err) { UI.ShowError(err.Message); } 689 finally { UI.Hourglass(false); } 690 } 691 #endregion 692 693 #region tvSample2 Reject Changes 694 private void button5_Click(object sender, System.EventArgs e) 695 { 696 697 DataRow row = null; 698 UI.Hourglass(true); 699 700 try 701 { 702 703 if (TreeView2.Nodes.Count < 1) { return; } 704 705 row = (DataRow)TreeView2.Nodes[0].Tag; 706 707 row.Table.DataSet.RejectChanges(); 708 709 LoadTree(TreeView2, row.Table.DataSet); 710 711 } 712 catch (Exception err) { UI.ShowError(err.Message); } 713 finally { UI.Hourglass(false); } 714 } 715 #endregion 716 717 #region Form Closed 718 private void Form1_Closed(object sender, System.EventArgs e) 719 { 720 721 } 722 #endregion 723 724 #region Exit 725 private void cmdExit_Click(object sender, System.EventArgs e) 726 { 727 this.Close(); 728 Application.Exit(); 729 } 730 #endregion 731 732 #region Constructor 733 734 [STAThread] 735 static void Main() 736 { 737 Application.Run(new Form1()); 738 } 739 740 public Form1() 741 { 742 InitializeComponent(); 743 } 744 745 protected override void Dispose(bool disposing) 746 { 747 if (disposing) 748 { 749 if (components != null) 750 { 751 components.Dispose(); 752 } 753 } 754 base.Dispose(disposing); 755 } 756 #endregion 757 758 #region Windows Form Designer generated code 759 private void InitializeComponent() 760 { 761 this.components = new System.ComponentModel.Container(); 762 this.label1 = new System.Windows.Forms.Label(); 763 this.TreeView1 = new System.Windows.Forms.TreeView(); 764 this.imageList1 = new System.Windows.Forms.ImageList(this.components); 765 this.button1 = new System.Windows.Forms.Button(); 766 this.button2 = new System.Windows.Forms.Button(); 767 this.TreeView2 = new System.Windows.Forms.TreeView(); 768 this.label2 = new System.Windows.Forms.Label(); 769 this.button3 = new System.Windows.Forms.Button(); 770 this.button4 = new System.Windows.Forms.Button(); 771 this.button5 = new System.Windows.Forms.Button(); 772 this.button6 = new System.Windows.Forms.Button(); 773 this.dataGridView1 = new System.Windows.Forms.DataGridView(); 774 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); 775 this.SuspendLayout(); 776 // 777 // label1 778 // 779 this.label1.Location = new System.Drawing.Point(10, 9); 780 this.label1.Name = "label1"; 781 this.label1.Size = new System.Drawing.Size(307, 17); 782 this.label1.TabIndex = 4; 783 this.label1.Text = "Tree 1"; 784 // 785 // TreeView1 786 // 787 this.TreeView1.AllowDrop = true; 788 this.TreeView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 789 this.TreeView1.HideSelection = false; 790 this.TreeView1.ImageIndex = 0; 791 this.TreeView1.ImageList = this.imageList1; 792 this.TreeView1.Location = new System.Drawing.Point(10, 34); 793 this.TreeView1.Name = "TreeView1"; 794 this.TreeView1.SelectedImageIndex = 0; 795 this.TreeView1.Size = new System.Drawing.Size(278, 286); 796 this.TreeView1.TabIndex = 17; 797 this.TreeView1.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.tvSample_AfterLabelEdit); 798 this.TreeView1.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvSample_ItemDrag); 799 this.TreeView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvSample_DragDrop); 800 this.TreeView1.DragEnter += new System.Windows.Forms.DragEventHandler(this.tvSample_DragEnter); 801 this.TreeView1.DragOver += new System.Windows.Forms.DragEventHandler(this.tvSample_DragOver); 802 this.TreeView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tvSample_MouseDown); 803 this.TreeView1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tvSample_MouseUp); 804 // 805 // imageList1 806 // 807 this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 808 this.imageList1.ImageSize = new System.Drawing.Size(16, 16); 809 this.imageList1.TransparentColor = System.Drawing.Color.Transparent; 810 // 811 // button1 812 // 813 this.button1.Location = new System.Drawing.Point(307, 361); 814 this.button1.Name = "button1"; 815 this.button1.Size = new System.Drawing.Size(124, 26); 816 this.button1.TabIndex = 19; 817 this.button1.Text = "Reload Test Data"; 818 this.button1.Click += new System.EventHandler(this.button1_Click); 819 // 820 // button2 821 // 822 this.button2.Location = new System.Drawing.Point(441, 361); 823 this.button2.Name = "button2"; 824 this.button2.Size = new System.Drawing.Size(182, 26); 825 this.button2.TabIndex = 20; 826 this.button2.Text = "Save Xml To Root Folder"; 827 this.button2.Click += new System.EventHandler(this.button2_Click); 828 // 829 // TreeView2 830 // 831 this.TreeView2.AllowDrop = true; 832 this.TreeView2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 833 this.TreeView2.ImageIndex = 0; 834 this.TreeView2.ImageList = this.imageList1; 835 this.TreeView2.Location = new System.Drawing.Point(305, 34); 836 this.TreeView2.Name = "TreeView2"; 837 this.TreeView2.SelectedImageIndex = 0; 838 this.TreeView2.Size = new System.Drawing.Size(315, 286); 839 this.TreeView2.TabIndex = 21; 840 this.TreeView2.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.tvSample2_AfterLabelEdit); 841 this.TreeView2.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvSample2_ItemDrag); 842 this.TreeView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvSample2_DragDrop); 843 this.TreeView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.tvSample2_DragEnter); 844 this.TreeView2.DragOver += new System.Windows.Forms.DragEventHandler(this.tvSample2_DragOver); 845 this.TreeView2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tvSample2_MouseDown); 846 this.TreeView2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tvSample2_MouseUp); 847 // 848 // label2 849 // 850 this.label2.Location = new System.Drawing.Point(394, 9); 851 this.label2.Name = "label2"; 852 this.label2.Size = new System.Drawing.Size(307, 17); 853 this.label2.TabIndex = 22; 854 this.label2.Text = "Tree 2"; 855 // 856 // button3 857 // 858 this.button3.Location = new System.Drawing.Point(12, 326); 859 this.button3.Name = "button3"; 860 this.button3.Size = new System.Drawing.Size(134, 26); 861 this.button3.TabIndex = 23; 862 this.button3.Text = "Accept Changes"; 863 this.button3.Click += new System.EventHandler(this.button3_Click); 864 // 865 // button4 866 // 867 this.button4.Location = new System.Drawing.Point(156, 326); 868 this.button4.Name = "button4"; 869 this.button4.Size = new System.Drawing.Size(134, 26); 870 this.button4.TabIndex = 24; 871 this.button4.Text = "Reject Changes"; 872 this.button4.Click += new System.EventHandler(this.button4_Click); 873 // 874 // button5 875 // 876 this.button5.Location = new System.Drawing.Point(435, 326); 877 this.button5.Name = "button5"; 878 this.button5.Size = new System.Drawing.Size(115, 26); 879 this.button5.TabIndex = 26; 880 this.button5.Text = "Reject Changes"; 881 this.button5.Click += new System.EventHandler(this.button5_Click); 882 // 883 // button6 884 // 885 this.button6.Location = new System.Drawing.Point(307, 326); 886 this.button6.Name = "button6"; 887 this.button6.Size = new System.Drawing.Size(115, 26); 888 this.button6.TabIndex = 25; 889 this.button6.Text = "Accept Changes"; 890 this.button6.Click += new System.EventHandler(this.button6_Click); 891 // 892 // dataGridView1 893 // 894 this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 895 this.dataGridView1.Location = new System.Drawing.Point(171, 234); 896 this.dataGridView1.Name = "dataGridView1"; 897 this.dataGridView1.RowTemplate.Height = 23; 898 this.dataGridView1.Size = new System.Drawing.Size(240, 150); 899 this.dataGridView1.TabIndex = 27; 900 // 901 // Form1 902 // 903 this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); 904 this.ClientSize = new System.Drawing.Size(642, 396); 905 this.Controls.Add(this.dataGridView1); 906 this.Controls.Add(this.button5); 907 this.Controls.Add(this.button6); 908 this.Controls.Add(this.button4); 909 this.Controls.Add(this.button3); 910 this.Controls.Add(this.label2); 911 this.Controls.Add(this.TreeView2); 912 this.Controls.Add(this.button2); 913 this.Controls.Add(this.button1); 914 this.Controls.Add(this.TreeView1); 915 this.Controls.Add(this.label1); 916 this.MaximizeBox = false; 917 this.Name = "Form1"; 918 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 919 this.Text = "Tree Sample"; 920 this.Closed += new System.EventHandler(this.Form1_Closed); 921 this.Load += new System.EventHandler(this.Form1_Load); 922 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); 923 this.ResumeLayout(false); 924 925 } 926 #endregion 927 928 929 } 930 }