summaryrefslogtreecommitdiff
path: root/Library/Artifacts/3c/3cba4ab95bc44741bfdec1aca1dc8380
blob: 4a2dae10e292ead69bc7030d36dbb6169f6bd60d (plain)
ofshex dumpascii
0000 00 00 0f 81 00 00 b9 80 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ....................2019.3.6f1..
0020 ff ff ff 01 02 00 00 00 0b 04 00 00 00 ff ff 66 9a 86 21 eb 14 35 98 39 dd 34 1d 51 0e c1 f3 42 ...............f..!..5.9.4.Q...B
0040 00 00 00 ed 00 00 00 02 00 00 00 00 00 00 00 37 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 ...............7................
0060 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 ................................
0080 00 00 00 00 00 00 00 01 00 01 00 0d 00 00 00 45 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 ...............E................
00a0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 ...............#................
00c0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 ...............,................
00e0 00 00 00 00 00 00 00 01 00 01 00 35 00 00 00 61 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 ...........5...a................
0100 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 ...............#................
0120 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 ...............,................
0140 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 ...............r................
0160 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 ...............#................
0180 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 ...............,................
01a0 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 ...........H....................
01c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 ...........1...1............@...
01e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 ................................
0200 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 ...........Q...j................
0220 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 4a 00 00 00 ff ff ff ff 0f 00 00 00 00 c0 00 00 00 ...............J................
0240 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 10 00 00 00 00 80 00 00 00 ...........1...1................
0260 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 11 00 00 00 00 00 00 00 00 ................................
0280 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 12 00 00 00 00 80 00 00 00 ...............j................
02a0 00 00 00 00 00 00 00 01 00 04 00 5c 00 00 00 9b 00 00 80 ff ff ff ff 13 00 00 00 00 80 00 00 00 ...........\....................
02c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 72 00 00 00 ff ff ff ff 14 00 00 00 00 80 00 00 00 ...........H...r................
02e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 15 00 00 00 01 40 00 00 00 ...........1...1............@...
0300 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 16 00 00 00 01 00 00 00 00 ................................
0320 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 17 00 00 00 01 00 00 00 00 ...........Q...j................
0340 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 77 00 00 00 ff ff ff ff 18 00 00 00 00 80 00 00 00 ...........H...w................
0360 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 19 00 00 00 01 40 00 00 00 ...........1...1............@...
0380 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1a 00 00 00 01 00 00 00 00 ................................
03a0 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1b 00 00 00 01 00 00 00 00 ...........Q...j................
03c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 80 00 00 00 ff ff ff ff 1c 00 00 00 00 80 00 00 00 ...........H....................
03e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 1d 00 00 00 01 40 00 00 00 ...........1...1............@...
0400 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1e 00 00 00 01 00 00 00 00 ................................
0420 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1f 00 00 00 01 00 00 00 00 ...........Q...j................
0440 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 20 00 00 00 00 00 00 00 00 ...........y....................
0460 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 21 00 00 00 01 00 80 00 00 ...............#.......!........
0480 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 22 00 00 00 01 00 80 00 00 ...............,......."........
04a0 00 00 00 00 00 00 00 01 00 01 00 11 03 00 80 85 00 00 00 ff ff ff ff 23 00 00 00 01 40 08 00 00 .......................#....@...
04c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 24 00 00 00 01 00 08 00 00 ...........1...1.......$........
04e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 25 00 00 00 01 00 08 00 00 .......................%........
0500 00 00 00 00 00 00 00 01 00 03 00 2e 03 00 80 6a 00 00 80 08 00 00 00 26 00 00 00 01 00 08 00 00 ...............j.......&........
0520 00 00 00 00 00 00 00 01 00 01 00 d5 03 00 80 93 00 00 00 ff ff ff ff 27 00 00 00 00 80 00 00 00 .......................'........
0540 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 28 00 00 00 00 c0 00 00 00 ...........1...1.......(........
0560 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 29 00 00 00 00 00 00 00 00 .......................)........
0580 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 2a 00 00 00 00 80 00 00 00 ...............j.......*........
05a0 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b 00 00 80 ff ff ff ff 2b 00 00 00 00 80 00 00 00 ...........H...........+........
05c0 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 00 00 80 ff ff ff ff 2c 00 00 00 01 40 00 00 00 ...........1...1.......,....@...
05e0 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b 03 00 80 04 00 00 00 2d 00 00 00 01 00 00 00 00 .......................-........
0600 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a 00 00 80 01 00 00 00 2e 00 00 00 01 00 00 00 00 ...........Q...j................
0620 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 2f 00 00 00 00 00 00 00 00 ...........y.........../........
0640 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 30 00 00 00 01 00 80 00 00 ...............#.......0........
0660 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 31 00 00 00 01 00 80 00 00 ...............,.......1........
0680 00 00 00 00 00 00 00 01 00 01 00 20 03 00 80 a7 00 00 00 02 00 00 00 32 00 00 00 00 40 00 00 00 .......................2....@...
06a0 00 00 00 00 00 00 00 01 00 01 00 be 02 00 80 b6 00 00 00 0c 00 00 00 33 00 00 00 00 40 00 00 00 .......................3....@...
06c0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 34 00 00 00 01 00 80 00 00 ...............#.......4........
06e0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 35 00 00 00 01 00 80 00 00 ...............,.......5........
0700 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 bb 00 00 00 ff ff ff ff 36 00 00 00 01 80 00 00 00 ...........H...........6........
0720 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 37 00 00 00 01 40 00 00 00 ...........1...1.......7....@...
0740 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 38 00 00 00 01 00 00 00 00 .......................8........
0760 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 39 00 00 00 01 00 00 00 00 ...........Q...j.......9........
0780 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 c6 00 00 00 ff ff ff ff 3a 00 00 00 01 80 00 00 00 ...........H...........:........
07a0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3b 00 00 00 01 40 00 00 00 ...........1...1.......;....@...
07c0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 3c 00 00 00 01 00 00 00 00 .......................<........
07e0 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 3d 00 00 00 01 00 00 00 00 ...........Q...j.......=........
0800 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 d8 00 00 00 ff ff ff ff 3e 00 00 00 01 80 00 00 00 ...........H...........>........
0820 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3f 00 00 00 01 40 00 00 00 ...........1...1.......?....@...
0840 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 40 00 00 00 01 00 00 00 00 .......................@........
0860 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 41 00 00 00 01 00 00 00 00 ...........Q...j.......A........
0880 00 00 00 00 00 00 00 4d 6f 6e 6f 49 6d 70 6f 72 74 65 72 00 50 50 74 72 3c 45 64 69 74 6f 72 45 .......MonoImporter.PPtr<EditorE
08a0 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 50 74 72 xtension>.m_FileID.m_PathID.PPtr
08c0 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 45 78 74 65 72 6e 61 6c 4f 62 6a 65 63 <PrefabInstance>.m_ExternalObjec
08e0 74 73 00 53 6f 75 72 63 65 41 73 73 65 74 49 64 65 6e 74 69 66 69 65 72 00 74 79 70 65 00 61 73 ts.SourceAssetIdentifier.type.as
0900 73 65 6d 62 6c 79 00 6e 61 6d 65 00 6d 5f 55 73 65 64 46 69 6c 65 49 44 73 00 6d 5f 44 65 66 61 sembly.name.m_UsedFileIDs.m_Defa
0920 75 6c 74 52 65 66 65 72 65 6e 63 65 73 00 65 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 69 63 6f ultReferences.executionOrder.ico
0940 6e 00 6d 5f 55 73 65 72 44 61 74 61 00 6d 5f 41 73 73 65 74 42 75 6e 64 6c 65 4e 61 6d 65 00 6d n.m_UserData.m_AssetBundleName.m
0960 5f 41 73 73 65 74 42 75 6e 64 6c 65 56 61 72 69 61 6e 74 00 00 00 00 00 73 00 00 00 00 ff ff a3 _AssetBundleVariant.....s.......
0980 47 f1 d7 dc 8f 5a 35 36 a0 3a 21 40 69 c1 4a 2a 00 00 00 81 00 00 00 05 00 00 00 15 01 00 80 37 G....Z56.:!@i.J*...............7
09a0 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 ................................
09c0 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 45 ...............................E
09e0 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a00 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a20 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 28 00 00 00 61 ...........................(...a
0a40 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a60 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a80 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 ...............................r
0aa0 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0ac0 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0ae0 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab ...........................H....
0b00 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0b20 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0b40 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0b60 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ea ...........................H....
0b80 01 00 80 ff ff ff ff 0f 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0ba0 00 00 80 ff ff ff ff 10 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0bc0 03 00 80 04 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0be0 00 00 80 01 00 00 00 12 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 3d ...............................=
0c00 00 00 00 ff ff ff ff 13 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0c20 00 00 80 ff ff ff ff 14 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ................................
0c40 03 00 80 04 00 00 00 15 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a ...............................j
0c60 00 00 80 ff ff ff ff 16 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b ...........................H....
0c80 00 00 80 ff ff ff ff 17 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 ...........................1...1
0ca0 00 00 80 ff ff ff ff 18 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b ............@...................
0cc0 03 00 80 04 00 00 00 19 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a ...........................Q...j
0ce0 00 00 80 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a ...........................y....
0d00 03 00 80 0c 00 00 00 1b 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 16 ................................
0d20 00 00 00 04 00 00 00 1c 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 1f ................................
0d40 00 00 00 08 00 00 00 1d 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 79 02 00 80 51 ...........................y...Q
0d60 00 00 00 0c 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0d80 00 00 00 04 00 00 00 1f 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0da0 00 00 00 08 00 00 00 20 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 de 00 00 80 58 ...............................X
0dc0 00 00 00 04 00 00 00 21 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 69 .......!...................H...i
0de0 00 00 00 ff ff ff ff 22 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ......."...................1...1
0e00 00 00 80 ff ff ff ff 23 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......#....@...................
0e20 03 00 80 04 00 00 00 24 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......$...................Q...j
0e40 00 00 80 01 00 00 00 25 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 75 .......%...................H...u
0e60 00 00 00 ff ff ff ff 26 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 .......&...................1...1
0e80 00 00 80 ff ff ff ff 27 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......'....@...................
0ea0 03 00 80 04 00 00 00 28 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......(...................Q...j
0ec0 00 00 80 01 00 00 00 29 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 50 50 74 72 3c 45 64 69 74 .......)...............PPtr<Edit
0ee0 6f 72 45 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 orExtension>.m_FileID.m_PathID.P
0f00 50 74 72 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 44 65 66 61 75 6c 74 52 65 66 Ptr<PrefabInstance>.m_DefaultRef
0f20 65 72 65 6e 63 65 73 00 6d 5f 49 63 6f 6e 00 6d 5f 45 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 erences.m_Icon.m_ExecutionOrder.
0f40 6d 5f 43 6c 61 73 73 4e 61 6d 65 00 6d 5f 4e 61 6d 65 73 70 61 63 65 00 00 00 00 00 02 00 00 00 m_ClassName.m_Namespace.........
0f60 03 00 00 00 00 00 00 00 00 00 00 00 5c 00 00 00 00 00 00 00 e0 79 af 00 00 00 00 00 60 00 00 00 ............\........y......`...
0f80 20 a9 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 12 00 00 00 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 00 00 ............InputDeviceBuilder..
10a0 aa a8 00 00 75 73 69 6e 67 20 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e ....using.System;..using.System.
10c0 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 Collections.Generic;..using.Syst
10e0 65 6d 2e 54 65 78 74 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 em.Text;..using.UnityEngine.Inpu
1100 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e tSystem.LowLevel;..using.UnityEn
1120 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 55 74 69 6c 69 74 69 65 73 3b 0d 0a 0d 0a 2f gine.InputSystem.Utilities;..../
1140 2f 2f 2f 54 4f 44 4f 3a 20 61 64 64 20 61 62 69 6c 69 74 79 20 74 6f 20 61 64 64 20 74 6f 20 65 ///TODO:.add.ability.to.add.to.e
1160 78 69 73 74 69 6e 67 20 61 72 72 61 79 73 20 72 61 74 68 65 72 20 74 68 61 6e 20 63 72 65 61 74 xisting.arrays.rather.than.creat
1180 69 6e 67 20 70 65 72 2d 64 65 76 69 63 65 20 61 72 72 61 79 73 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 ing.per-device.arrays....////TOD
11a0 4f 3a 20 74 68 65 20 6e 65 78 74 20 73 74 65 70 20 68 65 72 65 20 69 73 20 74 6f 20 77 72 69 74 O:.the.next.step.here.is.to.writ
11c0 65 20 61 20 63 6f 64 65 20 67 65 6e 65 72 61 74 6f 72 20 74 68 61 74 20 67 65 6e 65 72 61 74 65 e.a.code.generator.that.generate
11e0 73 20 63 6f 64 65 20 66 6f 72 20 61 20 67 69 76 65 6e 20 6c 61 79 6f 75 74 20 74 68 61 74 20 77 s.code.for.a.given.layout.that.w
1200 68 65 6e 0d 0a 2f 2f 2f 2f 20 20 20 20 20 20 65 78 65 63 75 74 65 64 2c 20 64 6f 65 73 20 77 68 hen..////......executed,.does.wh
1220 61 74 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 64 6f 65 73 20 62 75 74 20 77 at.InputDeviceBuilder.does.but.w
1240 69 74 68 6f 75 74 20 74 68 65 20 75 73 65 20 6f 66 20 72 65 66 6c 65 63 74 69 6f 6e 20 61 6e 64 ithout.the.use.of.reflection.and
1260 20 6d 75 63 68 20 6d 6f 72 65 20 71 75 69 63 6b 6c 79 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 .much.more.quickly....////REVIEW
1280 3a 20 69 74 20 70 72 6f 62 61 62 6c 79 20 6d 61 6b 65 73 20 73 65 6e 73 65 20 74 6f 20 68 61 76 :.it.probably.makes.sense.to.hav
12a0 65 20 61 6e 20 69 6e 69 74 69 61 6c 20 70 68 61 73 65 20 77 68 65 72 65 20 77 65 20 70 72 6f 63 e.an.initial.phase.where.we.proc
12c0 65 73 73 20 74 68 65 20 69 6e 69 74 69 61 6c 20 73 65 74 20 6f 66 0d 0a 2f 2f 2f 2f 20 20 20 20 ess.the.initial.set.of..////....
12e0 20 20 20 20 64 65 76 69 63 65 20 64 69 73 63 6f 76 65 72 69 65 73 20 66 72 6f 6d 20 6e 61 74 69 ....device.discoveries.from.nati
1300 76 65 20 61 6e 64 20 6b 65 65 70 20 74 68 65 20 6c 61 79 6f 75 74 20 63 61 63 68 65 20 61 72 6f ve.and.keep.the.layout.cache.aro
1320 75 6e 64 20 69 6e 73 74 65 61 64 20 6f 66 20 74 68 72 6f 77 69 6e 67 0d 0a 2f 2f 2f 2f 20 20 20 und.instead.of.throwing..////...
1340 20 20 20 20 20 69 74 20 61 77 61 79 20 61 66 74 65 72 20 74 68 65 20 63 72 65 61 74 69 6f 6e 20 .....it.away.after.the.creation.
1360 6f 66 20 65 76 65 72 79 20 73 69 6e 67 6c 65 20 64 65 76 69 63 65 3b 20 62 65 73 74 20 61 70 70 of.every.single.device;.best.app
1380 72 6f 61 63 68 20 6d 61 79 20 62 65 20 74 6f 20 6a 75 73 74 0d 0a 2f 2f 2f 2f 20 20 20 20 20 20 roach.may.be.to.just..////......
13a0 20 20 72 65 75 73 65 20 74 68 65 20 73 61 6d 65 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c ..reuse.the.same.InputDeviceBuil
13c0 64 65 72 20 69 6e 73 74 61 6e 63 65 20 6f 76 65 72 20 61 6e 64 20 6f 76 65 72 0d 0a 0d 0a 2f 2f der.instance.over.and.over....//
13e0 2f 2f 54 4f 44 4f 3a 20 65 6e 73 75 72 65 20 74 68 61 74 20 74 68 69 6e 67 73 20 61 72 65 20 61 //TODO:.ensure.that.things.are.a
1400 6c 69 67 6e 65 64 20 70 72 6f 70 65 72 6c 79 20 66 6f 72 20 41 52 4d 3b 20 73 68 6f 75 6c 64 20 ligned.properly.for.ARM;.should.
1420 74 68 61 74 20 62 65 20 64 6f 6e 65 20 6f 6e 20 74 68 65 20 72 65 61 64 69 6e 67 20 73 69 64 65 that.be.done.on.the.reading.side
1440 20 6f 72 20 69 6e 20 74 68 65 20 73 74 61 74 65 20 6c 61 79 6f 75 74 73 3f 0d 0a 2f 2f 2f 2f 20 .or.in.the.state.layouts?..////.
1460 20 20 20 20 20 20 28 6d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 61 6c 69 67 6e 6d 65 6e 74 20 ......(make.sure.that.alignment.
1480 77 6f 72 6b 73 20 74 68 65 20 73 61 6d 65 20 6f 6e 20 2a 61 6c 6c 2a 20 70 6c 61 74 66 6f 72 6d works.the.same.on.*all*.platform
14a0 73 3b 20 6f 74 68 65 72 77 69 73 65 20 65 64 69 74 6f 72 20 77 69 6c 6c 20 6e 6f 74 20 62 65 20 s;.otherwise.editor.will.not.be.
14c0 61 62 6c 65 20 74 6f 20 70 72 6f 63 65 73 73 20 65 76 65 6e 74 73 20 66 72 6f 6d 20 70 6c 61 79 able.to.process.events.from.play
14e0 65 72 73 20 70 72 6f 70 65 72 6c 79 29 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 6e 69 74 79 ers.properly)....namespace.Unity
1500 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 61 79 6f 75 74 73 0d 0a 7b 0d 0a 20 Engine.InputSystem.Layouts..{...
1520 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 54 75 72 6e 73 20 ...///.<summary>......///.Turns.
1540 61 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 69 6e 74 6f 20 61 6e 20 61 63 74 75 61 6c 20 3c a.device.layout.into.an.actual.<
1560 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 2f 3e 20 69 6e 73 74 61 6e 63 see.cref="InputDevice"/>.instanc
1580 65 2e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 e.......///.</summary>......///.
15a0 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 55 6c 74 69 6d 61 74 65 6c 79 20 70 72 <remarks>......///.Ultimately.pr
15c0 6f 64 75 63 65 73 20 61 20 64 65 76 69 63 65 20 62 75 74 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 oduces.a.device.but.can.also.be.
15e0 75 73 65 64 20 74 6f 20 71 75 65 72 79 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 73 65 74 75 70 20 used.to.query.the.control.setup.
1600 64 65 73 63 72 69 62 65 64 0d 0a 20 20 20 20 2f 2f 2f 20 62 79 20 61 20 6c 61 79 6f 75 74 2e 0d described......///.by.a.layout..
1620 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 43 61 6e 20 62 65 20 75 73 65 64 20 62 6f .....///......///.Can.be.used.bo
1640 74 68 20 74 6f 20 63 72 65 61 74 65 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 69 65 73 th.to.create.control.hierarchies
1660 20 66 72 6f 6d 20 73 63 72 61 74 63 68 20 61 73 20 77 65 6c 6c 20 61 73 20 74 6f 20 72 65 2d 63 .from.scratch.as.well.as.to.re-c
1680 72 65 61 74 65 20 6f 72 0d 0a 20 20 20 20 2f 2f 2f 20 63 68 61 6e 67 65 20 65 78 69 73 74 69 6e reate.or......///.change.existin
16a0 67 20 68 69 65 72 61 72 63 68 69 65 73 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f g.hierarchies.......///......///
16c0 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 69 73 20 74 68 65 20 6f 6e 6c 79 20 .InputDeviceBuilder.is.the.only.
16e0 77 61 79 20 74 6f 20 63 72 65 61 74 65 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 69 65 way.to.create.control.hierarchie
1700 73 2e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 73 20 63 61 6e 6e 6f 74 20 62 65 0d 0a 20 20 20 20 s..InputControls.cannot.be......
1720 2f 2f 2f 20 3c 63 3e 6e 65 77 3c 2f 63 3e 27 64 20 64 69 72 65 63 74 6c 79 2e 0d 0a 20 20 20 20 ///.<c>new</c>'d.directly.......
1740 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 41 6c 73 6f 20 63 6f 6d 70 75 74 65 73 20 61 20 66 69 6e ///......///.Also.computes.a.fin
1760 61 6c 20 73 74 61 74 65 20 6c 61 79 6f 75 74 20 77 68 65 6e 20 73 65 74 75 70 20 69 73 20 66 69 al.state.layout.when.setup.is.fi
1780 6e 69 73 68 65 64 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 nished.......///......///.Note.t
17a0 68 61 74 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 73 20 67 65 6e 65 72 61 74 65 hat.InputDeviceBuilders.generate
17c0 20 67 61 72 62 61 67 65 2e 20 54 68 65 79 20 61 72 65 20 6d 65 61 6e 74 20 74 6f 20 62 65 20 75 .garbage..They.are.meant.to.be.u
17e0 73 65 64 20 66 6f 72 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 6f 6e 6c 79 2e 20 44 6f 6e sed.for.initialization.only..Don
1800 27 74 0d 0a 20 20 20 20 2f 2f 2f 20 75 73 65 20 74 68 65 6d 20 64 75 72 69 6e 67 20 6e 6f 72 6d 't......///.use.them.during.norm
1820 61 6c 20 67 61 6d 65 70 6c 61 79 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 52 al.gameplay.......///......///.R
1840 75 6e 6e 69 6e 67 20 61 6e 20 2a 65 78 69 73 74 69 6e 67 2a 20 64 65 76 69 63 65 20 74 68 72 6f unning.an.*existing*.device.thro
1860 75 67 68 20 61 6e 6f 74 68 65 72 20 63 6f 6e 74 72 6f 6c 20 62 75 69 6c 64 20 69 73 20 61 20 2a ugh.another.control.build.is.a.*
1880 64 65 73 74 72 75 63 74 69 76 65 2a 20 6f 70 65 72 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 2f 2f 2f destructive*.operation.......///
18a0 20 45 78 69 73 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 73 20 6d 61 79 20 62 65 20 72 65 75 73 65 64 .Existing.controls.may.be.reused
18c0 20 77 68 69 6c 65 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 69 6d 65 20 74 68 65 20 68 69 65 72 .while.at.the.same.time.the.hier
18e0 61 72 63 68 79 20 61 6e 64 20 65 76 65 6e 20 74 68 65 20 64 65 76 69 63 65 20 69 6e 73 74 61 6e archy.and.even.the.device.instan
1900 63 65 0d 0a 20 20 20 20 2f 2f 2f 20 69 74 73 65 6c 66 20 6d 61 79 20 63 68 61 6e 67 65 2e 0d 0a ce......///.itself.may.change...
1920 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 69 6e 74 65 72 6e 61 6c ....///.</remarks>......internal
1940 20 73 74 72 75 63 74 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 3a 20 49 44 69 .struct.InputDeviceBuilder.:.IDi
1960 73 70 6f 73 61 62 6c 65 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 sposable......{..........public.
1980 76 6f 69 64 20 53 65 74 75 70 28 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 6c 61 79 6f 75 74 void.Setup(InternedString.layout
19a0 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 2c 0d 0a 20 20 20 20 ,.InternedString.variants,......
19c0 20 20 20 20 20 20 20 20 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 64 ........InputDeviceDescription.d
19e0 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 eviceDescription.=.default).....
1a00 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 61 79 6f 75 74 43 61 63 68 .....{..............m_LayoutCach
1a20 65 52 65 66 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 61 63 68 65 52 eRef.=.InputControlLayout.CacheR
1a40 65 66 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 73 74 61 6e 74 69 61 74 65 ef();................Instantiate
1a60 4c 61 79 6f 75 74 28 6c 61 79 6f 75 74 2c 20 76 61 72 69 61 6e 74 73 2c 20 6e 65 77 20 49 6e 74 Layout(layout,.variants,.new.Int
1a80 65 72 6e 65 64 53 74 72 69 6e 67 28 29 2c 20 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ernedString(),.null);...........
1aa0 20 20 20 46 69 6e 61 6c 69 7a 65 43 6f 6e 74 72 6f 6c 48 69 65 72 61 72 63 68 79 28 29 3b 0d 0a ...FinalizeControlHierarchy();..
1ac0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 44 65 73 63 72 69 70 ..............m_Device.m_Descrip
1ae0 74 69 6f 6e 20 3d 20 64 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 tion.=.deviceDescription;.......
1b00 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 43 61 6c 6c 46 69 6e 69 73 68 53 65 74 75 70 52 .......m_Device.CallFinishSetupR
1b20 65 63 75 72 73 69 76 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 ecursive();..........}..........
1b40 20 20 2f 2f 20 43 6f 6d 70 6c 65 74 65 20 74 68 65 20 73 65 74 75 70 20 61 6e 64 20 72 65 74 75 ..//.Complete.the.setup.and.retu
1b60 72 6e 20 74 68 65 20 66 75 6c 6c 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 79 20 73 65 rn.the.full.control.hierarchy.se
1b80 74 75 70 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 77 69 74 68 20 69 74 73 20 64 65 76 69 63 65 20 tup..........//.with.its.device.
1ba0 72 6f 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 44 65 76 69 63 root...........public.InputDevic
1bc0 65 20 46 69 6e 69 73 68 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 e.Finish()..........{...........
1be0 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 6d 5f 44 65 76 69 63 65 3b 0d 0a 0d 0a 20 20 20 ...var.device.=.m_Device;.......
1c00 20 20 20 20 20 20 20 20 20 2f 2f 20 4b 69 6c 6c 20 6f 66 66 20 6f 75 72 20 73 74 61 74 65 2e 0d .........//.Kill.off.our.state..
1c20 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 73 65 74 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 .............Reset();...........
1c40 20 20 20 20 20 72 65 74 75 72 6e 20 64 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a .....return.device;..........}..
1c60 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 69 73 70 6f 73 65 28 29 0d ..........public.void.Dispose().
1c80 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 61 79 6f 75 74 .........{..............m_Layout
1ca0 43 61 63 68 65 52 65 66 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a CacheRef.Dispose();..........}..
1cc0 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 44 65 76 69 63 65 20 6d 5f ..........private.InputDevice.m_
1ce0 44 65 76 69 63 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 Device;............//.Make.sure.
1d00 74 68 65 20 67 6c 6f 62 61 6c 20 6c 61 79 6f 75 74 20 63 61 63 68 65 20 73 74 69 63 6b 73 20 61 the.global.layout.cache.sticks.a
1d20 72 6f 75 6e 64 20 66 6f 72 20 61 74 20 6c 65 61 73 74 20 61 73 20 6c 6f 6e 67 0d 0a 20 20 20 20 round.for.at.least.as.long......
1d40 20 20 20 20 2f 2f 20 61 73 20 74 68 65 20 64 65 76 69 63 65 20 62 75 69 6c 64 65 72 20 73 6f 20 ....//.as.the.device.builder.so.
1d60 74 68 61 74 20 77 65 20 64 6f 6e 27 74 20 6c 6f 61 64 20 6c 61 79 6f 75 74 73 20 6f 76 65 72 20 that.we.don't.load.layouts.over.
1d80 61 6e 64 20 6f 76 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 and.over...........private.Input
1da0 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 61 63 68 65 52 65 66 49 6e 73 74 61 6e 63 65 20 6d ControlLayout.CacheRefInstance.m
1dc0 5f 4c 61 79 6f 75 74 43 61 63 68 65 52 65 66 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 _LayoutCacheRef;............//.T
1de0 61 62 6c 65 20 6d 61 70 70 69 6e 67 20 28 6c 6f 77 65 72 2d 63 61 73 65 64 29 20 63 6f 6e 74 72 able.mapping.(lower-cased).contr
1e00 6f 6c 20 70 61 74 68 73 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 73 20 74 68 61 74 ol.paths.to.control.layouts.that
1e20 20 63 6f 6e 74 61 69 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 6f 76 65 72 72 69 64 65 73 20 66 .contain..........//.overrides.f
1e40 6f 72 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 or.the.control.at.the.given.path
1e60 2e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 44 69 63 74 69 6f 6e 61 72 79 3c 73 74 ...........private.Dictionary<st
1e80 72 69 6e 67 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c ring,.InputControlLayout.Control
1ea0 49 74 65 6d 3e 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 3b 0d 0a Item>.m_ChildControlOverrides;..
1ec0 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 53 74 72 69 6e 67 42 75 69 6c 64 65 72 20 ..........private.StringBuilder.
1ee0 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 52 m_StringBuilder;............//.R
1f00 65 73 65 74 20 74 68 65 20 73 65 74 75 70 20 69 6e 20 61 20 77 61 79 20 77 68 65 72 65 20 69 74 eset.the.setup.in.a.way.where.it
1f20 20 63 61 6e 20 62 65 20 72 65 75 73 65 64 20 66 6f 72 20 61 6e 6f 74 68 65 72 20 73 65 74 75 70 .can.be.reused.for.another.setup
1f40 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 68 6f 75 6c 64 20 72 65 74 61 69 6e 20 61 6c 6c 6f ...........//.Should.retain.allo
1f60 63 61 74 69 6f 6e 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 72 65 75 73 65 64 2e 0d 0a 20 20 20 cations.that.can.be.reused......
1f80 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 52 65 73 65 74 28 29 0d 0a 20 20 20 20 20 .....private.void.Reset().......
1fa0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 20 3d 20 6e 75 6c ...{..............m_Device.=.nul
1fc0 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 l;..............m_ChildControlOv
1fe0 65 72 72 69 64 65 73 3f 2e 43 6c 65 61 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f errides?.Clear();............../
2000 2f 20 4c 65 61 76 65 20 74 68 65 20 63 61 63 68 65 20 69 6e 20 70 6c 61 63 65 20 73 6f 20 77 65 /.Leave.the.cache.in.place.so.we
2020 20 63 61 6e 20 72 65 75 73 65 20 74 68 65 6d 20 69 6e 20 61 6e 6f 74 68 65 72 20 73 65 74 75 70 .can.reuse.them.in.another.setup
2040 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 .path...........}............pri
2060 76 61 74 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 49 6e 73 74 61 6e 74 69 61 74 65 4c 61 79 vate.InputControl.InstantiateLay
2080 6f 75 74 28 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 6c 61 79 6f 75 74 2c 20 49 6e 74 65 72 out(InternedString.layout,.Inter
20a0 6e 65 64 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 nedString.variants,.InternedStri
20c0 6e 67 20 6e 61 6d 65 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 29 0d 0a 20 ng.name,.InputControl.parent)...
20e0 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 6f 6f 6b 20 75 70 .......{..............//.Look.up
2100 20 6c 61 79 6f 75 74 20 62 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 .layout.by.name...............va
2120 72 20 6c 61 79 6f 75 74 49 6e 73 74 61 6e 63 65 20 3d 20 46 69 6e 64 4f 72 4c 6f 61 64 4c 61 79 r.layoutInstance.=.FindOrLoadLay
2140 6f 75 74 28 6c 61 79 6f 75 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 out(layout);................//.C
2160 72 65 61 74 65 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 20 20 20 20 20 20 reate.control.hierarchy.........
2180 20 20 20 20 20 20 72 65 74 75 72 6e 20 49 6e 73 74 61 6e 74 69 61 74 65 4c 61 79 6f 75 74 28 6c ......return.InstantiateLayout(l
21a0 61 79 6f 75 74 49 6e 73 74 61 6e 63 65 2c 20 76 61 72 69 61 6e 74 73 2c 20 6e 61 6d 65 2c 20 70 ayoutInstance,.variants,.name,.p
21c0 61 72 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 arent);..........}............pr
21e0 69 76 61 74 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 49 6e 73 74 61 6e 74 69 61 74 65 4c 61 ivate.InputControl.InstantiateLa
2200 79 6f 75 74 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 6c 61 79 6f 75 74 2c 20 yout(InputControlLayout.layout,.
2220 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 2c 20 49 6e 74 65 72 6e 65 InternedString.variants,.Interne
2240 64 53 74 72 69 6e 67 20 6e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 dString.name,..............Input
2260 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 Control.parent)..........{......
2280 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 6c 61 79 6f 75 74 2e 74 79 70 65 ........Debug.Assert(layout.type
22a0 20 21 3d 20 6e 75 6c 6c 2c 20 22 4c 61 79 6f 75 74 20 68 61 73 20 6e 6f 20 74 79 70 65 20 73 65 .!=.null,."Layout.has.no.type.se
22c0 74 20 6f 6e 20 69 74 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 2c t.on.it");................//.No,
22e0 20 73 6f 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 .so.create.a.new.control........
2300 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4f 62 6a 65 63 74 20 3d 20 41 63 74 69 76 .......var.controlObject.=.Activ
2320 61 74 6f 72 2e 43 72 65 61 74 65 49 6e 73 74 61 6e 63 65 28 6c 61 79 6f 75 74 2e 74 79 70 65 29 ator.CreateInstance(layout.type)
2340 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 63 6f 6e 74 72 6f 6c 4f 62 6a 65 ;..............if.(!(controlObje
2360 63 74 20 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 29 0d 0a 20 20 ct.is.InputControl.control))....
2380 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 ..........{..................thr
23a0 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e ow.new.InvalidOperationException
23c0 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 54 79 70 65 20 27 7b (......................$"Type.'{
23e0 6c 61 79 6f 75 74 2e 74 79 70 65 2e 4e 61 6d 65 7d 27 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 layout.type.Name}'.referenced.by
2400 20 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 7d 27 20 69 73 20 6e 6f 74 20 61 .layout.'{layout.name}'.is.not.a
2420 6e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d n.InputControl");..............}
2440 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 61 20 64 65 76 ................//.If.it's.a.dev
2460 69 63 65 2c 20 70 65 72 66 6f 72 6d 20 73 6f 6d 65 20 65 78 74 72 61 20 77 6f 72 6b 20 73 70 65 ice,.perform.some.extra.work.spe
2480 63 69 66 69 63 20 74 6f 20 74 68 65 20 63 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 cific.to.the.control............
24a0 20 20 2f 2f 20 68 69 65 72 61 72 63 68 79 20 72 6f 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ..//.hierarchy.root.............
24c0 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 69 73 20 49 6e 70 75 74 44 65 76 69 63 65 20 63 6f 6e ..if.(control.is.InputDevice.con
24e0 74 72 6f 6c 41 73 44 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 trolAsDevice)..............{....
2500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 65 6e 74 20 21 3d 20 6e 75 6c 6c ..............if.(parent.!=.null
2520 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 )......................throw.new
2540 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 .InvalidOperationException(.....
2560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 69 6e .....................$"Cannot.in
2580 73 74 61 6e 74 69 61 74 65 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 stantiate.device.layout.'{layout
25a0 2e 6e 61 6d 65 7d 27 20 61 73 20 63 68 69 6c 64 20 6f 66 20 27 7b 70 61 72 65 6e 74 2e 70 61 74 .name}'.as.child.of.'{parent.pat
25c0 68 7d 27 3b 20 64 65 76 69 63 65 73 20 6d 75 73 74 20 62 65 20 61 64 64 65 64 20 61 74 20 72 6f h}';.devices.must.be.added.at.ro
25e0 6f 74 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 ot");....................m_Devic
2600 65 20 3d 20 63 6f 6e 74 72 6f 6c 41 73 44 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 e.=.controlAsDevice;............
2620 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 ......m_Device.m_StateBlock.byte
2640 4f 66 66 73 65 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 Offset.=.0;..................m_D
2660 65 76 69 63 65 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 3d 20 30 evice.m_StateBlock.bitOffset.=.0
2680 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 53 74 ;..................m_Device.m_St
26a0 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 20 3d 20 6c 61 79 6f 75 74 2e 73 74 61 74 65 46 6f ateBlock.format.=.layout.stateFo
26c0 72 6d 61 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 rmat;....................//.If.w
26e0 65 20 68 61 76 65 20 61 6e 20 65 78 69 73 74 69 6e 67 20 64 65 76 69 63 65 2c 20 77 65 27 6c 6c e.have.an.existing.device,.we'll
2700 20 73 74 61 72 74 20 74 68 65 20 76 61 72 69 6f 75 73 20 63 6f 6e 74 72 6f 6c 20 61 72 72 61 79 .start.the.various.control.array
2720 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 66 72 6f 6d 20 73 63 72 61 74 s..................//.from.scrat
2740 63 68 2e 20 4e 6f 74 65 20 74 68 61 74 20 61 6c 6c 20 74 68 65 20 63 6f 6e 74 72 6f 6c 73 20 73 ch..Note.that.all.the.controls.s
2760 74 69 6c 6c 20 72 65 66 65 72 20 74 6f 20 74 68 65 20 65 78 69 73 74 69 6e 67 0d 0a 20 20 20 20 till.refer.to.the.existing......
2780 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 72 72 61 79 73 20 61 6e 64 20 73 6f 20 77 65 20 ............//.arrays.and.so.we.
27a0 63 61 6e 20 69 74 65 72 61 74 65 20 63 68 69 6c 64 72 65 6e 2c 20 66 6f 72 20 65 78 61 6d 70 6c can.iterate.children,.for.exampl
27c0 65 2c 20 6a 75 73 74 20 66 69 6e 65 20 77 68 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 e,.just.fine.while..............
27e0 20 20 20 20 2f 2f 20 77 65 20 61 72 65 20 72 65 62 75 69 6c 64 69 6e 67 20 74 68 65 20 63 6f 6e ....//.we.are.rebuilding.the.con
2800 74 72 6f 6c 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 trol.hierarchy..................
2820 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 41 6c 69 61 73 65 73 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f .m_Device.m_AliasesForEachContro
2840 6c 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 l.=.null;..................m_Dev
2860 69 63 65 2e 6d 5f 43 68 69 6c 64 72 65 6e 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 20 3d 20 6e ice.m_ChildrenForEachControl.=.n
2880 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d ull;..................m_Device.m
28a0 5f 55 73 61 67 65 73 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 _UsagesForEachControl.=.null;...
28c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 55 73 61 67 65 54 ...............m_Device.m_UsageT
28e0 6f 43 6f 6e 74 72 6f 6c 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 oControl.=.null;................
2900 20 20 20 20 69 66 20 28 6c 61 79 6f 75 74 2e 6d 5f 55 70 64 61 74 65 42 65 66 6f 72 65 52 65 6e ....if.(layout.m_UpdateBeforeRen
2920 64 65 72 20 3d 3d 20 74 72 75 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 der.==.true)....................
2940 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 44 65 76 69 63 65 46 6c 61 67 73 20 7c 3d 20 49 6e 70 75 ..m_Device.m_DeviceFlags.|=.Inpu
2960 74 44 65 76 69 63 65 2e 44 65 76 69 63 65 46 6c 61 67 73 2e 55 70 64 61 74 65 42 65 66 6f 72 65 tDevice.DeviceFlags.UpdateBefore
2980 52 65 6e 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 Render;..............}..........
29a0 20 20 20 20 65 6c 73 65 20 69 66 20 28 70 61 72 65 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 ....else.if.(parent.==.null)....
29c0 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ..........{..................//.
29e0 53 6f 6d 65 6f 6e 65 20 64 69 64 20 22 6e 65 77 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c Someone.did."new.InputDeviceBuil
2a00 64 65 72 28 2e 2e 2e 29 22 20 77 69 74 68 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 2e der(...)".with.a.control.layout.
2a20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 64 6f 6e 27 74 20 73 75 ..................//.We.don't.su
2a40 70 70 6f 72 74 20 63 72 65 61 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 69 pport.creating.control.hierarchi
2a60 65 73 20 77 69 74 68 6f 75 74 20 61 20 64 65 76 69 63 65 20 61 74 20 74 68 65 20 72 6f 6f 74 2e es.without.a.device.at.the.root.
2a80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 ..................throw.new.Inva
2aa0 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 lidOperationException(..........
2ac0 20 20 20 20 20 20 20 20 20 20 20 20 24 22 54 6f 70 6c 65 76 65 6c 20 6c 61 79 6f 75 74 20 75 73 ............$"Toplevel.layout.us
2ae0 65 64 20 77 69 74 68 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 6d 75 73 74 20 ed.with.InputDeviceBuilder.must.
2b00 62 65 20 61 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 3b 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d be.a.device.layout;.'{layout.nam
2b20 65 7d 27 20 69 73 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 22 29 3b 0d 0a 20 20 20 20 e}'.is.a.control.layout");......
2b40 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 61 6d 65 ........}................//.Name
2b60 20 64 65 66 61 75 6c 74 73 20 74 6f 20 6e 61 6d 65 20 6f 66 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 .defaults.to.name.of.layout.....
2b80 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 61 6d 65 2e 49 73 45 6d 70 74 79 28 29 29 0d 0a 20 ..........if.(name.IsEmpty())...
2ba0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 ...........{..................na
2bc0 6d 65 20 3d 20 6c 61 79 6f 75 74 2e 6e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 me.=.layout.name;...............
2be0 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 72 65 27 73 20 61 20 6e 61 6d 65 73 70 61 63 65 20 69 .....//.If.there's.a.namespace.i
2c00 6e 20 74 68 65 20 6c 61 79 6f 75 74 20 6e 61 6d 65 2c 20 73 6e 69 70 20 69 74 20 6f 75 74 2e 0d n.the.layout.name,.snip.it.out..
2c20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e 64 65 78 4f 66 4c 61 73 74 .................var.indexOfLast
2c40 43 6f 6c 6f 6e 20 3d 20 6e 61 6d 65 2e 54 6f 53 74 72 69 6e 67 28 29 2e 4c 61 73 74 49 6e 64 65 Colon.=.name.ToString().LastInde
2c60 78 4f 66 28 27 3a 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 xOf(':');..................if.(i
2c80 6e 64 65 78 4f 66 4c 61 73 74 43 6f 6c 6f 6e 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 ndexOfLastColon.!=.-1)..........
2ca0 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 ............name.=.new.InternedS
2cc0 74 72 69 6e 67 28 6e 61 6d 65 2e 54 6f 53 74 72 69 6e 67 28 29 2e 53 75 62 73 74 72 69 6e 67 28 tring(name.ToString().Substring(
2ce0 69 6e 64 65 78 4f 66 4c 61 73 74 43 6f 6c 6f 6e 20 2b 20 31 29 29 3b 0d 0a 20 20 20 20 20 20 20 indexOfLastColon.+.1));.........
2d00 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 56 61 72 69 61 6e 74 .....}................//.Variant
2d20 20 64 65 66 61 75 6c 74 73 20 74 6f 20 76 61 72 69 61 6e 74 73 20 6f 66 20 6c 61 79 6f 75 74 2e .defaults.to.variants.of.layout.
2d40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 72 69 61 6e 74 73 2e 49 73 45 6d 70 ..............if.(variants.IsEmp
2d60 74 79 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ty())..............{............
2d80 20 20 20 20 20 20 76 61 72 69 61 6e 74 73 20 3d 20 6c 61 79 6f 75 74 2e 76 61 72 69 61 6e 74 73 ......variants.=.layout.variants
2da0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 72 69 61 6e 74 ;....................if.(variant
2dc0 73 2e 49 73 45 6d 70 74 79 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 s.IsEmpty())....................
2de0 20 20 76 61 72 69 61 6e 74 73 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e ..variants.=.InputControlLayout.
2e00 44 65 66 61 75 6c 74 56 61 72 69 61 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a DefaultVariant;..............}..
2e20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 4e 61 6d 65 20 3d 20 6e ..............control.m_Name.=.n
2e40 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 69 73 70 ame;..............control.m_Disp
2e60 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 6c 61 79 6f 75 74 2e 6d 5f 44 69 73 layNameFromLayout.=.layout.m_Dis
2e80 70 6c 61 79 4e 61 6d 65 3b 20 2f 2f 20 4e 6f 20 73 68 6f 72 74 20 64 69 73 70 6c 61 79 20 6e 61 playName;.//.No.short.display.na
2ea0 6d 65 73 20 61 74 20 6c 61 79 6f 75 74 20 72 6f 6f 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 mes.at.layout.roots.............
2ec0 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 4c 61 79 6f 75 74 20 3d 20 6c 61 79 6f 75 74 2e 6e 61 6d 65 ..control.m_Layout.=.layout.name
2ee0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 56 61 72 69 61 6e 74 ;..............control.m_Variant
2f00 73 20 3d 20 76 61 72 69 61 6e 74 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 s.=.variants;..............contr
2f20 6f 6c 2e 6d 5f 50 61 72 65 6e 74 20 3d 20 70 61 72 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 ol.m_Parent.=.parent;...........
2f40 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 65 76 69 63 65 20 3d 20 6d 5f 44 65 76 69 63 65 3b 0d ...control.m_Device.=.m_Device;.
2f60 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 63 68 69 6c 64 72 65 ...............//.Create.childre
2f80 6e 20 61 6e 64 20 63 6f 6e 66 69 67 75 72 65 20 74 68 65 69 72 20 73 65 74 74 69 6e 67 73 20 66 n.and.configure.their.settings.f
2fa0 72 6f 6d 20 6f 75 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6c 61 79 6f 75 74 20 76 rom.our..............//.layout.v
2fc0 61 6c 75 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 68 61 76 65 43 68 69 6c alues...............var.haveChil
2fe0 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 20 3d drenUsingStateFromOtherControl.=
3000 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 .false;..............try........
3020 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 50 61 73 73 ......{..................//.Pass
3040 20 6c 69 73 74 20 6f 66 20 65 78 69 73 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 6f 6e 20 74 6f 20 .list.of.existing.control.on.to.
3060 66 75 6e 63 74 69 6f 6e 20 61 73 20 77 65 20 6d 61 79 20 68 61 76 65 20 64 65 63 69 64 65 64 20 function.as.we.may.have.decided.
3080 74 6f 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 63 74 75 61 to.not..................//.actua
30a0 6c 6c 79 20 72 65 75 73 65 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 28 lly.reuse.the.existing.control.(
30c0 61 6e 64 20 74 68 75 73 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 43 68 69 6c 64 72 65 6e 52 65 61 64 4f and.thus.control.m_ChildrenReadO
30e0 6e 6c 79 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6e 6f 77 nly.will..................//.now
3100 20 62 65 20 62 6c 61 6e 6b 29 20 62 75 74 20 73 74 69 6c 6c 20 77 61 6e 74 20 63 72 61 77 6c 69 .be.blank).but.still.want.crawli
3120 6e 67 20 64 6f 77 6e 20 74 68 65 20 68 69 65 72 61 72 63 68 79 20 74 6f 20 70 72 65 73 65 72 76 ng.down.the.hierarchy.to.preserv
3140 65 20 65 78 69 73 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 e.existing..................//.c
3160 6f 6e 74 72 6f 6c 73 20 77 68 65 72 65 20 70 6f 73 73 69 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 ontrols.where.possible..........
3180 20 20 20 20 20 20 20 20 20 41 64 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 73 28 6c 61 79 6f 75 74 .........AddChildControls(layout
31a0 2c 20 76 61 72 69 61 6e 74 73 2c 20 63 6f 6e 74 72 6f 6c 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ,.variants,.control,............
31c0 20 20 20 20 20 20 20 20 20 20 72 65 66 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 ..........ref.haveChildrenUsingS
31e0 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 tateFromOtherControl);..........
3200 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 61 74 63 68 0d 0a 20 20 20 20 20 20 ....}..............catch........
3220 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 ......{..................////TOD
3240 4f 3a 20 72 65 6d 6f 76 65 20 63 6f 6e 74 72 6f 6c 20 66 72 6f 6d 20 63 6f 6c 6c 65 63 74 69 6f O:.remove.control.from.collectio
3260 6e 20 61 6e 64 20 72 65 74 68 72 6f 77 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 n.and.rethrow..................t
3280 68 72 6f 77 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 hrow;..............}............
32a0 20 20 20 20 2f 2f 20 43 6f 6d 65 20 75 70 20 77 69 74 68 20 61 20 6c 61 79 6f 75 74 20 66 6f 72 ....//.Come.up.with.a.layout.for
32c0 20 6f 75 72 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 43 6f 6d 70 75 74 65 .our.state...............Compute
32e0 53 74 61 74 65 4c 61 79 6f 75 74 28 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 StateLayout(control);...........
3300 20 20 20 20 20 2f 2f 20 46 69 6e 61 6c 6c 79 2c 20 69 66 20 77 65 20 68 61 76 65 20 63 68 69 6c .....//.Finally,.if.we.have.chil
3320 64 20 63 6f 6e 74 72 6f 6c 73 20 74 68 61 74 20 74 61 6b 65 20 74 68 65 69 72 20 73 74 61 74 65 d.controls.that.take.their.state
3340 20 62 6c 6f 63 6b 73 20 66 72 6f 6d 20 6f 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .blocks.from.other..............
3360 2f 2f 20 63 6f 6e 74 72 6f 6c 73 2c 20 61 73 73 69 67 6e 20 74 68 65 6d 20 74 68 65 69 72 20 62 //.controls,.assign.them.their.b
3380 6c 6f 63 6b 73 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 76 65 locks.now...............if.(have
33a0 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 ChildrenUsingStateFromOtherContr
33c0 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ol)..............{..............
33e0 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 6c 61 79 6f 75 74 2e 6d 5f 43 6f 6e 74 ....var.controls.=.layout.m_Cont
3400 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 rols;..................for.(var.
3420 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 i.=.0;.i.<.controls.Length;.++i)
3440 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................{.............
3460 20 20 20 20 20 20 20 20 20 72 65 66 20 76 61 72 20 69 74 65 6d 20 3d 20 72 65 66 20 63 6f 6e 74 .........ref.var.item.=.ref.cont
3480 72 6f 6c 73 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 rols[i];......................if
34a0 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 69 74 65 6d 2e 75 73 65 53 .(string.IsNullOrEmpty(item.useS
34c0 74 61 74 65 46 72 6f 6d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tateFrom))......................
34e0 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....continue;...................
3500 20 20 20 41 70 70 6c 79 55 73 65 53 74 61 74 65 46 72 6f 6d 28 63 6f 6e 74 72 6f 6c 2c 20 72 65 ...ApplyUseStateFrom(control,.re
3520 66 20 69 74 65 6d 2c 20 6c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 f.item,.layout);................
3540 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ..}..............}..............
3560 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ..return.control;..........}....
3580 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 63 6f 6e 73 74 20 75 69 6e 74 20 6b 53 69 7a 65 ........private.const.uint.kSize
35a0 46 6f 72 43 6f 6e 74 72 6f 6c 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e ForControlUsingStateFromOtherCon
35c0 74 72 6f 6c 20 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 49 6e 76 61 6c 69 64 4f 66 trol.=.InputStateBlock.InvalidOf
35e0 66 73 65 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 41 64 fset;............private.void.Ad
3600 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 73 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 dChildControls(InputControlLayou
3620 74 20 6c 61 79 6f 75 74 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 t.layout,.InternedString.variant
3640 73 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 s,.InputControl.parent,.........
3660 20 20 20 20 20 72 65 66 20 62 6f 6f 6c 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 .....ref.bool.haveChildrenUsingS
3680 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 tateFromOtherControls)..........
36a0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 {..............var.controlLayout
36c0 73 20 3d 20 6c 61 79 6f 75 74 2e 6d 5f 43 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 s.=.layout.m_Controls;..........
36e0 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 20 3d 3d 20 6e 75 6c 6c 29 0d ....if.(controlLayouts.==.null).
3700 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 .................return;........
3720 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 6f 75 74 20 68 6f 77 20 6d 61 6e 79 20 64 69 72 ........//.Find.out.how.many.dir
3740 65 63 74 20 63 68 69 6c 64 72 65 6e 20 77 65 20 77 69 6c 6c 20 61 64 64 2e 0d 0a 20 20 20 20 20 ect.children.we.will.add........
3760 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 .......var.childCount.=.0;......
3780 20 20 20 20 20 20 20 20 76 61 72 20 68 61 76 65 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 57 69 74 ........var.haveControlLayoutWit
37a0 68 50 61 74 68 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 hPath.=.false;..............for.
37c0 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 2e 4c (var.i.=.0;.i.<.controlLayouts.L
37e0 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ength;.++i)..............{......
3800 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 69 66 20 76 61 72 69 61 6e 74 73 20 ............//.Skip.if.variants.
3820 64 6f 6e 27 74 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 don't.match...................if
3840 20 28 21 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 2e 76 61 72 69 61 6e 74 73 2e 49 73 .(!controlLayouts[i].variants.Is
3860 45 6d 70 74 79 28 29 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Empty().&&......................
3880 21 53 74 72 69 6e 67 48 65 6c 70 65 72 73 2e 43 68 61 72 61 63 74 65 72 53 65 70 61 72 61 74 65 !StringHelpers.CharacterSeparate
38a0 64 4c 69 73 74 73 48 61 76 65 41 74 4c 65 61 73 74 4f 6e 65 43 6f 6d 6d 6f 6e 45 6c 65 6d 65 6e dListsHaveAtLeastOneCommonElemen
38c0 74 28 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 2e 76 61 72 69 61 6e 74 73 2c 0d 0a 20 t(controlLayouts[i].variants,...
38e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 69 61 6e 74 73 2c .......................variants,
3900 20 27 2c 27 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 .','))......................cont
3920 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 inue;....................////REV
3940 49 45 57 3a 20 49 27 6d 20 6e 6f 74 20 73 75 72 65 20 74 68 69 73 20 69 73 20 67 6f 6f 64 20 65 IEW:.I'm.not.sure.this.is.good.e
3960 6e 6f 75 67 68 2e 20 41 54 4d 20 69 66 20 79 6f 75 20 68 61 76 65 20 61 20 63 6f 6e 74 72 6f 6c nough..ATM.if.you.have.a.control
3980 20 6c 61 79 6f 75 74 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .layout.with..................//
39a0 2f 2f 20 20 20 20 20 20 20 20 6e 61 6d 65 20 22 66 6f 6f 22 20 61 6e 64 20 6f 6e 65 20 77 69 74 //........name."foo".and.one.wit
39c0 68 20 6e 61 6d 65 20 22 66 6f 6f 2f 62 61 72 22 2c 20 74 68 65 6e 20 74 68 65 20 6c 61 74 74 65 h.name."foo/bar",.then.the.latte
39e0 72 20 69 73 20 74 61 6b 65 6e 20 61 73 20 61 6e 20 6f 76 65 72 72 69 64 65 0d 0a 20 20 20 20 20 r.is.taken.as.an.override.......
3a00 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 20 20 20 20 20 20 20 62 75 74 20 74 68 65 20 66 ...........////........but.the.f
3a20 6f 72 6d 65 72 20 69 73 6e 27 74 2e 20 48 6f 77 65 76 65 72 2c 20 77 68 65 74 68 65 72 20 69 74 ormer.isn't..However,.whether.it
3a40 20 68 61 73 20 61 20 73 6c 61 73 68 20 69 6e 20 74 68 65 20 70 61 74 68 20 6f 72 20 6e 6f 74 20 .has.a.slash.in.the.path.or.not.
3a60 73 68 6f 75 6c 64 6e 27 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 shouldn't..................////.
3a80 20 20 20 20 20 20 20 6d 61 74 74 65 72 2e 20 49 66 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f .......matter..If.a.control.layo
3aa0 75 74 20 6f 66 20 74 68 65 20 73 61 6d 65 20 6e 61 6d 65 20 61 6c 72 65 61 64 79 20 65 78 69 73 ut.of.the.same.name.already.exis
3ac0 74 73 2c 20 69 74 20 73 68 6f 75 6c 64 20 62 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ts,.it.should.be................
3ae0 20 20 2f 2f 2f 2f 20 20 20 20 20 20 20 20 63 6f 6e 73 69 64 65 72 65 64 20 61 6e 20 6f 76 65 72 ..////........considered.an.over
3b00 72 69 64 65 2c 20 69 66 20 6e 6f 74 2c 20 69 74 20 73 68 6f 75 6c 64 6e 27 74 2e 0d 0a 20 20 20 ride,.if.not,.it.shouldn't......
3b20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 20 61 20 6e 65 77 20 63 68 69 6c 64 20 .............//.Not.a.new.child.
3b40 69 66 20 69 74 27 73 20 61 20 6c 61 79 6f 75 74 20 72 65 61 63 68 69 6e 67 20 69 6e 20 74 6f 20 if.it's.a.layout.reaching.in.to.
3b60 74 68 65 20 68 69 65 72 61 72 63 68 79 20 74 6f 20 6d 6f 64 69 66 79 0d 0a 20 20 20 20 20 20 20 the.hierarchy.to.modify.........
3b80 20 20 20 20 20 20 20 20 20 2f 2f 20 61 6e 20 65 78 69 73 74 69 6e 67 20 63 68 69 6c 64 2e 0d 0a .........//.an.existing.child...
3ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 ................if.(controlLayou
3bc0 74 73 5b 69 5d 2e 69 73 4d 6f 64 69 66 79 69 6e 67 45 78 69 73 74 69 6e 67 43 6f 6e 74 72 6f 6c ts[i].isModifyingExistingControl
3be0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 )..................{............
3c00 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 2e ..........if.(controlLayouts[i].
3c20 69 73 41 72 72 61 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 isArray)........................
3c40 20 20 74 68 72 6f 77 20 6e 65 77 20 4e 6f 74 53 75 70 70 6f 72 74 65 64 45 78 63 65 70 74 69 6f ..throw.new.NotSupportedExceptio
3c60 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 n(..............................
3c80 24 22 43 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 2e 6e 61 $"Control.'{controlLayouts[i].na
3ca0 6d 65 7d 27 20 69 6e 20 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 7d 27 20 69 me}'.in.layout.'{layout.name}'.i
3cc0 73 20 6d 6f 64 69 66 79 69 6e 67 20 74 68 65 20 63 68 69 6c 64 20 6f 66 20 61 6e 6f 74 68 65 72 s.modifying.the.child.of.another
3ce0 20 63 6f 6e 74 72 6f 6c 20 62 75 74 20 69 73 20 6d 61 72 6b 65 64 20 61 73 20 61 6e 20 61 72 72 .control.but.is.marked.as.an.arr
3d00 61 79 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 76 ay");........................hav
3d20 65 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 57 69 74 68 50 61 74 68 20 3d 20 74 72 75 65 3b 0d 0a eControlLayoutWithPath.=.true;..
3d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 73 65 72 74 43 68 69 6c 64 43 ....................InsertChildC
3d60 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 28 70 61 72 65 6e 74 2c 20 72 65 66 20 63 6f 6e 74 72 ontrolOverride(parent,.ref.contr
3d80 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 olLayouts[i]);..................
3da0 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ....continue;..................}
3dc0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4c ....................if.(controlL
3de0 61 79 6f 75 74 73 5b 69 5d 2e 69 73 41 72 72 61 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ayouts[i].isArray)..............
3e00 20 20 20 20 20 20 20 20 63 68 69 6c 64 43 6f 75 6e 74 20 2b 3d 20 63 6f 6e 74 72 6f 6c 4c 61 79 ........childCount.+=.controlLay
3e20 6f 75 74 73 5b 69 5d 2e 61 72 72 61 79 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 outs[i].arraySize;..............
3e40 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b ....else......................++
3e60 63 68 69 6c 64 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 childCount;..............}......
3e80 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 20 69 66 20 74 68 ..........//.Nothing.to.do.if.th
3ea0 65 72 65 27 73 20 6e 6f 20 63 68 69 6c 64 72 65 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ere's.no.children...............
3ec0 69 66 20 28 63 68 69 6c 64 43 6f 75 6e 74 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 if.(childCount.==.0)............
3ee0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 72 65 6e 74 2e 6d 5f 43 68 ..{..................parent.m_Ch
3f00 69 6c 64 43 6f 75 6e 74 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ildCount.=.default;.............
3f20 20 20 20 20 20 70 61 72 65 6e 74 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 6e 64 65 78 20 3d 20 .....parent.m_ChildStartIndex.=.
3f40 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 76 65 43 68 default;..................haveCh
3f60 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c ildrenUsingStateFromOtherControl
3f80 73 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 s.=.false;..................retu
3fa0 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 rn;..............}..............
3fc0 20 20 2f 2f 20 41 64 64 20 72 6f 6f 6d 20 66 6f 72 20 75 73 20 69 6e 20 74 68 65 20 64 65 76 69 ..//.Add.room.for.us.in.the.devi
3fe0 63 65 27 73 20 63 68 69 6c 64 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 ce's.child.array...............v
4000 61 72 20 66 69 72 73 74 43 68 69 6c 64 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 ar.firstChildIndex.=.ArrayHelper
4020 73 2e 47 72 6f 77 42 79 28 72 65 66 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 43 68 69 6c 64 72 65 6e s.GrowBy(ref.m_Device.m_Children
4040 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 2c 20 63 68 69 6c 64 43 6f 75 6e 74 29 3b 0d 0a 0d 0a ForEachControl,.childCount);....
4060 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 63 6f 6e 74 72 6f 6c 73 20 66 72 6f 6d ............//.Add.controls.from
4080 20 61 6c 6c 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 73 20 65 78 63 65 70 74 20 74 68 65 20 .all.control.layouts.except.the.
40a0 6f 6e 65 73 20 74 68 61 74 20 68 61 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 70 ones.that.have..............//.p
40c0 61 74 68 73 20 69 6e 20 74 68 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 aths.in.them...............var.c
40e0 68 69 6c 64 49 6e 64 65 78 20 3d 20 66 69 72 73 74 43 68 69 6c 64 49 6e 64 65 78 3b 0d 0a 20 20 hildIndex.=.firstChildIndex;....
4100 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f ..........for.(var.i.=.0;.i.<.co
4120 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 ntrolLayouts.Length;.++i).......
4140 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f .......{..................var.co
4160 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 3b ntrolLayout.=.controlLayouts[i];
4180 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 63 6f 6e 74 ....................//.Skip.cont
41a0 72 6f 6c 20 6c 61 79 6f 75 74 73 20 74 68 61 74 20 64 6f 6e 27 74 20 61 64 64 20 63 6f 6e 74 72 rol.layouts.that.don't.add.contr
41c0 6f 6c 73 20 62 75 74 20 72 61 74 68 65 72 20 6d 6f 64 69 66 79 20 63 68 69 6c 64 0d 0a 20 20 20 ols.but.rather.modify.child.....
41e0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 6f 6e 74 72 6f 6c 73 20 6f 66 20 6f 74 68 65 .............//.controls.of.othe
4200 72 20 63 6f 6e 74 72 6f 6c 73 20 61 64 64 65 64 20 62 79 20 74 68 65 20 6c 61 79 6f 75 74 2e 20 r.controls.added.by.the.layout..
4220 57 65 20 64 6f 20 61 20 73 65 63 6f 6e 64 20 70 61 73 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 We.do.a.second.pass.............
4240 20 20 20 20 20 2f 2f 20 74 6f 20 61 70 70 6c 79 20 74 68 65 69 72 20 73 65 74 74 69 6e 67 73 2e .....//.to.apply.their.settings.
4260 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4c 61 79 ..................if.(controlLay
4280 6f 75 74 2e 69 73 4d 6f 64 69 66 79 69 6e 67 45 78 69 73 74 69 6e 67 43 6f 6e 74 72 6f 6c 29 0d out.isModifyingExistingControl).
42a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a .....................continue;..
42c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 63 6f 6e 74 ..................//.If.the.cont
42e0 72 6f 6c 20 69 73 20 70 61 72 74 20 6f 66 20 61 20 76 61 72 69 61 6e 74 2c 20 73 6b 69 70 20 69 rol.is.part.of.a.variant,.skip.i
4300 74 20 69 66 20 69 74 20 69 73 6e 27 74 20 69 6e 20 74 68 65 20 76 61 72 69 61 6e 74 73 20 77 65 t.if.it.isn't.in.the.variants.we
4320 27 72 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6c 6f 6f 6b 69 6e 67 20 're..................//.looking.
4340 66 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 for...................if.(!contr
4360 6f 6c 4c 61 79 6f 75 74 2e 76 61 72 69 61 6e 74 73 2e 49 73 45 6d 70 74 79 28 29 20 26 26 0d 0a olLayout.variants.IsEmpty().&&..
4380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 53 74 72 69 6e 67 48 65 6c 70 65 ....................!StringHelpe
43a0 72 73 2e 43 68 61 72 61 63 74 65 72 53 65 70 61 72 61 74 65 64 4c 69 73 74 73 48 61 76 65 41 74 rs.CharacterSeparatedListsHaveAt
43c0 4c 65 61 73 74 4f 6e 65 43 6f 6d 6d 6f 6e 45 6c 65 6d 65 6e 74 28 63 6f 6e 74 72 6f 6c 4c 61 79 LeastOneCommonElement(controlLay
43e0 6f 75 74 2e 76 61 72 69 61 6e 74 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 out.variants,...................
4400 20 20 20 20 20 20 20 76 61 72 69 61 6e 74 73 2c 20 27 2c 27 29 29 0d 0a 20 20 20 20 20 20 20 20 .......variants,.','))..........
4420 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............continue;...........
4440 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 61 6e 20 61 72 72 61 79 2c 20 61 64 .........//.If.it's.an.array,.ad
4460 64 20 61 20 63 6f 6e 74 72 6f 6c 20 66 6f 72 20 65 61 63 68 20 61 72 72 61 79 20 65 6c 65 6d 65 d.a.control.for.each.array.eleme
4480 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c nt...................if.(control
44a0 4c 61 79 6f 75 74 2e 69 73 41 72 72 61 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Layout.isArray).................
44c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 .{......................for.(var
44e0 20 6e 20 3d 20 30 3b 20 6e 20 3c 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 61 72 72 61 79 53 .n.=.0;.n.<.controlLayout.arrayS
4500 69 7a 65 3b 20 2b 2b 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b ize;.++n)......................{
4520 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 61 ..........................var.na
4540 6d 65 20 3d 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 6e 61 6d 65 20 2b 20 6e 3b 0d 0a 20 20 me.=.controlLayout.name.+.n;....
4560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f ......................var.contro
4580 6c 20 3d 20 41 64 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 28 6c 61 79 6f 75 74 2c 20 76 61 72 69 l.=.AddChildControl(layout,.vari
45a0 61 6e 74 73 2c 20 70 61 72 65 6e 74 2c 20 72 65 66 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 ants,.parent,.ref.haveChildrenUs
45c0 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 2c 0d 0a 20 20 20 20 ingStateFromOtherControls,......
45e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 4c ........................controlL
4600 61 79 6f 75 74 2c 20 63 68 69 6c 64 49 6e 64 65 78 2c 20 6e 61 6d 65 4f 76 65 72 72 69 64 65 3a ayout,.childIndex,.nameOverride:
4620 20 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .name);.........................
4640 20 2b 2b 63 68 69 6c 64 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .++childIndex;..................
4660 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 6f 66 66 73 65 74 2c 20 69 66 20 74 ..........//.Adjust.offset,.if.t
4680 68 65 20 63 6f 6e 74 72 6f 6c 20 75 73 65 73 20 65 78 70 6c 69 63 69 74 20 6f 66 66 73 65 74 73 he.control.uses.explicit.offsets
46a0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 ...........................if.(c
46c0 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 21 ontrol.m_StateBlock.byteOffset.!
46e0 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 65 74 29 =.InputStateBlock.InvalidOffset)
4700 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f ..............................co
4720 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 2b 3d ntrol.m_StateBlock.byteOffset.+=
4740 20 28 75 69 6e 74 29 6e 20 2a 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e .(uint)n.*.control.m_StateBlock.
4760 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 alignedSizeInBytes;.............
4780 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .........}..................}...
47a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ...............else.............
47c0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 64 64 43 .....{......................AddC
47e0 68 69 6c 64 43 6f 6e 74 72 6f 6c 28 6c 61 79 6f 75 74 2c 20 76 61 72 69 61 6e 74 73 2c 20 70 61 hildControl(layout,.variants,.pa
4800 72 65 6e 74 2c 20 72 65 66 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 rent,.ref.haveChildrenUsingState
4820 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 FromOtherControls,..............
4840 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2c 20 63 68 69 6c 64 ............controlLayout,.child
4860 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 63 Index);......................++c
4880 68 69 6c 64 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 hildIndex;..................}...
48a0 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 61 72 65 ...........}................pare
48c0 6e 74 2e 6d 5f 43 68 69 6c 64 43 6f 75 6e 74 20 3d 20 63 68 69 6c 64 43 6f 75 6e 74 3b 0d 0a 20 nt.m_ChildCount.=.childCount;...
48e0 20 20 20 20 20 20 20 20 20 20 20 70 61 72 65 6e 74 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 6e ...........parent.m_ChildStartIn
4900 64 65 78 20 3d 20 66 69 72 73 74 43 68 69 6c 64 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 dex.=.firstChildIndex;..........
4920 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 74 68 65 72 65 27 73 20 70 72 6f 62 61 62 ......////REVIEW:.there's.probab
4940 6c 79 20 61 20 62 65 74 74 65 72 20 77 61 79 20 74 6f 20 64 6f 20 74 68 69 73 20 62 61 73 65 64 ly.a.better.way.to.do.this.based
4960 20 6f 6e 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 0d 0a 20 20 20 .on.m_ChildControlOverrides.....
4980 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 61 70 70 6c 79 20 61 6c 6c 20 6f 76 65 72 72 69 64 .........//.We.apply.all.overrid
49a0 65 73 20 74 68 72 6f 75 67 68 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 es.through.m_ChildControlOverrid
49c0 65 73 2e 20 48 6f 77 65 76 65 72 2c 20 74 68 65 72 65 20 6d 61 79 20 62 65 20 61 20 63 6f 6e 74 es..However,.there.may.be.a.cont
49e0 72 6f 6c 20 69 74 65 6d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 61 74 20 2a 61 rol.item..............//.that.*a
4a00 64 64 73 2a 20 61 20 63 68 69 6c 64 20 63 6f 6e 74 72 6f 6c 20 74 6f 20 61 6e 6f 74 68 65 72 20 dds*.a.child.control.to.another.
4a20 65 78 69 73 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 2e 20 54 68 69 73 20 77 69 6c 6c 20 6c 6f 6f 6b existing.control..This.will.look
4a40 20 74 68 65 20 73 61 6d 65 20 61 73 20 6f 76 65 72 72 69 64 69 6e 67 0d 0a 20 20 20 20 20 20 20 .the.same.as.overriding.........
4a60 20 20 20 20 20 2f 2f 20 70 72 6f 70 65 72 74 69 65 73 20 6f 6e 20 61 20 63 68 69 6c 64 20 63 6f .....//.properties.on.a.child.co
4a80 6e 74 72 6f 6c 20 6a 75 73 74 20 74 68 61 74 20 69 6e 20 74 68 69 73 20 63 61 73 65 20 74 68 65 ntrol.just.that.in.this.case.the
4aa0 20 63 68 69 6c 64 20 63 6f 6e 74 72 6f 6c 20 64 6f 65 73 6e 27 74 20 65 78 69 73 74 2e 0d 0a 20 .child.control.doesn't.exist....
4ac0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 6f ...........//..............//.Go
4ae0 20 74 68 72 6f 75 67 68 20 61 6c 6c 20 74 68 65 20 63 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 63 68 .through.all.the.controls.and.ch
4b00 65 63 6b 20 66 6f 72 20 6f 6e 65 73 20 74 68 61 74 20 6e 65 65 64 20 74 6f 20 62 65 20 61 64 64 eck.for.ones.that.need.to.be.add
4b20 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 76 65 43 6f 6e 74 72 6f 6c ed...............if.(haveControl
4b40 4c 61 79 6f 75 74 57 69 74 68 50 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a LayoutWithPath)..............{..
4b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 ................for.(var.i.=.0;.
4b80 69 20 3c 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d i.<.controlLayouts.Length;.++i).
4ba0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .................{..............
4bc0 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 ........var.controlLayout.=.cont
4be0 72 6f 6c 4c 61 79 6f 75 74 73 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rolLayouts[i];..................
4c00 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 69 73 4d 6f 64 69 66 79 69 ....if.(!controlLayout.isModifyi
4c20 6e 67 45 78 69 73 74 69 6e 67 43 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ngExistingControl)..............
4c40 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............continue;...........
4c60 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 69 .............//.If.the.control.i
4c80 73 20 70 61 72 74 20 6f 66 20 61 20 76 61 72 69 61 6e 74 73 2c 20 73 6b 69 70 20 69 74 20 69 66 s.part.of.a.variants,.skip.it.if
4ca0 20 69 74 20 69 73 6e 27 74 20 74 68 65 20 76 61 72 69 61 6e 74 73 20 77 65 27 72 65 0d 0a 20 20 .it.isn't.the.variants.we're....
4cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6c 6f 6f 6b 69 6e 67 20 66 6f 72 ..................//.looking.for
4ce0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 .......................if.(!cont
4d00 72 6f 6c 4c 61 79 6f 75 74 2e 76 61 72 69 61 6e 74 73 2e 49 73 45 6d 70 74 79 28 29 20 26 26 20 rolLayout.variants.IsEmpty().&&.
4d20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 76 61 72 69 61 6e 74 73 20 21 3d 20 76 61 72 69 61 6e controlLayout.variants.!=.varian
4d40 74 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e ts)..........................con
4d60 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 64 tinue;........................Ad
4d80 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 49 66 4d 69 73 73 69 6e 67 28 6c 61 79 6f 75 74 2c 20 76 dChildControlIfMissing(layout,.v
4da0 61 72 69 61 6e 74 73 2c 20 70 61 72 65 6e 74 2c 20 72 65 66 20 68 61 76 65 43 68 69 6c 64 72 65 ariants,.parent,.ref.haveChildre
4dc0 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 2c 0d 0a 20 nUsingStateFromOtherControls,...
4de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 63 6f 6e 74 72 .......................ref.contr
4e00 6f 6c 4c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 olLayout);..................}...
4e20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 ...........}..........}.........
4e40 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 41 64 64 43 68 69 6c 64 ...private.InputControl.AddChild
4e60 43 6f 6e 74 72 6f 6c 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 6c 61 79 6f 75 Control(InputControlLayout.layou
4e80 74 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 2c 20 49 6e 70 75 t,.InternedString.variants,.Inpu
4ea0 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 tControl.parent,..............re
4ec0 66 20 62 6f 6f 6c 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f f.bool.haveChildrenUsingStateFro
4ee0 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 mOtherControls,..............Inp
4f00 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 63 6f 6e 74 utControlLayout.ControlItem.cont
4f20 72 6f 6c 49 74 65 6d 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 69 6c 64 49 rolItem,..............int.childI
4f40 6e 64 65 78 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 4f 76 65 72 72 69 64 65 20 3d 20 6e 75 6c 6c ndex,.string.nameOverride.=.null
4f60 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 61 )..........{..............var.na
4f80 6d 65 20 3d 20 6e 61 6d 65 4f 76 65 72 72 69 64 65 20 3f 3f 20 63 6f 6e 74 72 6f 6c 49 74 65 6d me.=.nameOverride.??.controlItem
4fa0 2e 6e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 61 6d 65 49 6e 74 65 .name;..............var.nameInte
4fc0 72 6e 65 64 20 3d 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 6e 61 6d 65 29 3b rned.=.new.InternedString(name);
4fe0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 63 61 6e 20 ................////REVIEW:.can.
5000 77 65 20 63 68 65 63 6b 20 74 68 69 73 20 69 6e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 we.check.this.in.InputControlLay
5020 6f 75 74 20 69 6e 73 74 65 61 64 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 out.instead?..............if.(st
5040 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6c ring.IsNullOrEmpty(controlItem.l
5060 61 79 6f 75 74 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e ayout))..................throw.n
5080 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 24 22 4c ew.InvalidOperationException($"L
50a0 61 79 6f 75 74 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 73 65 74 20 6f 6e 20 63 6f 6e 74 72 6f ayout.has.not.been.set.on.contro
50c0 6c 20 27 7b 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 7d 27 20 69 6e 20 27 7b 6c 61 79 6f l.'{controlItem.name}'.in.'{layo
50e0 75 74 2e 6e 61 6d 65 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 ut.name}'");................//.S
5100 65 65 20 69 66 20 74 68 65 72 65 20 69 73 20 61 6e 20 6f 76 65 72 72 69 64 65 20 66 6f 72 20 74 ee.if.there.is.an.override.for.t
5120 68 65 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 he.control...............if.(m_C
5140 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 hildControlOverrides.!=.null)...
5160 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 ...........{..................va
5180 72 20 70 61 74 68 20 3d 20 24 22 7b 70 61 72 65 6e 74 2e 70 61 74 68 7d 2f 7b 6e 61 6d 65 7d 22 r.path.=.$"{parent.path}/{name}"
51a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 4c 6f 77 65 72 ;..................var.pathLower
51c0 43 61 73 65 20 3d 20 70 61 74 68 2e 54 6f 4c 6f 77 65 72 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 Case.=.path.ToLower();..........
51e0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 ..........if.(m_ChildControlOver
5200 72 69 64 65 73 2e 54 72 79 47 65 74 56 61 6c 75 65 28 70 61 74 68 4c 6f 77 65 72 43 61 73 65 2c rides.TryGetValue(pathLowerCase,
5220 20 6f 75 74 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 29 29 0d 0a 20 20 20 20 .out.var.controlOverride))......
5240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 20 3d 20 63 6f ................controlItem.=.co
5260 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 2e 4d 65 72 67 65 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 ntrolOverride.Merge(controlItem)
5280 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ;..............}................
52a0 2f 2f 20 47 65 74 20 6e 61 6d 65 20 6f 66 20 6c 61 79 6f 75 74 20 74 6f 20 75 73 65 20 66 6f 72 //.Get.name.of.layout.to.use.for
52c0 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 79 6f 75 .control...............var.layou
52e0 74 4e 61 6d 65 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6c 61 79 6f 75 74 3b 0d 0a 0d 0a 20 tName.=.controlItem.layout;.....
5300 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 ...........//.Create.control....
5320 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 3b ...........InputControl.control;
5340 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ..............try..............{
5360 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 20 3d 20 49 6e 73 74 ..................control.=.Inst
5380 61 6e 74 69 61 74 65 4c 61 79 6f 75 74 28 6c 61 79 6f 75 74 4e 61 6d 65 2c 20 76 61 72 69 61 6e antiateLayout(layoutName,.varian
53a0 74 73 2c 20 6e 61 6d 65 49 6e 74 65 72 6e 65 64 2c 20 70 61 72 65 6e 74 29 3b 0d 0a 20 20 20 20 ts,.nameInterned,.parent);......
53c0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 61 74 63 68 20 28 49 6e ........}..............catch.(In
53e0 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 4c 61 79 6f 75 74 4e 6f 74 46 6f 75 6e 64 45 putControlLayout.LayoutNotFoundE
5400 78 63 65 70 74 69 6f 6e 20 65 78 63 65 70 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 xception.exception).............
5420 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 68 72 6f 77 20 62 65 74 .{..................//.Throw.bet
5440 74 65 72 20 65 78 63 65 70 74 69 6f 6e 20 74 68 61 74 20 67 69 76 65 73 20 6d 6f 72 65 20 69 6e ter.exception.that.gives.more.in
5460 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 fo...................throw.new.I
5480 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 4c 61 79 6f 75 74 4e 6f 74 46 6f 75 6e 64 nputControlLayout.LayoutNotFound
54a0 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Exception(......................
54c0 24 22 43 61 6e 6e 6f 74 20 66 69 6e 64 20 6c 61 79 6f 75 74 20 27 7b 65 78 63 65 70 74 69 6f 6e $"Cannot.find.layout.'{exception
54e0 2e 6c 61 79 6f 75 74 7d 27 20 75 73 65 64 20 69 6e 20 63 6f 6e 74 72 6f 6c 20 27 7b 6e 61 6d 65 .layout}'.used.in.control.'{name
5500 7d 27 20 6f 66 20 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 7d 27 22 2c 0d 0a }'.of.layout.'{layout.name}'",..
5520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74 69 6f 6e 29 3b 0d ....................exception);.
5540 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .............}................//
5560 20 41 64 64 20 74 6f 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e .Add.to.array...............//.N
5580 4f 54 45 3a 20 41 64 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 49 6e 73 74 61 6e OTE:.AddChildControls.and.Instan
55a0 74 69 61 74 65 4c 61 79 6f 75 74 20 74 61 6b 65 20 63 61 72 65 20 6f 66 20 67 72 6f 77 69 6e 67 tiateLayout.take.care.of.growing
55c0 20 74 68 65 20 61 72 72 61 79 20 61 6e 64 20 6d 61 6b 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 .the.array.and.making...........
55e0 20 20 20 2f 2f 20 20 20 20 20 20 20 72 6f 6f 6d 20 66 6f 72 20 74 68 65 20 69 6d 6d 65 64 69 61 ...//.......room.for.the.immedia
5600 74 65 20 63 68 69 6c 64 72 65 6e 20 6f 66 20 65 61 63 68 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 te.children.of.each.control.....
5620 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 43 68 69 6c 64 72 65 6e 46 6f 72 ..........m_Device.m_ChildrenFor
5640 45 61 63 68 43 6f 6e 74 72 6f 6c 5b 63 68 69 6c 64 49 6e 64 65 78 5d 20 3d 20 63 6f 6e 74 72 6f EachControl[childIndex].=.contro
5660 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 66 6c 61 67 73 20 61 l;................//.Set.flags.a
5680 6e 64 20 6d 69 73 63 20 74 68 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e nd.misc.things...............con
56a0 74 72 6f 6c 2e 6e 6f 69 73 79 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 69 73 4e 6f 69 73 79 trol.noisy.=.controlItem.isNoisy
56c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 73 79 6e 74 68 65 74 69 63 ;..............control.synthetic
56e0 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 69 73 53 79 6e 74 68 65 74 69 63 3b 0d 0a 20 20 20 .=.controlItem.isSynthetic;.....
5700 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 6e 6f 69 73 79 29 0d 0a 20 20 20 .........if.(control.noisy).....
5720 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6e 6f 69 73 79 20 3d 20 74 72 .............m_Device.noisy.=.tr
5740 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 65 6d 62 65 72 20 74 ue;................//.Remember.t
5760 68 65 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 20 66 72 6f 6d 20 74 68 65 20 6c 61 79 6f 75 74 he.display.names.from.the.layout
5780 2e 20 57 65 20 6c 61 74 65 72 20 64 6f 20 61 20 70 72 6f 70 65 72 20 70 61 73 73 20 6f 6e 63 65 ..We.later.do.a.proper.pass.once
57a0 20 77 65 20 68 61 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 20 66 75 6c .we.have..............//.the.ful
57c0 6c 20 68 69 65 72 61 72 63 68 79 20 74 6f 20 73 65 74 20 66 69 6e 61 6c 20 6e 61 6d 65 73 2e 0d l.hierarchy.to.set.final.names..
57e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 69 73 70 6c 61 79 4e 61 .............control.m_DisplayNa
5800 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 64 69 73 70 6c meFromLayout.=.controlItem.displ
5820 61 79 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 ayName;..............control.m_S
5840 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 hortDisplayNameFromLayout.=.cont
5860 72 6f 6c 49 74 65 6d 2e 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 rolItem.shortDisplayName;.......
5880 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 2e 0d 0a .........//.Set.default.value...
58a0 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 65 66 61 75 6c 74 53 74 61 ............control.m_DefaultSta
58c0 74 65 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 64 65 66 61 75 6c 74 53 74 61 74 65 3b 0d 0a te.=.controlItem.defaultState;..
58e0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 65 66 61 75 ............if.(!control.m_Defau
5900 6c 74 53 74 61 74 65 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ltState.isEmpty)................
5920 20 20 6d 5f 44 65 76 69 63 65 2e 68 61 73 43 6f 6e 74 72 6f 6c 73 57 69 74 68 44 65 66 61 75 6c ..m_Device.hasControlsWithDefaul
5940 74 53 74 61 74 65 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f tState.=.true;................//
5960 20 53 65 74 20 6d 69 6e 20 61 6e 64 20 6d 61 78 20 76 61 6c 75 65 2e 20 44 6f 6e 27 74 20 6a 75 .Set.min.and.max.value..Don't.ju
5980 73 74 20 6f 76 65 72 77 72 69 74 65 20 68 65 72 65 20 61 73 20 74 68 65 20 63 6f 6e 74 72 6f 6c st.overwrite.here.as.the.control
59a0 27 73 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 6d 61 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 's.constructor.may..............
59c0 2f 2f 20 68 61 76 65 20 73 65 74 20 61 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 2e 0d 0a 20 20 //.have.set.a.default.value.....
59e0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6d 69 6e 56 61 ..........if.(!controlItem.minVa
5a00 6c 75 65 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f lue.isEmpty)..................co
5a20 6e 74 72 6f 6c 2e 6d 5f 4d 69 6e 56 61 6c 75 65 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6d ntrol.m_MinValue.=.controlItem.m
5a40 69 6e 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 inValue;..............if.(!contr
5a60 6f 6c 49 74 65 6d 2e 6d 61 78 56 61 6c 75 65 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 olItem.maxValue.isEmpty)........
5a80 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 4d 61 78 56 61 6c 75 65 20 3d 20 63 ..........control.m_MaxValue.=.c
5aa0 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6d 61 78 56 61 6c 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ontrolItem.maxValue;............
5ac0 20 20 20 20 2f 2f 20 50 61 73 73 20 73 74 61 74 65 20 62 6c 6f 63 6b 20 63 6f 6e 66 69 67 20 6f ....//.Pass.state.block.config.o
5ae0 6e 20 74 6f 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 n.to.control...............var.u
5b00 73 65 73 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 20 3d 20 21 73 74 72 69 sesStateFromOtherControl.=.!stri
5b20 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 75 73 65 ng.IsNullOrEmpty(controlItem.use
5b40 53 74 61 74 65 46 72 6f 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 75 73 StateFrom);..............if.(!us
5b60 65 73 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 esStateFromOtherControl)........
5b80 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c ......{..................control
5ba0 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 3d 20 63 6f 6e 74 72 .m_StateBlock.byteOffset.=.contr
5bc0 6f 6c 49 74 65 6d 2e 6f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 olItem.offset;..................
5be0 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 3d control.m_StateBlock.bitOffset.=
5c00 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 62 69 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .controlItem.bit;...............
5c20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 73 69 7a 65 49 6e 42 69 74 73 20 21 3d ...if.(controlItem.sizeInBits.!=
5c40 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c .0)......................control
5c60 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d 20 63 6f 6e 74 72 .m_StateBlock.sizeInBits.=.contr
5c80 6f 6c 49 74 65 6d 2e 73 69 7a 65 49 6e 42 69 74 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 olItem.sizeInBits;..............
5ca0 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 66 6f 72 6d 61 74 20 21 3d 20 30 29 ....if.(controlItem.format.!=.0)
5cc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 46 6f 72 6d 61 74 28 ......................SetFormat(
5ce0 63 6f 6e 74 72 6f 6c 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 control,.controlItem);..........
5d00 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 ....}..............else.........
5d20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 72 6b 20 .....{..................//.Mark.
5d40 63 6f 6e 74 72 6f 6c 73 20 74 68 61 74 20 64 6f 6e 27 74 20 68 61 76 65 20 73 74 61 74 65 20 62 controls.that.don't.have.state.b
5d60 6c 6f 63 6b 73 20 6f 66 20 74 68 65 69 72 20 6f 77 6e 20 62 75 74 20 72 61 74 68 65 72 20 67 65 locks.of.their.own.but.rather.ge
5d80 74 20 74 68 65 69 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 6c 6f 63 t.their..................//.bloc
5da0 6b 73 20 66 72 6f 6d 20 6f 74 68 65 72 20 63 6f 6e 74 72 6f 6c 73 20 62 79 20 73 65 74 74 69 6e ks.from.other.controls.by.settin
5dc0 67 20 74 68 65 69 72 20 73 74 61 74 65 20 73 69 7a 65 20 74 6f 20 49 6e 76 61 6c 69 64 4f 66 66 g.their.state.size.to.InvalidOff
5de0 73 65 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f set...................control.m_
5e00 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d 20 6b 53 69 7a 65 46 6f 72 StateBlock.sizeInBits.=.kSizeFor
5e20 43 6f 6e 74 72 6f 6c 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f ControlUsingStateFromOtherContro
5e40 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 76 65 43 68 69 6c 64 72 65 6e l;..................haveChildren
5e60 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 20 3d 20 74 72 UsingStateFromOtherControls.=.tr
5e80 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ue;..............}..............
5ea0 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 74 68 65 20 63 6f 6e 73 74 61 6e 74 20 61 70 70 65 6e ..////REVIEW:.the.constant.appen
5ec0 64 69 6e 67 20 74 6f 20 6d 5f 55 73 61 67 65 73 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 20 61 ding.to.m_UsagesForEachControl.a
5ee0 6e 64 20 6d 5f 41 6c 69 61 73 65 73 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 20 6d 61 79 20 6c nd.m_AliasesForEachControl.may.l
5f00 65 61 64 20 74 6f 20 61 20 6c 6f 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 20 ead.to.a.lot..............////..
5f20 20 20 20 20 20 20 6f 66 20 73 75 63 63 65 73 73 69 76 65 20 72 65 2d 61 6c 6c 6f 63 61 74 69 6f ......of.successive.re-allocatio
5f40 6e 73 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 75 73 61 67 65 73 2e ns................//.Add.usages.
5f60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 61 67 65 73 20 3d 20 63 6f 6e 74 72 ..............var.usages.=.contr
5f80 6f 6c 49 74 65 6d 2e 75 73 61 67 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 olItem.usages;..............if.(
5fa0 75 73 61 67 65 73 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b usages.Count.>.0)..............{
5fc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 61 67 65 43 6f 75 6e 74 ..................var.usageCount
5fe0 20 3d 20 75 73 61 67 65 73 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.usages.Count;................
6000 20 20 76 61 72 20 75 73 61 67 65 49 6e 64 65 78 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..var.usageIndex.=..............
6020 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 54 6f 49 6d 6d ........ArrayHelpers.AppendToImm
6040 75 74 61 62 6c 65 28 72 65 66 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 55 73 61 67 65 73 46 6f 72 45 utable(ref.m_Device.m_UsagesForE
6060 61 63 68 43 6f 6e 74 72 6f 6c 2c 20 75 73 61 67 65 73 2e 6d 5f 41 72 72 61 79 29 3b 0d 0a 20 20 achControl,.usages.m_Array);....
6080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 55 73 61 67 65 53 74 61 ..............control.m_UsageSta
60a0 72 74 49 6e 64 65 78 20 3d 20 75 73 61 67 65 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 rtIndex.=.usageIndex;...........
60c0 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 55 73 61 67 65 43 6f 75 6e 74 20 3d 20 75 73 .......control.m_UsageCount.=.us
60e0 61 67 65 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 ageCount;....................Arr
6100 61 79 48 65 6c 70 65 72 73 2e 47 72 6f 77 42 79 28 72 65 66 20 6d 5f 44 65 76 69 63 65 2e 6d 5f ayHelpers.GrowBy(ref.m_Device.m_
6120 55 73 61 67 65 54 6f 43 6f 6e 74 72 6f 6c 2c 20 75 73 61 67 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 UsageToControl,.usageCount);....
6140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 6e 20 3d 20 30 3b 20 6e 20 ..............for.(var.n.=.0;.n.
6160 3c 20 75 73 61 67 65 43 6f 75 6e 74 3b 20 2b 2b 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 <.usageCount;.++n)..............
6180 20 20 20 20 20 20 20 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 55 73 61 67 65 54 6f 43 6f 6e 74 72 6f ........m_Device.m_UsageToContro
61a0 6c 5b 75 73 61 67 65 49 6e 64 65 78 20 2b 20 6e 5d 20 3d 20 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 l[usageIndex.+.n].=.control;....
61c0 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 ..........}................//.Ad
61e0 64 20 61 6c 69 61 73 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 d.aliases...............if.(cont
6200 72 6f 6c 49 74 65 6d 2e 61 6c 69 61 73 65 73 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 rolItem.aliases.Count.>.0)......
6220 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 ........{..................var.a
6240 6c 69 61 73 43 6f 75 6e 74 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 61 6c 69 61 73 65 73 2e liasCount.=.controlItem.aliases.
6260 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 6c 69 61 Count;..................var.alia
6280 73 49 6e 64 65 78 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 sIndex.=......................Ar
62a0 72 61 79 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 54 6f 49 6d 6d 75 74 61 62 6c 65 28 72 65 66 rayHelpers.AppendToImmutable(ref
62c0 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 41 6c 69 61 73 65 73 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f .m_Device.m_AliasesForEachContro
62e0 6c 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 61 6c 69 61 73 65 73 2e 6d 5f 41 72 72 61 79 29 3b l,.controlItem.aliases.m_Array);
6300 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 41 6c 69 61 ..................control.m_Alia
6320 73 53 74 61 72 74 49 6e 64 65 78 20 3d 20 61 6c 69 61 73 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 sStartIndex.=.aliasIndex;.......
6340 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 41 6c 69 61 73 43 6f 75 6e 74 20 ...........control.m_AliasCount.
6360 3d 20 61 6c 69 61 73 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a =.aliasCount;..............}....
6380 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 70 61 72 61 6d 65 74 65 72 73 2e 0d 0a ............//.Set.parameters...
63a0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 70 61 72 61 ............if.(controlItem.para
63c0 6d 65 74 65 72 73 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 meters.Count.>.0)...............
63e0 20 20 20 4e 61 6d 65 64 56 61 6c 75 65 2e 41 70 70 6c 79 41 6c 6c 54 6f 4f 62 6a 65 63 74 28 63 ...NamedValue.ApplyAllToObject(c
6400 6f 6e 74 72 6f 6c 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 70 61 72 61 6d 65 74 65 72 73 29 3b ontrol,.controlItem.parameters);
6420 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 70 72 6f 63 65 73 73 6f 72 ................//.Add.processor
6440 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e s...............if.(controlItem.
6460 70 72 6f 63 65 73 73 6f 72 73 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 processors.Count.>.0)...........
6480 20 20 20 20 20 20 20 41 64 64 50 72 6f 63 65 73 73 6f 72 73 28 63 6f 6e 74 72 6f 6c 2c 20 72 65 .......AddProcessors(control,.re
64a0 66 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2c 20 6c 61 79 6f 75 74 2e 6e 61 6d 65 29 3b 0d 0a 0d 0a f.controlItem,.layout.name);....
64c0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 ............return.control;.....
64e0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 49 .....}............private.void.I
6500 6e 73 65 72 74 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 28 49 6e 70 75 74 43 nsertChildControlOverride(InputC
6520 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 2c 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c ontrol.parent,.ref.InputControlL
6540 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 0d 0a ayout.ControlItem.controlItem)..
6560 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 68 69 ........{..............if.(m_Chi
6580 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 ldControlOverrides.==.null).....
65a0 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 .............m_ChildControlOverr
65c0 69 64 65 73 20 3d 20 6e 65 77 20 44 69 63 74 69 6f 6e 61 72 79 3c 73 74 72 69 6e 67 2c 20 49 6e ides.=.new.Dictionary<string,.In
65e0 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 3e 28 29 3b putControlLayout.ControlItem>();
6600 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 20 3d 20 49 6e 70 75 74 ................var.path.=.Input
6620 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 43 6f 6d 62 69 6e 65 28 70 61 72 65 6e 74 2c 20 63 6f 6e 74 ControlPath.Combine(parent,.cont
6640 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 rolItem.name);..............var.
6660 70 61 74 68 4c 6f 77 65 72 43 61 73 65 20 3d 20 70 61 74 68 2e 54 6f 4c 6f 77 65 72 28 29 3b 0d pathLowerCase.=.path.ToLower();.
6680 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 74 68 65 72 65 20 61 ...............//.See.if.there.a
66a0 72 65 20 65 78 69 73 74 69 6e 67 20 6f 76 65 72 72 69 64 65 73 20 66 6f 72 20 74 68 65 20 63 6f re.existing.overrides.for.the.co
66c0 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 43 68 69 6c 64 ntrol...............if.(!m_Child
66e0 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 2e 54 72 79 47 65 74 56 61 6c 75 65 28 70 61 74 ControlOverrides.TryGetValue(pat
6700 68 4c 6f 77 65 72 43 61 73 65 2c 20 6f 75 74 20 76 61 72 20 65 78 69 73 74 69 6e 67 4f 76 65 72 hLowerCase,.out.var.existingOver
6720 72 69 64 65 73 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 rides))..............{..........
6740 20 20 20 20 20 20 20 20 2f 2f 20 53 6f 2c 20 73 6f 20 6a 75 73 74 20 69 6e 73 65 72 74 20 6f 75 ........//.So,.so.just.insert.ou
6760 72 20 6f 76 65 72 72 69 64 65 73 20 61 6e 64 20 77 65 27 72 65 20 64 6f 6e 65 2e 0d 0a 20 20 20 r.overrides.and.we're.done......
6780 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 .............m_ChildControlOverr
67a0 69 64 65 73 5b 70 61 74 68 4c 6f 77 65 72 43 61 73 65 5d 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 ides[pathLowerCase].=.controlIte
67c0 6d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 m;..................return;.....
67e0 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 59 65 73 .........}................//.Yes
6800 2c 20 74 68 65 72 65 27 73 20 65 78 69 73 74 69 6e 67 20 6f 76 65 72 72 69 64 65 73 20 73 6f 20 ,.there's.existing.overrides.so.
6820 77 65 20 68 61 76 65 20 74 6f 20 6d 65 72 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f we.have.to.merge.............../
6840 2f 20 4e 4f 54 45 3a 20 54 68 65 20 65 78 69 73 74 69 6e 67 20 6f 76 65 72 72 69 64 65 27 73 20 /.NOTE:.The.existing.override's.
6860 70 72 6f 70 65 72 74 69 65 73 20 74 61 6b 65 20 70 72 65 63 65 64 65 6e 63 65 20 68 65 72 65 2e properties.take.precedence.here.
6880 20 54 68 69 73 20 69 73 20 62 65 63 61 75 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .This.is.because..............//
68a0 20 20 20 20 20 20 20 74 68 65 20 6f 76 65 72 72 69 64 65 20 68 61 73 20 62 65 65 6e 20 65 73 74 .......the.override.has.been.est
68c0 61 62 6c 69 73 68 65 64 20 66 72 6f 6d 20 68 69 67 68 65 72 20 75 70 20 69 6e 20 74 68 65 20 6c ablished.from.higher.up.in.the.l
68e0 61 79 6f 75 74 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 ayout.hierarchy...............ex
6900 69 73 74 69 6e 67 4f 76 65 72 72 69 64 65 73 20 3d 20 65 78 69 73 74 69 6e 67 4f 76 65 72 72 69 istingOverrides.=.existingOverri
6920 64 65 73 2e 4d 65 72 67 65 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 3b 0d 0a 20 20 20 20 20 20 20 des.Merge(controlItem);.........
6940 20 20 20 20 20 6d 5f 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 4f 76 65 72 72 69 64 65 73 5b 70 61 74 .....m_ChildControlOverrides[pat
6960 68 4c 6f 77 65 72 43 61 73 65 5d 20 3d 20 65 78 69 73 74 69 6e 67 4f 76 65 72 72 69 64 65 73 3b hLowerCase].=.existingOverrides;
6980 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 ..........}............private.v
69a0 6f 69 64 20 41 64 64 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 49 66 4d 69 73 73 69 6e 67 28 49 6e 70 oid.AddChildControlIfMissing(Inp
69c0 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 6c 61 79 6f 75 74 2c 20 49 6e 74 65 72 6e 65 64 utControlLayout.layout,.Interned
69e0 53 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 70 61 String.variants,.InputControl.pa
6a00 72 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 62 6f 6f 6c 20 68 61 76 65 rent,..............ref.bool.have
6a20 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 ChildrenUsingStateFromOtherContr
6a40 6f 6c 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 ols,..............ref.InputContr
6a60 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d olLayout.ControlItem.controlItem
6a80 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f )..........{..............////TO
6aa0 44 4f 3a 20 73 75 70 70 6f 72 74 20 61 72 72 61 79 73 20 28 77 65 20 6d 61 79 20 6d 6f 64 69 66 DO:.support.arrays.(we.may.modif
6ac0 79 20 61 6e 20 65 6e 74 69 72 65 20 61 72 72 61 79 20 69 6e 20 62 75 6c 6b 29 0d 0a 0d 0a 20 20 y.an.entire.array.in.bulk)......
6ae0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 68 69 6c 64 20 63 6f 6e 74 ..........//.Find.the.child.cont
6b00 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 20 3d 20 49 6e rol...............var.child.=.In
6b20 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 46 69 6e 64 43 68 69 6c 64 28 70 61 72 65 putControlPath.TryFindChild(pare
6b40 6e 74 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 nt,.controlItem.name);..........
6b60 20 20 20 20 69 66 20 28 63 68 69 6c 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 ....if.(child.!=.null)..........
6b80 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f ........return;................/
6ba0 2f 20 57 65 27 72 65 20 61 64 64 69 6e 67 20 61 20 63 68 69 6c 64 20 73 6f 6d 65 77 68 65 72 65 /.We're.adding.a.child.somewhere
6bc0 20 69 6e 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 68 69 65 72 61 72 63 68 79 2e 20 54 68 69 73 .in.the.existing.hierarchy..This
6be0 20 69 73 20 61 20 74 72 69 63 6b 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 61 73 .is.a.tricky..............//.cas
6c00 65 20 61 73 20 77 65 20 68 61 76 65 20 74 6f 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 73 68 69 66 e.as.we.have.to.potentially.shif
6c20 74 20 69 6e 64 69 63 65 73 20 61 72 6f 75 6e 64 20 69 6e 20 74 68 65 20 68 69 65 72 61 72 63 68 t.indices.around.in.the.hierarch
6c40 79 20 74 6f 20 6d 61 6b 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 72 6f 6f 6d 20 66 y.to.make..............//.room.f
6c60 6f 72 20 74 68 65 20 6e 65 77 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 or.the.new.control..............
6c80 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 74 68 69 73 20 70 61 74 68 20 64 6f 65 73 20 6e 6f 74 20 ...////TODO:.this.path.does.not.
6ca0 73 75 70 70 6f 72 74 20 72 65 63 6f 76 65 72 69 6e 67 20 65 78 69 73 74 69 6e 67 20 63 6f 6e 74 support.recovering.existing.cont
6cc0 72 6f 6c 73 3f 20 64 6f 65 73 20 69 74 20 6d 61 74 74 65 72 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 rols?.does.it.matter?...........
6ce0 20 20 20 20 20 63 68 69 6c 64 20 3d 20 49 6e 73 65 72 74 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 28 .....child.=.InsertChildControl(
6d00 6c 61 79 6f 75 74 2c 20 76 61 72 69 61 6e 74 73 2c 20 70 61 72 65 6e 74 2c 0d 0a 20 20 20 20 20 layout,.variants,.parent,.......
6d20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 ...........ref.haveChildrenUsing
6d40 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 2c 20 72 65 66 20 63 6f 6e 74 StateFromOtherControls,.ref.cont
6d60 72 6f 6c 49 74 65 6d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 70 70 6c rolItem);................//.Appl
6d80 79 20 6c 61 79 6f 75 74 20 63 68 61 6e 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 y.layout.change...............if
6da0 20 28 21 52 65 66 65 72 65 6e 63 65 45 71 75 61 6c 73 28 63 68 69 6c 64 2e 70 61 72 65 6e 74 2c .(!ReferenceEquals(child.parent,
6dc0 20 70 61 72 65 6e 74 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 6f 6d 70 75 .parent))..................Compu
6de0 74 65 53 74 61 74 65 4c 61 79 6f 75 74 28 63 68 69 6c 64 2e 70 61 72 65 6e 74 29 3b 0d 0a 20 20 teStateLayout(child.parent);....
6e00 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 ......}............private.Input
6e20 43 6f 6e 74 72 6f 6c 20 49 6e 73 65 72 74 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 28 49 6e 70 75 74 Control.InsertChildControl(Input
6e40 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 6c 61 79 6f 75 74 2c 20 49 6e 74 65 72 6e 65 64 53 74 ControlLayout.layout,.InternedSt
6e60 72 69 6e 67 20 76 61 72 69 61 6e 74 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e ring.variant,.InputControl.paren
6e80 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 62 6f 6f 6c 20 68 61 76 65 43 68 69 t,..............ref.bool.haveChi
6ea0 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 73 ldrenUsingStateFromOtherControls
6ec0 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c ,..............ref.InputControlL
6ee0 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 0d 0a ayout.ControlItem.controlItem)..
6f00 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 20 ........{..............var.path.
6f20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 2e 54 6f 53 74 72 69 6e 67 28 29 3b 0d 0a =.controlItem.name.ToString();..
6f40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 77 65 20 6e 65 65 64 20 74 ..............//.First.we.need.t
6f60 6f 20 66 69 6e 64 20 74 68 65 20 69 6d 6d 65 64 69 61 74 65 20 70 61 72 65 6e 74 20 66 72 6f 6d o.find.the.immediate.parent.from
6f80 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 .the.given.path...............va
6fa0 72 20 69 6e 64 65 78 4f 66 53 6c 61 73 68 20 3d 20 70 61 74 68 2e 4c 61 73 74 49 6e 64 65 78 4f r.indexOfSlash.=.path.LastIndexO
6fc0 66 28 27 2f 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 4f 66 f('/');..............if.(indexOf
6fe0 53 6c 61 73 68 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 Slash.==.-1)..................th
7000 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f row.new.InvalidOperationExceptio
7020 6e 28 22 49 6e 73 65 72 74 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 20 68 61 73 20 74 6f 20 62 65 20 n("InsertChildControl.has.to.be.
7040 63 61 6c 6c 65 64 20 77 69 74 68 20 61 20 73 6c 61 73 68 2d 73 65 70 61 72 61 74 65 64 20 70 61 called.with.a.slash-separated.pa
7060 74 68 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 th");..............Debug.Assert(
7080 69 6e 64 65 78 4f 66 53 6c 61 73 68 20 21 3d 20 30 2c 20 22 43 6f 75 6c 64 20 6e 6f 74 20 66 69 indexOfSlash.!=.0,."Could.not.fi
70a0 6e 64 20 73 6c 61 73 68 20 69 6e 20 70 61 74 68 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nd.slash.in.path");.............
70c0 20 76 61 72 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 50 61 74 68 20 3d 20 70 61 74 68 2e .var.immediateParentPath.=.path.
70e0 53 75 62 73 74 72 69 6e 67 28 30 2c 20 69 6e 64 65 78 4f 66 53 6c 61 73 68 29 3b 0d 0a 20 20 20 Substring(0,.indexOfSlash);.....
7100 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 20 3d 20 49 .........var.immediateParent.=.I
7120 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 46 69 6e 64 43 68 69 6c 64 28 70 61 72 nputControlPath.TryFindChild(par
7140 65 6e 74 2c 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 50 61 74 68 29 3b 0d 0a 20 20 20 20 ent,.immediateParentPath);......
7160 20 20 20 20 20 20 20 20 69 66 20 28 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 20 3d 3d 20 6e ........if.(immediateParent.==.n
7180 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 ull)..................throw.new.
71a0 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 InvalidOperationException(......
71c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 66 69 6e 64 20 70 61 ................$"Cannot.find.pa
71e0 72 65 6e 74 20 27 7b 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 50 61 74 68 7d 27 20 6f 66 20 rent.'{immediateParentPath}'.of.
7200 63 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 7d 27 20 69 6e 20 control.'{controlItem.name}'.in.
7220 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 layout.'{layout.name}'");.......
7240 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4e 61 6d 65 20 3d 20 70 61 74 68 2e .........var.controlName.=.path.
7260 53 75 62 73 74 72 69 6e 67 28 69 6e 64 65 78 4f 66 53 6c 61 73 68 20 2b 20 31 29 3b 0d 0a 20 20 Substring(indexOfSlash.+.1);....
7280 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 4e 61 6d 65 2e 4c 65 6e 67 74 68 ..........if.(controlName.Length
72a0 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 .==.0)..................throw.ne
72c0 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 w.InvalidOperationException(....
72e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 50 61 74 68 20 63 61 6e 6e 6f 74 20 ..................$"Path.cannot.
7300 65 6e 64 20 69 6e 20 27 2f 27 20 28 63 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 49 74 65 end.in.'/'.(control.'{controlIte
7320 6d 2e 6e 61 6d 65 7d 27 20 69 6e 20 6c 61 79 6f 75 74 20 27 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 m.name}'.in.layout.'{layout.name
7340 7d 27 29 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 72 6f }')");................//.Make.ro
7360 6f 6d 20 69 6e 20 74 68 65 20 64 65 76 69 63 65 27 73 20 63 68 69 6c 64 20 61 72 72 61 79 2e 0d om.in.the.device's.child.array..
7380 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 53 74 61 72 74 49 6e 64 65 78 .............var.childStartIndex
73a0 20 3d 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 .=.immediateParent.m_ChildStartI
73c0 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 53 74 61 72 ndex;..............if.(childStar
73e0 74 49 6e 64 65 78 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 tIndex.==.default)..............
7400 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 63 68 69 6c {..................//.First.chil
7420 64 20 6f 66 20 70 61 72 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 d.of.parent...................ch
7440 69 6c 64 53 74 61 72 74 49 6e 64 65 78 20 3d 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 43 68 69 6c 64 ildStartIndex.=.m_Device.m_Child
7460 72 65 6e 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 2e 4c 65 6e 67 74 68 53 61 66 65 28 29 3b 0d renForEachControl.LengthSafe();.
7480 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 .................immediateParent
74a0 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 6e 64 65 78 20 3d 20 63 68 69 6c 64 53 74 61 72 74 49 .m_ChildStartIndex.=.childStartI
74c0 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ndex;..............}............
74e0 20 20 76 61 72 20 63 68 69 6c 64 49 6e 64 65 78 20 3d 20 63 68 69 6c 64 53 74 61 72 74 49 6e 64 ..var.childIndex.=.childStartInd
7500 65 78 20 2b 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 2e 6d 5f 43 68 69 6c 64 43 6f 75 6e ex.+.immediateParent.m_ChildCoun
7520 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 68 69 66 74 43 68 69 6c 64 49 6e 64 69 63 65 t;..............ShiftChildIndice
7540 73 49 6e 48 69 65 72 61 72 63 68 79 4f 6e 65 55 70 28 6d 5f 44 65 76 69 63 65 2c 20 63 68 69 6c sInHierarchyOneUp(m_Device,.chil
7560 64 49 6e 64 65 78 2c 20 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 29 3b 0d 0a 20 20 20 20 20 dIndex,.immediateParent);.......
7580 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 73 65 72 74 41 74 28 72 65 66 .......ArrayHelpers.InsertAt(ref
75a0 20 6d 5f 44 65 76 69 63 65 2e 6d 5f 43 68 69 6c 64 72 65 6e 46 6f 72 45 61 63 68 43 6f 6e 74 72 .m_Device.m_ChildrenForEachContr
75c0 6f 6c 2c 20 63 68 69 6c 64 49 6e 64 65 78 2c 20 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 ol,.childIndex,.null);..........
75e0 20 20 20 20 2b 2b 69 6d 6d 65 64 69 61 74 65 50 61 72 65 6e 74 2e 6d 5f 43 68 69 6c 64 43 6f 75 ....++immediateParent.m_ChildCou
7600 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 73 65 72 74 20 74 68 65 nt;................//.Insert.the
7620 20 63 68 69 6c 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 54 68 .child...............//.NOTE:.Th
7640 69 73 20 6d 61 79 20 2a 61 64 64 20 73 65 76 65 72 61 6c 2a 20 63 6f 6e 74 72 6f 6c 73 20 64 65 is.may.*add.several*.controls.de
7660 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 6c 61 79 6f 75 74 20 6f 66 20 74 68 65 20 63 6f 6e pending.on.the.layout.of.the.con
7680 74 72 6f 6c 20 77 65 20 61 72 65 20 69 6e 73 65 72 74 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 trol.we.are.inserting...........
76a0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 54 68 65 20 63 68 69 6c 64 72 65 6e 20 77 69 6c 6c 20 62 ....//.......The.children.will.b
76c0 65 20 61 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65 20 63 68 69 6c 64 20 61 72 72 61 79 2e 0d 0a e.appended.to.the.child.array...
76e0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 41 64 64 43 68 69 ............var.control.=.AddChi
7700 6c 64 43 6f 6e 74 72 6f 6c 28 6c 61 79 6f 75 74 2c 20 76 61 72 69 61 6e 74 2c 20 69 6d 6d 65 64 ldControl(layout,.variant,.immed
7720 69 61 74 65 50 61 72 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 iateParent,..................ref
7740 20 68 61 76 65 43 68 69 6c 64 72 65 6e 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 .haveChildrenUsingStateFromOther
7760 43 6f 6e 74 72 6f 6c 73 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2c 20 63 68 69 6c 64 49 6e 64 65 Controls,.controlItem,.childInde
7780 78 2c 20 63 6f 6e 74 72 6f 6c 4e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 x,.controlName);................
77a0 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 return.control;..........}......
77c0 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 41 70 70 6c 79 55 ......private.static.void.ApplyU
77e0 73 65 53 74 61 74 65 46 72 6f 6d 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 2c seStateFrom(InputControl.parent,
7800 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 .ref.InputControlLayout.ControlI
7820 74 65 6d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 tem.controlItem,.InputControlLay
7840 6f 75 74 20 6c 61 79 6f 75 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 out.layout)..........{..........
7860 20 20 20 20 76 61 72 20 63 68 69 6c 64 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 ....var.child.=.InputControlPath
7880 2e 54 72 79 46 69 6e 64 43 68 69 6c 64 28 70 61 72 65 6e 74 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 .TryFindChild(parent,.controlIte
78a0 6d 2e 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 m.name);..............Debug.Asse
78c0 72 74 28 63 68 69 6c 64 20 21 3d 20 6e 75 6c 6c 2c 20 22 43 6f 75 6c 64 20 6e 6f 74 20 66 69 6e rt(child.!=.null,."Could.not.fin
78e0 64 20 63 68 69 6c 64 20 63 6f 6e 74 72 6f 6c 20 77 68 69 63 68 20 73 68 6f 75 6c 64 20 62 65 20 d.child.control.which.should.be.
7900 70 72 65 73 65 6e 74 20 61 74 20 74 68 69 73 20 70 6f 69 6e 74 22 29 3b 0d 0a 0d 0a 20 20 20 20 present.at.this.point");........
7920 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 64 20 63 ........//.Find.the.referenced.c
7940 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 66 65 72 65 6e ontrol...............var.referen
7960 63 65 64 43 6f 6e 74 72 6f 6c 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 cedControl.=.InputControlPath.Tr
7980 79 46 69 6e 64 43 68 69 6c 64 28 70 61 72 65 6e 74 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 75 yFindChild(parent,.controlItem.u
79a0 73 65 53 74 61 74 65 46 72 6f 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 seStateFrom);..............if.(r
79c0 65 66 65 72 65 6e 63 65 64 43 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 eferencedControl.==.null).......
79e0 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 ...........throw.new.InvalidOper
7a00 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ationException(.................
7a20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 66 69 6e 64 20 63 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e .....$"Cannot.find.control.'{con
7a40 74 72 6f 6c 49 74 65 6d 2e 75 73 65 53 74 61 74 65 46 72 6f 6d 7d 27 20 72 65 66 65 72 65 6e 63 trolItem.useStateFrom}'.referenc
7a60 65 64 20 69 6e 20 27 75 73 65 53 74 61 74 65 46 72 6f 6d 27 20 6f 66 20 63 6f 6e 74 72 6f 6c 20 ed.in.'useStateFrom'.of.control.
7a80 27 7b 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 7d 27 20 69 6e 20 6c 61 79 6f 75 74 20 27 '{controlItem.name}'.in.layout.'
7aa0 7b 6c 61 79 6f 75 74 2e 6e 61 6d 65 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 {layout.name}'");...............
7ac0 20 2f 2f 20 43 6f 70 79 20 69 74 73 20 73 74 61 74 65 20 73 65 74 74 69 6e 67 73 2e 0d 0a 20 20 .//.Copy.its.state.settings.....
7ae0 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 20 3d 20 72 ..........child.m_StateBlock.=.r
7b00 65 66 65 72 65 6e 63 65 64 43 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 3b 0d 0a eferencedControl.m_StateBlock;..
7b20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 74 20 74 68 69 73 20 70 6f 69 6e 74 2c 20 ..............//.At.this.point,.
7b40 61 6c 6c 20 62 79 74 65 4f 66 66 73 65 74 73 20 61 72 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 all.byteOffsets.are.relative.to.
7b60 70 61 72 65 6e 74 73 20 73 6f 20 77 65 20 6e 65 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 20 parents.so.we.need.to...........
7b80 20 20 20 2f 2f 20 77 61 6c 6b 20 75 70 20 74 68 65 20 72 65 66 65 72 65 6e 63 65 64 20 63 6f 6e ...//.walk.up.the.referenced.con
7ba0 74 72 6f 6c 27 73 20 70 61 72 65 6e 74 20 63 68 61 69 6e 20 61 6e 64 20 61 64 64 20 6f 66 66 73 trol's.parent.chain.and.add.offs
7bc0 65 74 73 20 75 6e 74 69 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 65 20 61 72 65 ets.until..............//.we.are
7be0 20 61 74 20 74 68 65 20 73 61 6d 65 20 6c 65 76 65 6c 20 74 68 61 74 20 77 65 20 61 72 65 20 61 .at.the.same.level.that.we.are.a
7c00 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 2e 70 61 72 65 6e 74 t...............if.(child.parent
7c20 20 21 3d 20 72 65 66 65 72 65 6e 63 65 64 43 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 29 0d 0a 20 .!=.referencedControl.parent)...
7c40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 70 61 72 65 6e 74 49 6e ...............for.(var.parentIn
7c60 43 68 61 69 6e 20 3d 20 72 65 66 65 72 65 6e 63 65 64 43 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 Chain.=.referencedControl.parent
7c80 3b 20 70 61 72 65 6e 74 49 6e 43 68 61 69 6e 20 21 3d 20 70 61 72 65 6e 74 3b 20 70 61 72 65 6e ;.parentInChain.!=.parent;.paren
7ca0 74 49 6e 43 68 61 69 6e 20 3d 20 70 61 72 65 6e 74 49 6e 43 68 61 69 6e 2e 70 61 72 65 6e 74 29 tInChain.=.parentInChain.parent)
7cc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 ......................child.m_St
7ce0 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 2b 3d 20 70 61 72 65 6e 74 49 6e 43 ateBlock.byteOffset.+=.parentInC
7d00 68 61 69 6e 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 3b 0d 0a 20 hain.m_StateBlock.byteOffset;...
7d20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 .......}............private.stat
7d40 69 63 20 76 6f 69 64 20 53 68 69 66 74 43 68 69 6c 64 49 6e 64 69 63 65 73 49 6e 48 69 65 72 61 ic.void.ShiftChildIndicesInHiera
7d60 72 63 68 79 4f 6e 65 55 70 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 69 6e rchyOneUp(InputDevice.device,.in
7d80 74 20 73 74 61 72 74 49 6e 64 65 78 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 65 78 63 65 70 t.startIndex,.InputControl.excep
7da0 74 43 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 tControl)..........{............
7dc0 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 64 65 76 69 63 65 2e 6d 5f 43 68 69 6c 64 72 ..var.controls.=.device.m_Childr
7de0 65 6e 46 6f 72 45 61 63 68 43 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 enForEachControl;..............v
7e00 61 72 20 63 6f 75 6e 74 20 3d 20 63 6f 6e 74 72 6f 6c 73 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 ar.count.=.controls.Length;.....
7e20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 75 .........for.(var.i.=.0;.i.<.cou
7e40 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 nt;.++i)..............{.........
7e60 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 63 6f 6e 74 72 6f 6c 73 5b .........var.control.=.controls[
7e80 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c i];..................if.(control
7ea0 20 21 3d 20 6e 75 6c 6c 20 26 26 20 63 6f 6e 74 72 6f 6c 20 21 3d 20 65 78 63 65 70 74 43 6f 6e .!=.null.&&.control.!=.exceptCon
7ec0 74 72 6f 6c 20 26 26 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 6e 64 65 trol.&&.control.m_ChildStartInde
7ee0 78 20 3e 3d 20 73 74 61 72 74 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 x.>=.startIndex)................
7f00 20 20 20 20 20 20 2b 2b 63 6f 6e 74 72 6f 6c 2e 6d 5f 43 68 69 6c 64 53 74 61 72 74 49 6e 64 65 ......++control.m_ChildStartInde
7f20 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a x;..............}..........}....
7f40 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 57 65 20 63 61 6e 20 6f 6e 6c 79 20 64 6f 20 ........//.NOTE:.We.can.only.do.
7f60 74 68 69 73 20 6f 6e 63 65 20 77 65 27 76 65 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 74 68 65 20 this.once.we've.initialized.the.
7f80 6e 61 6d 65 73 20 6f 6e 20 74 68 65 20 70 61 72 65 6e 74 20 63 6f 6e 74 72 6f 6c 2e 20 49 2e 65 names.on.the.parent.control..I.e
7fa0 2e 20 69 74 20 68 61 73 20 74 6f 20 62 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ..it.has.to.be..........//......
7fc0 20 64 6f 6e 65 20 69 6e 20 74 68 65 20 73 65 63 6f 6e 64 20 70 61 73 73 20 77 65 20 64 6f 20 6f .done.in.the.second.pass.we.do.o
7fe0 76 65 72 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 20 20 20 20 ver.the.control.hierarchy.......
8000 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 53 65 74 44 69 73 70 6c 61 79 4e 61 6d 65 28 ....private.void.SetDisplayName(
8020 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 6c 6f 6e InputControl.control,.string.lon
8040 67 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 2c 20 73 74 72 69 6e 67 20 73 gDisplayNameFromLayout,.string.s
8060 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 2c 20 62 6f 6f 6c 20 hortDisplayNameFromLayout,.bool.
8080 73 68 6f 72 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 shortName)..........{...........
80a0 20 20 20 76 61 72 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 73 ...var.displayNameFromLayout.=.s
80c0 68 6f 72 74 4e 61 6d 65 20 3f 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c hortName.?.shortDisplayNameFromL
80e0 61 79 6f 75 74 20 3a 20 6c 6f 6e 67 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 ayout.:.longDisplayNameFromLayou
8100 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 44 69 73 70 6c 61 79 20 6e 61 6d t;................//.Display.nam
8120 65 20 6d 61 79 20 6e 6f 74 20 62 65 20 73 65 74 20 69 6e 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 e.may.not.be.set.in.layout......
8140 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 .........if.(string.IsNullOrEmpt
8160 79 28 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 29 29 0d 0a 20 20 20 20 20 y(displayNameFromLayout)).......
8180 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 6f 72 .......{..................//.For
81a0 20 73 68 6f 72 74 20 6e 61 6d 65 73 2c 20 77 65 20 6c 65 61 76 65 20 69 74 20 75 6e 61 73 73 69 .short.names,.we.leave.it.unassi
81c0 67 6e 65 64 20 69 66 20 74 68 65 72 65 27 73 20 6e 6f 74 68 69 6e 67 20 69 6e 20 74 68 65 20 6c gned.if.there's.nothing.in.the.l
81e0 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 65 78 63 65 70 74 ayout..................//.except
8200 20 69 66 20 69 74 27 73 20 61 20 6e 65 73 74 65 64 20 63 6f 6e 74 72 6f 6c 20 77 68 65 72 65 20 .if.it's.a.nested.control.where.
8220 74 68 65 20 70 61 72 65 6e 74 20 68 61 73 20 61 20 73 68 6f 72 74 20 6e 61 6d 65 2e 0d 0a 20 20 the.parent.has.a.short.name.....
8240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 6f 72 74 4e 61 6d 65 29 0d 0a 20 20 ..............if.(shortName)....
8260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
8280 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 .....if.(control.parent.!=.null.
82a0 26 26 20 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 20 21 3d 20 63 6f 6e 74 72 6f 6c 2e 64 65 76 &&.control.parent.!=.control.dev
82c0 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ice)......................{.....
82e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 74 72 69 6e .....................if.(m_Strin
8300 67 42 75 69 6c 64 65 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 gBuilder.==.null)...............
8320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 20 3d ...............m_StringBuilder.=
8340 20 6e 65 77 20 53 74 72 69 6e 67 42 75 69 6c 64 65 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 .new.StringBuilder();...........
8360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 4c ...............m_StringBuilder.L
8380 65 6e 67 74 68 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ength.=.0;......................
83a0 20 20 20 20 41 64 64 50 61 72 65 6e 74 44 69 73 70 6c 61 79 4e 61 6d 65 52 65 63 75 72 73 69 76 ....AddParentDisplayNameRecursiv
83c0 65 28 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 2c 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 e(control.parent,.m_StringBuilde
83e0 72 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r,.true);.......................
8400 20 20 20 69 66 20 28 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 4c 65 6e 67 74 68 20 3d 3d ...if.(m_StringBuilder.Length.==
8420 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a .0)..........................{..
8440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 ............................cont
8460 72 6f 6c 2e 6d 5f 53 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 rol.m_ShortDisplayNameFromLayout
8480 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.null;........................
84a0 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......return;...................
84c0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .......}........................
84e0 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6c 6f ....if.(!string.IsNullOrEmpty(lo
8500 6e 67 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 29 29 0d 0a 20 20 20 20 20 ngDisplayNameFromLayout)).......
8520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 42 .......................m_StringB
8540 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 6c 6f 6e 67 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f uilder.Append(longDisplayNameFro
8560 6d 4c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 mLayout);.......................
8580 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...else.........................
85a0 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 63 6f 6e 74 .....m_StringBuilder.Append(cont
85c0 72 6f 6c 2e 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rol.name);......................
85e0 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 ....control.m_ShortDisplayNameFr
8600 6f 6d 4c 61 79 6f 75 74 20 3d 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 54 6f 53 74 72 omLayout.=.m_StringBuilder.ToStr
8620 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ing();..........................
8640 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a return;......................}..
8660 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f ......................control.m_
8680 53 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 6e 75 6c ShortDisplayNameFromLayout.=.nul
86a0 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d l;......................return;.
86c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .................}..............
86e0 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 ......////REVIEW:.automatically.
8700 75 70 70 65 72 63 61 73 65 20 6f 72 20 70 72 65 74 74 69 66 79 20 74 68 69 73 3f 0d 0a 20 20 20 uppercase.or.prettify.this?.....
8720 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 6f 72 20 6c 6f 6e 67 20 6e 61 6d 65 73 2c 20 .............//.For.long.names,.
8740 77 65 20 64 65 66 61 75 6c 74 20 74 6f 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 6e 61 6d 65 we.default.to.the.control's.name
8760 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 ...................displayNameFr
8780 6f 6d 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 72 6f 6c 2e 6e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 omLayout.=.control.name;........
87a0 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 27 ......}................//.If.it'
87c0 73 20 61 20 6e 65 73 74 65 64 20 63 6f 6e 74 72 6f 6c 2c 20 73 79 6e 74 68 65 73 69 7a 65 20 61 s.a.nested.control,.synthesize.a
87e0 20 70 61 74 68 20 74 68 61 74 20 69 6e 63 6c 75 64 65 73 20 70 61 72 65 6e 74 73 2e 0d 0a 20 20 .path.that.includes.parents.....
8800 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 20 21 3d 20 ..........if.(control.parent.!=.
8820 6e 75 6c 6c 20 26 26 20 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 20 21 3d 20 63 6f 6e 74 72 6f null.&&.control.parent.!=.contro
8840 6c 2e 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 l.device)..............{........
8860 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 20 3d 3d ..........if.(m_StringBuilder.==
8880 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 .null)......................m_St
88a0 72 69 6e 67 42 75 69 6c 64 65 72 20 3d 20 6e 65 77 20 53 74 72 69 6e 67 42 75 69 6c 64 65 72 28 ringBuilder.=.new.StringBuilder(
88c0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c );..................m_StringBuil
88e0 64 65 72 2e 4c 65 6e 67 74 68 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 der.Length.=.0;.................
8900 20 41 64 64 50 61 72 65 6e 74 44 69 73 70 6c 61 79 4e 61 6d 65 52 65 63 75 72 73 69 76 65 28 63 .AddParentDisplayNameRecursive(c
8920 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 2c 20 6d 5f 53 74 72 69 6e 67 42 75 69 6c 64 65 72 2c 20 ontrol.parent,.m_StringBuilder,.
8940 73 68 6f 72 74 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 shortName);..................m_S
8960 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 64 69 73 70 6c 61 79 4e 61 6d 65 46 tringBuilder.Append(displayNameF
8980 72 6f 6d 4c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 romLayout);..................dis
89a0 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 6d 5f 53 74 72 69 6e 67 42 75 69 playNameFromLayout.=.m_StringBui
89c0 6c 64 65 72 2e 54 6f 53 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d lder.ToString();..............}.
89e0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 73 73 69 67 6e 2e 0d 0a 20 20 20 20 20 ...............//.Assign........
8a00 20 20 20 20 20 20 20 69 66 20 28 73 68 6f 72 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 20 .......if.(shortName)...........
8a20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d .......control.m_ShortDisplayNam
8a40 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 eFromLayout.=.displayNameFromLay
8a60 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 out;..............else..........
8a80 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f ........control.m_DisplayNameFro
8aa0 6d 4c 61 79 6f 75 74 20 3d 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 3b mLayout.=.displayNameFromLayout;
8ac0 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 ..........}............private.s
8ae0 74 61 74 69 63 20 76 6f 69 64 20 41 64 64 50 61 72 65 6e 74 44 69 73 70 6c 61 79 4e 61 6d 65 52 tatic.void.AddParentDisplayNameR
8b00 65 63 75 72 73 69 76 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 53 ecursive(InputControl.control,.S
8b20 74 72 69 6e 67 42 75 69 6c 64 65 72 20 73 74 72 69 6e 67 42 75 69 6c 64 65 72 2c 0d 0a 20 20 20 tringBuilder.stringBuilder,.....
8b40 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 73 68 6f 72 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 .........bool.shortName)........
8b60 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 70 61 72 ..{..............if.(control.par
8b80 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 20 21 3d ent.!=.null.&&.control.parent.!=
8ba0 20 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .control.device)................
8bc0 20 20 41 64 64 50 61 72 65 6e 74 44 69 73 70 6c 61 79 4e 61 6d 65 52 65 63 75 72 73 69 76 65 28 ..AddParentDisplayNameRecursive(
8be0 63 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 2c 20 73 74 72 69 6e 67 42 75 69 6c 64 65 72 2c 20 73 control.parent,.stringBuilder,.s
8c00 68 6f 72 74 4e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 hortName);................if.(sh
8c20 6f 72 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ortName)..............{.........
8c40 20 20 20 20 20 20 20 20 20 76 61 72 20 74 65 78 74 20 3d 20 63 6f 6e 74 72 6f 6c 2e 73 68 6f 72 .........var.text.=.control.shor
8c60 74 44 69 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 tDisplayName;..................i
8c80 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 74 65 78 74 29 29 0d 0a f.(string.IsNullOrEmpty(text))..
8ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 65 78 74 20 3d 20 63 6f 6e 74 72 ....................text.=.contr
8cc0 6f 6c 2e 64 69 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ol.displayName;.................
8ce0 20 20 20 73 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 74 65 78 74 29 3b 0d 0a ...stringBuilder.Append(text);..
8d00 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d ............}..............else.
8d20 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
8d40 73 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 63 6f 6e 74 72 6f 6c 2e 64 69 73 stringBuilder.Append(control.dis
8d60 70 6c 61 79 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 playName);..............}.......
8d80 20 20 20 20 20 20 20 73 74 72 69 6e 67 42 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 27 20 27 29 .......stringBuilder.Append('.')
8da0 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 ;..........}............private.
8dc0 73 74 61 74 69 63 20 76 6f 69 64 20 41 64 64 50 72 6f 63 65 73 73 6f 72 73 28 49 6e 70 75 74 43 static.void.AddProcessors(InputC
8de0 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c ontrol.control,.ref.InputControl
8e00 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2c 20 Layout.ControlItem.controlItem,.
8e20 73 74 72 69 6e 67 20 6c 61 79 6f 75 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 string.layoutName)..........{...
8e40 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 72 6f 63 65 73 73 6f 72 43 6f 75 6e 74 20 3d 20 ...........var.processorCount.=.
8e60 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 70 72 6f 63 65 73 73 6f 72 73 2e 43 6f 75 6e 74 3b 0d 0a 20 controlItem.processors.Count;...
8e80 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 6e 20 3d 20 30 3b 20 6e 20 3c 20 70 ...........for.(var.n.=.0;.n.<.p
8ea0 72 6f 63 65 73 73 6f 72 43 6f 75 6e 74 3b 20 2b 2b 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 rocessorCount;.++n).............
8ec0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 61 6d 65 20 3d 20 63 .{..................var.name.=.c
8ee0 6f 6e 74 72 6f 6c 49 74 65 6d 2e 70 72 6f 63 65 73 73 6f 72 73 5b 6e 5d 2e 6e 61 6d 65 3b 0d 0a ontrolItem.processors[n].name;..
8f00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 74 79 70 65 20 3d 20 49 6e 70 75 74 ................var.type.=.Input
8f20 50 72 6f 63 65 73 73 6f 72 2e 73 5f 50 72 6f 63 65 73 73 6f 72 73 2e 4c 6f 6f 6b 75 70 54 79 70 Processor.s_Processors.LookupTyp
8f40 65 52 65 67 69 73 74 72 61 74 69 6f 6e 28 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 eRegistration(name);............
8f60 20 20 20 20 20 20 69 66 20 28 74 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ......if.(type.==.null).........
8f80 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 .............throw.new.InvalidOp
8fa0 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 erationException(...............
8fc0 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 66 69 6e 64 20 70 72 6f 63 65 73 73 ...........$"Cannot.find.process
8fe0 6f 72 20 27 7b 6e 61 6d 65 7d 27 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 63 6f 6e 74 72 6f or.'{name}'.referenced.by.contro
9000 6c 20 27 7b 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6e 61 6d 65 7d 27 20 69 6e 20 6c 61 79 6f 75 74 l.'{controlItem.name}'.in.layout
9020 20 27 7b 6c 61 79 6f 75 74 4e 61 6d 65 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .'{layoutName}'");..............
9040 20 20 20 20 20 20 76 61 72 20 70 72 6f 63 65 73 73 6f 72 20 3d 20 41 63 74 69 76 61 74 6f 72 2e ......var.processor.=.Activator.
9060 43 72 65 61 74 65 49 6e 73 74 61 6e 63 65 28 74 79 70 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 CreateInstance(type);...........
9080 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 61 6d 65 74 65 72 73 20 3d 20 63 6f 6e 74 72 6f .........var.parameters.=.contro
90a0 6c 49 74 65 6d 2e 70 72 6f 63 65 73 73 6f 72 73 5b 6e 5d 2e 70 61 72 61 6d 65 74 65 72 73 3b 0d lItem.processors[n].parameters;.
90c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 61 6d 65 74 65 72 73 2e .................if.(parameters.
90e0 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Count.>.0)......................
9100 4e 61 6d 65 64 56 61 6c 75 65 2e 41 70 70 6c 79 41 6c 6c 54 6f 4f 62 6a 65 63 74 28 70 72 6f 63 NamedValue.ApplyAllToObject(proc
9120 65 73 73 6f 72 2c 20 70 61 72 61 6d 65 74 65 72 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 essor,.parameters);.............
9140 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 41 64 64 50 72 6f 63 65 73 73 6f 72 28 70 72 6f 63 .......control.AddProcessor(proc
9160 65 73 73 6f 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 essor);..............}..........
9180 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 }............private.static.void
91a0 20 53 65 74 46 6f 72 6d 61 74 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c .SetFormat(InputControl.control,
91c0 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 20 .InputControlLayout.ControlItem.
91e0 63 6f 6e 74 72 6f 6c 49 74 65 6d 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 controlItem)..........{.........
9200 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 .....control.m_StateBlock.format
9220 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 66 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 .=.controlItem.format;..........
9240 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d ....if.(controlItem.sizeInBits.=
9260 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 =.0)..............{.............
9280 20 20 20 20 20 76 61 72 20 70 72 69 6d 69 74 69 76 65 46 6f 72 6d 61 74 53 69 7a 65 20 3d 20 49 .....var.primitiveFormatSize.=.I
92a0 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 47 65 74 53 69 7a 65 4f 66 50 72 69 6d 69 74 69 76 nputStateBlock.GetSizeOfPrimitiv
92c0 65 46 6f 72 6d 61 74 49 6e 42 69 74 73 28 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 66 6f 72 6d 61 74 eFormatInBits(controlItem.format
92e0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 72 69 6d 69 74 69 76 );..................if.(primitiv
9300 65 46 6f 72 6d 61 74 53 69 7a 65 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 eFormatSize.!=.-1)..............
9320 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a ........control.m_StateBlock.siz
9340 65 49 6e 42 69 74 73 20 3d 20 28 75 69 6e 74 29 70 72 69 6d 69 74 69 76 65 46 6f 72 6d 61 74 53 eInBits.=.(uint)primitiveFormatS
9360 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ize;..............}..........}..
9380 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 ..........private.InputControlLa
93a0 79 6f 75 74 20 46 69 6e 64 4f 72 4c 6f 61 64 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 6e 61 6d yout.FindOrLoadLayout(string.nam
93c0 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 e)..........{..............Debug
93e0 2e 41 73 73 65 72 74 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 73 5f 43 61 63 .Assert(InputControlLayout.s_Cac
9400 68 65 49 6e 73 74 61 6e 63 65 52 65 66 20 3e 20 30 2c 20 22 53 68 6f 75 6c 64 20 68 61 76 65 20 heInstanceRef.>.0,."Should.have.
9420 61 63 71 75 69 72 65 64 20 6c 61 79 6f 75 74 20 63 61 63 68 65 20 72 65 66 65 72 65 6e 63 65 22 acquired.layout.cache.reference"
9440 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 49 6e 70 75 74 43 6f 6e 74 );..............return.InputCont
9460 72 6f 6c 4c 61 79 6f 75 74 2e 63 61 63 68 65 2e 46 69 6e 64 4f 72 4c 6f 61 64 4c 61 79 6f 75 74 rolLayout.cache.FindOrLoadLayout
9480 28 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 (name);..........}............pr
94a0 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 43 6f 6d 70 75 74 65 53 74 61 74 65 4c 61 ivate.static.void.ComputeStateLa
94c0 79 6f 75 74 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 yout(InputControl.control)......
94e0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 72 65 6e 20 ....{..............var.children.
9500 3d 20 63 6f 6e 74 72 6f 6c 2e 63 68 69 6c 64 72 65 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 =.control.children;.............
9520 20 20 20 2f 2f 20 49 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 68 61 73 20 61 20 66 6f 72 6d 61 ...//.If.the.control.has.a.forma
9540 74 20 62 75 74 20 6e 6f 20 73 69 7a 65 20 73 70 65 63 69 66 69 65 64 20 61 6e 64 20 74 68 65 20 t.but.no.size.specified.and.the.
9560 66 6f 72 6d 61 74 20 69 73 20 61 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 70 72 69 6d format.is.a..............//.prim
9580 69 74 69 76 65 20 66 6f 72 6d 61 74 2c 20 6a 75 73 74 20 73 65 74 20 74 68 65 20 73 69 7a 65 20 itive.format,.just.set.the.size.
95a0 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 automatically...............if.(
95c0 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 control.m_StateBlock.sizeInBits.
95e0 3d 3d 20 30 20 26 26 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 ==.0.&&.control.m_StateBlock.for
9600 6d 61 74 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 mat.!=.0)..............{........
9620 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 69 7a 65 49 6e 42 69 74 73 20 3d 20 49 6e 70 75 74 ..........var.sizeInBits.=.Input
9640 53 74 61 74 65 42 6c 6f 63 6b 2e 47 65 74 53 69 7a 65 4f 66 50 72 69 6d 69 74 69 76 65 46 6f 72 StateBlock.GetSizeOfPrimitiveFor
9660 6d 61 74 49 6e 42 69 74 73 28 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 66 matInBits(control.m_StateBlock.f
9680 6f 72 6d 61 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 69 7a ormat);..................if.(siz
96a0 65 49 6e 42 69 74 73 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eInBits.!=.-1)..................
96c0 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 ....control.m_StateBlock.sizeInB
96e0 69 74 73 20 3d 20 28 75 69 6e 74 29 73 69 7a 65 49 6e 42 69 74 73 3b 0d 0a 20 20 20 20 20 20 20 its.=.(uint)sizeInBits;.........
9700 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 73 74 61 74 .....}................//.If.stat
9720 65 20 73 69 7a 65 20 69 73 20 6e 6f 74 20 73 65 74 2c 20 69 74 20 6d 65 61 6e 73 20 69 74 27 73 e.size.is.not.set,.it.means.it's
9740 20 63 6f 6d 70 75 74 65 64 20 66 72 6f 6d 20 74 68 65 20 73 69 7a 65 20 6f 66 20 74 68 65 0d 0a .computed.from.the.size.of.the..
9760 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 68 69 6c 64 72 65 6e 20 73 6f 20 6d 61 6b 65 20 ............//.children.so.make.
9780 73 75 72 65 20 77 65 20 61 63 74 75 61 6c 6c 79 20 68 61 76 65 20 63 68 69 6c 64 72 65 6e 2e 0d sure.we.actually.have.children..
97a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 .............if.(control.m_State
97c0 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d 3d 20 30 20 26 26 20 63 68 69 6c 64 72 65 Block.sizeInBits.==.0.&&.childre
97e0 6e 2e 43 6f 75 6e 74 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 n.Count.==.0)..............{....
9800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f ..............throw.new.InvalidO
9820 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 perationException(..............
9840 20 20 20 20 20 20 20 20 24 22 43 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 2e 70 61 74 68 ........$"Control.'{control.path
9860 7d 27 20 77 69 74 68 20 6c 61 79 6f 75 74 20 27 7b 63 6f 6e 74 72 6f 6c 2e 6c 61 79 6f 75 74 7d }'.with.layout.'{control.layout}
9880 27 20 68 61 73 20 6e 6f 20 73 69 7a 65 20 73 65 74 20 61 6e 64 20 68 61 73 20 6e 6f 20 63 68 69 '.has.no.size.set.and.has.no.chi
98a0 6c 64 72 65 6e 20 74 6f 20 63 6f 6d 70 75 74 65 20 73 69 7a 65 20 66 72 6f 6d 22 29 3b 0d 0a 20 ldren.to.compute.size.from");...
98c0 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 ...........}................//.I
98e0 66 20 74 68 65 72 65 27 73 20 6e 6f 20 63 68 69 6c 64 72 65 6e 2c 20 6f 75 72 20 6a 6f 62 20 69 f.there's.no.children,.our.job.i
9900 73 20 64 6f 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 72 65 s.done...............if.(childre
9920 6e 2e 43 6f 75 6e 74 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 n.Count.==.0)..................r
9940 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 64 eturn;................//.First.d
9960 65 61 6c 20 77 69 74 68 20 63 68 69 6c 64 72 65 6e 20 74 68 61 74 20 77 61 6e 74 20 66 69 78 65 eal.with.children.that.want.fixe
9980 64 20 6f 66 66 73 65 74 73 2e 20 41 6c 6c 20 74 68 65 20 6f 74 68 65 72 20 6f 6e 65 73 0d 0a 20 d.offsets..All.the.other.ones...
99a0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 69 6c 6c 20 67 65 74 20 61 70 70 65 6e 64 65 64 20 ...........//.will.get.appended.
99c0 74 6f 20 74 68 65 20 65 6e 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 66 69 72 to.the.end...............var.fir
99e0 73 74 55 6e 66 69 78 65 64 42 79 74 65 4f 66 66 73 65 74 20 3d 20 30 75 3b 0d 0a 20 20 20 20 20 stUnfixedByteOffset.=.0u;.......
9a00 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 68 69 6c 64 20 69 6e 20 63 68 69 .......foreach.(var.child.in.chi
9a20 6c 64 72 65 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ldren)..............{...........
9a40 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 .......Debug.Assert(child.m_Stat
9a60 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 21 3d 20 30 2c 20 22 53 69 7a 65 20 6f 66 eBlock.sizeInBits.!=.0,."Size.of
9a80 20 73 74 61 74 65 20 62 6c 6f 63 6b 20 6e 6f 74 20 73 65 74 20 6f 6e 20 63 68 69 6c 64 22 29 3b .state.block.not.set.on.child");
9aa0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 63 68 69 6c ....................//.Skip.chil
9ac0 64 72 65 6e 20 75 73 69 6e 67 20 73 74 61 74 65 20 66 72 6f 6d 20 6f 74 68 65 72 20 63 6f 6e 74 dren.using.state.from.other.cont
9ae0 72 6f 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 rols...................if.(child
9b00 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d 3d 20 6b 53 69 7a .m_StateBlock.sizeInBits.==.kSiz
9b20 65 46 6f 72 43 6f 6e 74 72 6f 6c 55 73 69 6e 67 53 74 61 74 65 46 72 6f 6d 4f 74 68 65 72 43 6f eForControlUsingStateFromOtherCo
9b40 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 ntrol)......................cont
9b60 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 inue;....................//.Make
9b80 20 73 75 72 65 20 74 68 65 20 63 68 69 6c 64 20 68 61 73 20 61 20 76 61 6c 69 64 20 73 69 7a 65 .sure.the.child.has.a.valid.size
9ba0 20 73 65 74 20 6f 6e 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 .set.on.it...................var
9bc0 20 63 68 69 6c 64 53 69 7a 65 49 6e 42 69 74 73 20 3d 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 .childSizeInBits.=.child.m_State
9be0 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 Block.sizeInBits;...............
9c00 20 20 20 69 66 20 28 63 68 69 6c 64 53 69 7a 65 49 6e 42 69 74 73 20 3d 3d 20 30 20 7c 7c 20 63 ...if.(childSizeInBits.==.0.||.c
9c20 68 69 6c 64 53 69 7a 65 49 6e 42 69 74 73 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 hildSizeInBits.==.InputStateBloc
9c40 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 k.InvalidOffset)................
9c60 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e ......throw.new.InvalidOperation
9c80 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Exception(......................
9ca0 20 20 20 20 24 22 43 68 69 6c 64 20 27 7b 63 68 69 6c 64 2e 6e 61 6d 65 7d 27 20 6f 66 20 27 7b ....$"Child.'{child.name}'.of.'{
9cc0 63 6f 6e 74 72 6f 6c 2e 6e 61 6d 65 7d 27 20 68 61 73 20 6e 6f 20 73 69 7a 65 20 73 65 74 21 22 control.name}'.has.no.size.set!"
9ce0 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 63 68 );....................//.Skip.ch
9d00 69 6c 64 72 65 6e 20 74 68 61 74 20 64 6f 6e 27 74 20 68 61 76 65 20 66 69 78 65 64 20 6f 66 66 ildren.that.don't.have.fixed.off
9d20 73 65 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 sets...................if.(child
9d40 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 3d 3d 20 49 6e 70 75 .m_StateBlock.byteOffset.==.Inpu
9d60 74 53 74 61 74 65 42 6c 6f 63 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 65 74 20 7c 7c 0d 0a 20 20 tStateBlock.InvalidOffset.||....
9d80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 ..................child.m_StateB
9da0 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f lock.byteOffset.==.InputStateBlo
9dc0 63 6b 2e 41 75 74 6f 6d 61 74 69 63 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ck.AutomaticOffset).............
9de0 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .........continue;..............
9e00 20 20 20 20 20 20 2f 2f 20 41 74 20 74 68 69 73 20 70 6f 69 6e 74 2c 20 69 66 20 74 68 65 20 63 ......//.At.this.point,.if.the.c
9e20 68 69 6c 64 20 68 61 73 20 6e 6f 20 76 61 6c 69 64 20 62 69 74 20 6f 66 66 73 65 74 2c 20 70 75 hild.has.no.valid.bit.offset,.pu
9e40 74 20 69 74 20 61 74 20 23 30 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 t.it.at.#0.now..................
9e60 20 69 66 20 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 .if.(child.m_StateBlock.bitOffse
9e80 74 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 t.==.InputStateBlock.InvalidOffs
9ea0 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d et)......................child.m
9ec0 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 _StateBlock.bitOffset.=.0;......
9ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 74 68 65 20 63 6f 6e 74 ..............//.See.if.the.cont
9f00 72 6f 6c 20 62 75 6d 70 73 20 6f 75 72 20 66 69 78 65 64 20 6c 61 79 6f 75 74 20 73 69 7a 65 2e rol.bumps.our.fixed.layout.size.
9f20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 6e 64 4f 66 66 73 65 74 20 ..................var.endOffset.
9f40 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 65 6d 6f 72 79 48 65 6c =......................MemoryHel
9f60 70 65 72 73 2e 43 6f 6d 70 75 74 65 46 6f 6c 6c 6f 77 69 6e 67 42 79 74 65 4f 66 66 73 65 74 28 pers.ComputeFollowingByteOffset(
9f80 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 2c 20 63 child.m_StateBlock.byteOffset,.c
9fa0 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 2b 20 63 68 hild.m_StateBlock.bitOffset.+.ch
9fc0 69 6c 64 53 69 7a 65 49 6e 42 69 74 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ildSizeInBits);.................
9fe0 20 69 66 20 28 65 6e 64 4f 66 66 73 65 74 20 3e 20 66 69 72 73 74 55 6e 66 69 78 65 64 42 79 74 .if.(endOffset.>.firstUnfixedByt
a000 65 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 eOffset)......................fi
a020 72 73 74 55 6e 66 69 78 65 64 42 79 74 65 4f 66 66 73 65 74 20 3d 20 65 6e 64 4f 66 66 73 65 74 rstUnfixedByteOffset.=.endOffset
a040 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ;..............}................
a060 2f 2f 2f 2f 54 4f 44 4f 3a 20 74 68 69 73 20 64 6f 65 73 6e 27 74 20 73 75 70 70 6f 72 74 20 6d ////TODO:.this.doesn't.support.m
a080 69 78 65 64 20 61 75 74 6f 6d 61 74 69 63 20 61 6e 64 20 66 69 78 65 64 20 6c 61 79 6f 75 74 69 ixed.automatic.and.fixed.layouti
a0a0 6e 67 20 2a 77 69 74 68 69 6e 2a 20 62 69 74 66 69 65 6c 64 73 3b 0d 0a 20 20 20 20 20 20 20 20 ng.*within*.bitfields;..........
a0c0 20 20 20 20 2f 2f 2f 2f 20 20 20 20 20 20 49 20 74 68 69 6e 6b 20 69 74 27 73 20 6f 6b 61 79 20 ....////......I.think.it's.okay.
a0e0 6e 6f 74 20 74 6f 20 73 75 70 70 6f 72 74 20 74 68 61 74 20 62 75 74 20 77 65 20 73 68 6f 75 6c not.to.support.that.but.we.shoul
a100 64 20 61 74 20 6c 65 61 73 74 20 64 65 74 65 63 74 20 69 74 0d 0a 0d 0a 20 20 20 20 20 20 20 20 d.at.least.detect.it............
a120 20 20 20 20 2f 2f 20 4e 6f 77 20 61 73 73 69 67 6e 20 61 6e 20 6f 66 66 73 65 74 20 74 6f 20 65 ....//.Now.assign.an.offset.to.e
a140 76 65 72 79 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 77 61 6e 74 73 20 61 6e 0d 0a 20 20 20 20 very.control.that.wants.an......
a160 20 20 20 20 20 20 20 20 2f 2f 20 61 75 74 6f 6d 61 74 69 63 20 6f 66 66 73 65 74 2e 20 46 6f 72 ........//.automatic.offset..For
a180 20 62 69 74 66 69 65 6c 64 73 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 64 65 6c 61 79 20 61 64 76 .bitfields,.we.need.to.delay.adv
a1a0 61 6e 63 69 6e 67 20 62 79 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 66 66 73 ancing.byte..............//.offs
a1c0 65 74 73 20 75 6e 74 69 6c 20 77 65 27 76 65 20 73 65 65 6e 20 61 6c 6c 20 62 69 74 73 20 69 6e ets.until.we've.seen.all.bits.in
a1e0 20 74 68 65 20 66 69 65 6c 64 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 .the.fields...............//.NOT
a200 45 3a 20 42 69 74 20 61 64 64 72 65 73 73 69 6e 67 20 63 6f 6e 74 72 6f 6c 73 20 75 73 69 6e 67 E:.Bit.addressing.controls.using
a220 20 61 75 74 6f 6d 61 74 69 63 20 6f 66 66 73 65 74 73 20 2a 6d 75 73 74 2a 20 62 65 20 63 6f 6e .automatic.offsets.*must*.be.con
a240 73 65 63 75 74 69 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 75 6e 6e 69 secutive...............var.runni
a260 6e 67 42 79 74 65 4f 66 66 73 65 74 20 3d 20 66 69 72 73 74 55 6e 66 69 78 65 64 42 79 74 65 4f ngByteOffset.=.firstUnfixedByteO
a280 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c ffset;..............InputControl
a2a0 20 66 69 72 73 74 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 6c 64 20 3d 20 6e 75 6c 6c 3b .firstBitAddressingChild.=.null;
a2c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 62 69 74 66 69 65 6c 64 53 69 7a 65 49 6e ..............var.bitfieldSizeIn
a2e0 42 69 74 73 20 3d 20 30 75 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 Bits.=.0u;..............foreach.
a300 28 76 61 72 20 63 68 69 6c 64 20 69 6e 20 63 68 69 6c 64 72 65 6e 29 0d 0a 20 20 20 20 20 20 20 (var.child.in.children).........
a320 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 .....{..................//.Skip.
a340 63 68 69 6c 64 72 65 6e 20 77 69 74 68 20 66 69 78 65 64 20 6f 66 66 73 65 74 73 2e 0d 0a 20 20 children.with.fixed.offsets.....
a360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 ..............if.(child.m_StateB
a380 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 21 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f lock.byteOffset.!=.InputStateBlo
a3a0 63 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 65 74 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ck.InvalidOffset.&&.............
a3c0 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 .........child.m_StateBlock.byte
a3e0 4f 66 66 73 65 74 20 21 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 41 75 74 6f 6d 61 Offset.!=.InputStateBlock.Automa
a400 74 69 63 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ticOffset)......................
a420 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 continue;....................//.
a440 53 6b 69 70 20 63 68 69 6c 64 72 65 6e 20 75 73 69 6e 67 20 73 74 61 74 65 20 66 72 6f 6d 20 6f Skip.children.using.state.from.o
a460 74 68 65 72 20 63 6f 6e 74 72 6f 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ther.controls...................
a480 69 66 20 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 if.(child.m_StateBlock.sizeInBit
a4a0 73 20 3d 3d 20 6b 53 69 7a 65 46 6f 72 43 6f 6e 74 72 6f 6c 55 73 69 6e 67 53 74 61 74 65 46 72 s.==.kSizeForControlUsingStateFr
a4c0 6f 6d 4f 74 68 65 72 43 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 omOtherControl).................
a4e0 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .....continue;..................
a500 20 20 2f 2f 20 53 65 65 20 69 66 20 69 74 27 73 20 61 20 62 69 74 20 61 64 64 72 65 73 73 69 6e ..//.See.if.it's.a.bit.addressin
a520 67 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 g.control...................var.
a540 69 73 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 6c 64 20 3d 20 28 63 68 69 6c 64 2e 6d 5f isBitAddressingChild.=.(child.m_
a560 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 25 20 38 29 20 21 3d 20 30 3b StateBlock.sizeInBits.%.8).!=.0;
a580 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 69 74 41 64 64 72 65 ..................if.(isBitAddre
a5a0 73 73 69 6e 67 43 68 69 6c 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ssingChild)..................{..
a5c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 65 6d 62 65 72 20 ....................//.Remember.
a5e0 73 74 61 72 74 20 6f 66 20 62 69 74 66 69 65 6c 64 20 67 72 6f 75 70 2e 0d 0a 20 20 20 20 20 20 start.of.bitfield.group.........
a600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 66 69 72 73 74 42 69 74 41 64 64 72 65 73 ..............if.(firstBitAddres
a620 73 69 6e 67 43 68 69 6c 64 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 singChild.==.null)..............
a640 20 20 20 20 20 20 20 20 20 20 20 20 66 69 72 73 74 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 ............firstBitAddressingCh
a660 69 6c 64 20 3d 20 63 68 69 6c 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ild.=.child;....................
a680 20 20 20 20 2f 2f 20 4b 65 65 70 20 61 20 72 75 6e 6e 69 6e 67 20 63 6f 75 6e 74 20 6f 66 20 74 ....//.Keep.a.running.count.of.t
a6a0 68 65 20 73 69 7a 65 20 6f 66 20 74 68 65 20 62 69 74 66 69 65 6c 64 2e 0d 0a 20 20 20 20 20 20 he.size.of.the.bitfield.........
a6c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 ..............if.(child.m_StateB
a6e0 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 lock.bitOffset.==.InputStateBloc
a700 6b 2e 49 6e 76 61 6c 69 64 4f 66 66 73 65 74 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 k.InvalidOffset.||..............
a720 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 ............child.m_StateBlock.b
a740 69 74 4f 66 66 73 65 74 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 41 75 74 6f itOffset.==.InputStateBlock.Auto
a760 6d 61 74 69 63 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 maticOffset)....................
a780 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ..{..........................//.
a7a0 50 75 74 20 63 68 69 6c 64 20 61 74 20 63 75 72 72 65 6e 74 20 62 69 74 20 6f 66 66 73 65 74 2e Put.child.at.current.bit.offset.
a7c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e ..........................child.
a7e0 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 20 3d 20 62 69 74 66 69 65 6c m_StateBlock.bitOffset.=.bitfiel
a800 64 53 69 7a 65 49 6e 42 69 74 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dSizeInBits;....................
a820 20 20 20 20 20 20 20 20 62 69 74 66 69 65 6c 64 53 69 7a 65 49 6e 42 69 74 73 20 2b 3d 20 63 68 ........bitfieldSizeInBits.+=.ch
a840 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 3b 0d 0a 20 20 ild.m_StateBlock.sizeInBits;....
a860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................}.............
a880 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........else...................
a8a0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ...{..........................//
a8c0 20 43 68 69 6c 64 20 61 6c 72 65 61 64 79 20 68 61 73 20 62 69 74 20 6f 66 66 73 65 74 2e 20 4b .Child.already.has.bit.offset..K
a8e0 65 65 70 20 69 74 20 62 75 74 20 6d 61 6b 65 20 73 75 72 65 20 77 65 27 72 65 20 61 63 63 6f 75 eep.it.but.make.sure.we're.accou
a900 6e 74 69 6e 67 20 66 6f 72 20 69 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nting.for.it....................
a920 20 20 20 20 20 20 2f 2f 20 69 6e 20 74 68 65 20 62 69 74 66 69 65 6c 64 20 73 69 7a 65 2e 0d 0a ......//.in.the.bitfield.size...
a940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 73 74 ........................var.last
a960 42 69 74 20 3d 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 Bit.=.child.m_StateBlock.bitOffs
a980 65 74 20 2b 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 et.+.child.m_StateBlock.sizeInBi
a9a0 74 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 ts;..........................if.
a9c0 28 6c 61 73 74 42 69 74 20 3e 20 62 69 74 66 69 65 6c 64 53 69 7a 65 49 6e 42 69 74 73 29 0d 0a (lastBit.>.bitfieldSizeInBits)..
a9e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 69 74 66 ............................bitf
aa00 69 65 6c 64 53 69 7a 65 49 6e 42 69 74 73 20 3d 20 6c 61 73 74 42 69 74 3b 0d 0a 20 20 20 20 20 ieldSizeInBits.=.lastBit;.......
aa20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...............}................
aa40 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 ..}..................else.......
aa60 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........{....................
aa80 20 20 2f 2f 20 54 65 72 6d 69 6e 61 74 65 20 62 69 74 66 69 65 6c 64 20 67 72 6f 75 70 20 28 69 ..//.Terminate.bitfield.group.(i
aaa0 66 20 74 68 65 72 65 20 77 61 73 20 6f 6e 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 f.there.was.one)................
aac0 20 20 20 20 20 20 20 69 66 20 28 66 69 72 73 74 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 .......if.(firstBitAddressingChi
aae0 6c 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ld.!=.null).....................
ab00 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 6e .{..........................runn
ab20 69 6e 67 42 79 74 65 4f 66 66 73 65 74 20 3d 20 4d 65 6d 6f 72 79 48 65 6c 70 65 72 73 2e 43 6f ingByteOffset.=.MemoryHelpers.Co
ab40 6d 70 75 74 65 46 6f 6c 6c 6f 77 69 6e 67 42 79 74 65 4f 66 66 73 65 74 28 72 75 6e 6e 69 6e 67 mputeFollowingByteOffset(running
ab60 42 79 74 65 4f 66 66 73 65 74 2c 20 62 69 74 66 69 65 6c 64 53 69 7a 65 49 6e 42 69 74 73 29 3b ByteOffset,.bitfieldSizeInBits);
ab80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 72 73 74 42 ..........................firstB
aba0 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 6c 64 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 itAddressingChild.=.null;.......
abc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ...............}................
abe0 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 ........if.(child.m_StateBlock.b
ac00 69 74 4f 66 66 73 65 74 20 3d 3d 20 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 49 6e 76 61 itOffset.==.InputStateBlock.Inva
ac20 6c 69 64 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lidOffset)......................
ac40 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 ....child.m_StateBlock.bitOffset
ac60 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 .=.0;..................}........
ac80 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 73 65 65 6d 73 20 6c 69 6b ............////FIXME:.seems.lik
aca0 65 20 74 68 69 73 20 73 68 6f 75 6c 64 20 74 61 6b 65 20 62 69 74 4f 66 66 73 65 74 20 69 6e 74 e.this.should.take.bitOffset.int
acc0 6f 20 61 63 63 6f 75 6e 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 o.account..................child
ace0 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 3d 20 72 75 6e 6e 69 .m_StateBlock.byteOffset.=.runni
ad00 6e 67 42 79 74 65 4f 66 66 73 65 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ngByteOffset;...................
ad20 20 69 66 20 28 21 69 73 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 6c 64 29 0d 0a 20 20 20 .if.(!isBitAddressingChild).....
ad40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 6e 69 6e 67 42 79 74 65 4f 66 66 73 .................runningByteOffs
ad60 65 74 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 65 et.=..........................Me
ad80 6d 6f 72 79 48 65 6c 70 65 72 73 2e 43 6f 6d 70 75 74 65 46 6f 6c 6c 6f 77 69 6e 67 42 79 74 65 moryHelpers.ComputeFollowingByte
ada0 4f 66 66 73 65 74 28 72 75 6e 6e 69 6e 67 42 79 74 65 4f 66 66 73 65 74 2c 20 63 68 69 6c 64 2e Offset(runningByteOffset,.child.
adc0 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 29 3b 0d 0a 20 20 20 20 20 m_StateBlock.sizeInBits);.......
ade0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6d 70 75 .......}................//.Compu
ae00 74 65 20 74 6f 74 61 6c 20 73 69 7a 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 te.total.size...............//.I
ae20 66 20 77 65 20 65 6e 64 65 64 20 6f 6e 20 61 20 62 69 74 66 69 65 6c 64 2c 20 61 63 63 6f 75 6e f.we.ended.on.a.bitfield,.accoun
ae40 74 20 66 6f 72 20 69 74 73 20 73 69 7a 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 t.for.its.size...............if.
ae60 28 66 69 72 73 74 42 69 74 41 64 64 72 65 73 73 69 6e 67 43 68 69 6c 64 20 21 3d 20 6e 75 6c 6c (firstBitAddressingChild.!=.null
ae80 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 75 6e 6e 69 6e 67 42 79 74 65 4f 66 )..................runningByteOf
aea0 66 73 65 74 20 3d 20 4d 65 6d 6f 72 79 48 65 6c 70 65 72 73 2e 43 6f 6d 70 75 74 65 46 6f 6c 6c fset.=.MemoryHelpers.ComputeFoll
aec0 6f 77 69 6e 67 42 79 74 65 4f 66 66 73 65 74 28 72 75 6e 6e 69 6e 67 42 79 74 65 4f 66 66 73 65 owingByteOffset(runningByteOffse
aee0 74 2c 20 62 69 74 66 69 65 6c 64 53 69 7a 65 49 6e 42 69 74 73 29 3b 0d 0a 20 20 20 20 20 20 20 t,.bitfieldSizeInBits);.........
af00 20 20 20 20 20 76 61 72 20 74 6f 74 61 6c 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 72 75 6e 6e .....var.totalSizeInBytes.=.runn
af20 69 6e 67 42 79 74 65 4f 66 66 73 65 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f ingByteOffset;................//
af40 20 53 65 74 20 73 69 7a 65 2e 20 57 65 20 66 6f 72 63 65 20 61 6c 6c 20 70 61 72 65 6e 74 73 20 .Set.size..We.force.all.parents.
af60 74 6f 20 74 68 65 20 63 6f 6d 62 69 6e 65 64 20 73 69 7a 65 20 6f 66 20 74 68 65 69 72 20 63 68 to.the.combined.size.of.their.ch
af80 69 6c 64 72 65 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 ildren...............control.m_S
afa0 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 3d 20 74 6f 74 61 6c 53 69 7a 65 tateBlock.sizeInBits.=.totalSize
afc0 49 6e 42 79 74 65 73 20 2a 20 38 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 InBytes.*.8;..........}.........
afe0 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 46 69 6e 61 6c 69 7a 65 43 6f 6e 74 72 6f 6c 48 ...private.void.FinalizeControlH
b000 69 65 72 61 72 63 68 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ierarchy()..........{...........
b020 20 20 20 46 69 6e 61 6c 69 7a 65 43 6f 6e 74 72 6f 6c 48 69 65 72 61 72 63 68 79 52 65 63 75 72 ...FinalizeControlHierarchyRecur
b040 73 69 76 65 28 6d 5f 44 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 sive(m_Device);..........}......
b060 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 46 69 6e 61 6c 69 7a 65 43 6f 6e 74 72 ......private.void.FinalizeContr
b080 6f 6c 48 69 65 72 61 72 63 68 79 52 65 63 75 72 73 69 76 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f olHierarchyRecursive(InputContro
b0a0 6c 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 l.control)..........{...........
b0c0 20 20 20 2f 2f 20 53 65 74 20 66 69 6e 61 6c 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 2e 20 54 ...//.Set.final.display.names..T
b0e0 68 69 73 20 6d 61 79 20 6f 76 65 72 77 72 69 74 65 20 74 68 65 20 6f 6e 65 73 20 73 75 70 70 6c his.may.overwrite.the.ones.suppl
b100 69 65 64 20 62 79 20 74 68 65 20 6c 61 79 6f 75 74 20 73 6f 20 74 65 6d 70 6f 72 61 72 69 6c 79 ied.by.the.layout.so.temporarily
b120 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 74 6f 72 65 20 74 68 65 20 76 61 6c 75 65 ..............//.store.the.value
b140 73 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 69 73 70 6c 61 79 s.here...............var.display
b160 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 44 69 73 70 6c NameFromLayout.=.control.m_Displ
b180 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 ayNameFromLayout;..............v
b1a0 61 72 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 20 3d 20 ar.shortDisplayNameFromLayout.=.
b1c0 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 control.m_ShortDisplayNameFromLa
b1e0 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 44 69 73 70 6c 61 79 4e 61 6d yout;..............SetDisplayNam
b200 65 28 63 6f 6e 74 72 6f 6c 2c 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 e(control,.displayNameFromLayout
b220 2c 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 2c 20 66 61 ,.shortDisplayNameFromLayout,.fa
b240 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 44 69 73 70 6c 61 79 4e 61 6d lse);..............SetDisplayNam
b260 65 28 63 6f 6e 74 72 6f 6c 2c 20 64 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 e(control,.displayNameFromLayout
b280 2c 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 46 72 6f 6d 4c 61 79 6f 75 74 2c 20 74 72 ,.shortDisplayNameFromLayout,.tr
b2a0 75 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 63 75 72 73 65 20 69 ue);................//.Recurse.i
b2c0 6e 74 6f 20 63 68 69 6c 64 72 65 6e 2e 20 41 6c 73 6f 20 62 61 6b 65 20 6f 75 72 20 73 74 61 74 nto.children..Also.bake.our.stat
b2e0 65 20 6f 66 66 73 65 74 20 69 6e 74 6f 20 6f 75 72 20 63 68 69 6c 64 72 65 6e 2e 0d 0a 20 20 20 e.offset.into.our.children......
b300 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 75 72 4f 66 66 73 65 74 20 3d 20 63 6f 6e 74 72 6f 6c .........var.ourOffset.=.control
b320 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 .m_StateBlock.byteOffset;.......
b340 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 68 69 6c 64 20 69 6e 20 63 6f 6e .......foreach.(var.child.in.con
b360 74 72 6f 6c 2e 63 68 69 6c 64 72 65 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 trol.children)..............{...
b380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 69 6c 64 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 ...............child.m_StateBloc
b3a0 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 2b 3d 20 6f 75 72 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 k.byteOffset.+=.ourOffset;......
b3c0 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 61 6c 69 7a 65 43 6f 6e 74 72 6f 6c 48 69 65 72 61 ............FinalizeControlHiera
b3e0 72 63 68 79 52 65 63 75 72 73 69 76 65 28 63 68 69 6c 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 rchyRecursive(child);...........
b400 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 ...}..........}............priva
b420 74 65 20 73 74 61 74 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 73 5f 49 te.static.InputDeviceBuilder.s_I
b440 6e 73 74 61 6e 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 nstance;..........private.static
b460 20 69 6e 74 20 73 5f 49 6e 73 74 61 6e 63 65 52 65 66 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 .int.s_InstanceRef;............i
b480 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 72 65 66 20 49 6e 70 75 74 44 65 76 69 63 65 42 75 nternal.static.ref.InputDeviceBu
b4a0 69 6c 64 65 72 20 69 6e 73 74 61 6e 63 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ilder.instance..........{.......
b4c0 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 .......get..............{.......
b4e0 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 73 5f 49 6e 73 74 61 6e ...........Debug.Assert(s_Instan
b500 63 65 52 65 66 20 3e 20 30 2c 20 22 4d 75 73 74 20 68 6f 6c 64 20 61 6e 20 69 6e 73 74 61 6e 63 ceRef.>.0,."Must.hold.an.instanc
b520 65 20 72 65 66 65 72 65 6e 63 65 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e.reference");..................
b540 72 65 74 75 72 6e 20 72 65 66 20 73 5f 49 6e 73 74 61 6e 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 return.ref.s_Instance;..........
b560 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 ....}..........}............inte
b580 72 6e 61 6c 20 73 74 61 74 69 63 20 52 65 66 49 6e 73 74 61 6e 63 65 20 52 65 66 28 29 0d 0a 20 rnal.static.RefInstance.Ref()...
b5a0 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 .......{..............Debug.Asse
b5c0 72 74 28 73 5f 49 6e 73 74 61 6e 63 65 2e 6d 5f 44 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 2c 0d rt(s_Instance.m_Device.==.null,.
b5e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 ................."InputDeviceBui
b600 6c 64 65 72 20 69 73 20 61 6c 72 65 61 64 79 20 69 6e 20 75 73 65 21 20 43 61 6e 6e 6f 74 20 75 lder.is.already.in.use!.Cannot.u
b620 73 65 20 74 68 65 20 62 75 69 6c 64 65 72 20 72 65 63 75 72 73 69 76 65 6c 79 22 29 3b 0d 0a 20 se.the.builder.recursively");...
b640 20 20 20 20 20 20 20 20 20 20 20 2b 2b 73 5f 49 6e 73 74 61 6e 63 65 52 65 66 3b 0d 0a 20 20 20 ...........++s_InstanceRef;.....
b660 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 66 49 6e 73 74 61 6e 63 65 28 .........return.new.RefInstance(
b680 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 48 65 6c 70 );..........}............//.Help
b6a0 65 72 20 74 68 61 74 20 61 6c 6c 6f 77 73 20 73 65 74 74 69 6e 67 20 75 70 20 61 6e 20 49 6e 70 er.that.allows.setting.up.an.Inp
b6c0 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 20 73 75 63 68 20 74 68 61 74 20 69 74 20 77 69 6c utDeviceBuilder.such.that.it.wil
b6e0 6c 20 65 69 74 68 65 72 20 62 65 20 63 72 65 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 l.either.be.created..........//.
b700 6c 6f 63 61 6c 6c 79 20 61 6e 64 20 74 65 6d 70 6f 72 61 72 69 6c 79 20 6f 72 2c 20 69 66 20 6f locally.and.temporarily.or,.if.o
b720 6e 65 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 20 67 6c 6f 62 61 6c 6c 79 2c 20 72 65 75 73 ne.already.exists.globally,.reus
b740 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 72 75 63 74 20 52 65 66 ed...........internal.struct.Ref
b760 49 6e 73 74 61 6e 63 65 20 3a 20 49 44 69 73 70 6f 73 61 62 6c 65 0d 0a 20 20 20 20 20 20 20 20 Instance.:.IDisposable..........
b780 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 69 73 70 6f {..............public.void.Dispo
b7a0 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 se()..............{.............
b7c0 20 20 20 20 20 2d 2d 73 5f 49 6e 73 74 61 6e 63 65 52 65 66 3b 0d 0a 20 20 20 20 20 20 20 20 20 .....--s_InstanceRef;...........
b7e0 20 20 20 20 20 20 20 69 66 20 28 73 5f 49 6e 73 74 61 6e 63 65 52 65 66 20 3c 3d 20 30 29 0d 0a .......if.(s_InstanceRef.<=.0)..
b800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
b820 20 20 20 20 20 20 20 73 5f 49 6e 73 74 61 6e 63 65 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 .......s_Instance.Dispose();....
b840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 49 6e 73 74 61 6e 63 65 20 3d 20 64 ..................s_Instance.=.d
b860 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 49 efault;......................s_I
b880 6e 73 74 61 6e 63 65 52 65 66 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nstanceRef.=.0;.................
b8a0 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 .}..................else........
b8c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 72 65 ..............//.Make.sure.we.re
b8e0 73 65 74 20 77 68 65 6e 20 74 68 65 72 65 20 69 73 20 61 6e 20 65 78 63 65 70 74 69 6f 6e 2e 0d set.when.there.is.an.exception..
b900 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 49 6e 73 74 61 6e 63 65 2e .....................s_Instance.
b920 52 65 73 65 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 Reset();..............}.........
b940 20 7d 0d 0a 20 20 20 20 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .}......}..}....................
b960 00 00 00 00 12 00 00 00 49 6e 70 75 74 44 65 76 69 63 65 42 75 69 6c 64 65 72 00 00 00 00 00 00 ........InputDeviceBuilder......