admin 管理员组

文章数量: 887021


2024年1月14日发(作者:学习编程从那入门)

1 private void Form1_Load(object sender, rgs e); 2

3 { 4

5 // Sorts by key. 6

7 List sl = new List(); 8

9 ("0", "Zero");10

11 ("1", "One");12

13 ("2", "Two");14

15 ("3", "Three");16

17

18

19 // Keeps Add order.20

21 ctionary ld = new ctionary();22

23 (0, "Zero");24

25 (1, "One");26

27 (2, "Two");28

29 (3, "Three");30

31

32

33 // Arbitrary order.34

35 ble ht = new ble();36

37 (0, "Zero");38

39 (1, "One");40

41 (2, "Two");42

43 (3, "Three");44

45

46

47 _[1].DataMap = sl;48

49 _[1].Caption = "SortedList";50

51 _[2].DataMap = ld;52

53 _[2].Caption = "ListDictionary";54

55 _[3].DataMap = ht;56

57 _[3].Caption = "HashTable";58

59 }

1 // add these using statements at the top of the form 2

3 using System; 4

5 using c; 6

7 using entModel; 8

9 using ;10

11 using g;12

13 using ;14

15 using ;16

17 using ;18

19 using .C1FlexGrid;20

21

22

23 private void Form1_Load(object sender, EventArgs e)24

25 {26

27

28

29 // Initialize grid layout.30

31 _ = 0;32

33 _ = 1;34

35 _ = 1;36

37 _LastCol = true;38

39 _ign = nter;40

41 _ = ;42

43

44

45 // Initialize outline tree.46

47 _ = 0;48

49 _ = Leaf;50

51 _lor = ue;52

53

54

55 // Populate the grid.56

57 AddDirectory(@"c:", 0);58

59 }

1 // add subtotals to each node at a given level 2

3 void AddSubtotals(int level, string colName) 4

5 { 6

7 // get column we are going to total on 8

9 int colIndex = _f(colName);10

11

12

13 // scan rows looking for nodes at the right level14

15 for (int r = _; r < _; r++)16

17 {18

19 if (_[r].IsNode)20

21 {22

23 var node = _[r].Node;24

25 if ( == level)26

27 {28

29 // found a node, calculate the sum of extended price30

31 var range = lRange();32

33 var sum = _ate(,34

35 range.r1, colIndex, range.r2, colIndex,36

37 eNodes);38

39

40

41 // show the sum on the grid42

43 // (will use the column format automatically)44

45 _flex[r, colIndex] = sum;46

47 }48

49 }50

51 }52

53 }


本文标签: 编程 学习 作者 入门