summaryrefslogtreecommitdiff
path: root/Library/Artifacts/c0/c0ae0c08d4b653aca8d8bec35b2ce7bf
blob: a8b40b2ea0fe1a4c1a36833df382c0b8bb05e64f (plain)
ofshex dumpascii
0000 00 00 0f 81 00 01 0e b0 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 50 fe 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 P...............................
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 10 00 00 00 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 cc fd 00 00 ............InputControlPath....
10a0 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 54 65 78 74 using.System;..using.System.Text
10c0 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 47 65 6e 65 ;..using.System.Collections.Gene
10e0 72 69 63 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 3b 0d 0a ric;..using.Unity.Collections;..
1100 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 61 using.UnityEngine.InputSystem.La
1120 79 6f 75 74 73 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 74 53 youts;..using.UnityEngine.InputS
1140 79 73 74 65 6d 2e 55 74 69 6c 69 74 69 65 73 3b 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 6c ystem.Utilities;....////TODO:.al
1160 6c 6f 77 20 73 74 75 66 66 20 6c 69 6b 65 20 22 2f 67 61 6d 65 70 61 64 2f 2a 2a 2f 3c 62 75 74 low.stuff.like."/gamepad/**/<but
1180 74 6f 6e 3e 22 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 64 64 20 73 75 70 70 6f 72 74 20 66 6f 72 ton>"..////TODO:.add.support.for
11a0 20 7c 20 28 65 2e 67 2e 20 22 3c 47 61 6d 65 70 61 64 3e 7c 3c 4a 6f 79 73 74 69 63 6b 3e 2f 7b .|.(e.g.."<Gamepad>|<Joystick>/{
11c0 50 72 69 6d 61 72 79 4d 6f 74 69 6f 6e 7d 22 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 68 61 6e 64 6c PrimaryMotion}"..////TODO:.handl
11e0 65 20 61 72 72 61 79 73 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 64 64 20 6d 65 74 68 6f 64 20 74 e.arrays..////TODO:.add.method.t
1200 6f 20 65 78 74 72 61 63 74 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 0d 0a 0d 0a 2f 2f 2f 2f 52 45 o.extract.control.path....////RE
1220 56 49 45 57 3a 20 63 68 61 6e 67 65 20 22 2a 2f 7b 50 72 69 6d 61 72 79 41 63 74 69 6f 6e 7d 22 VIEW:.change."*/{PrimaryAction}"
1240 20 74 6f 20 22 2a 2f 2a 2a 2f 7b 50 72 69 6d 61 72 79 41 63 74 69 6f 6e 7d 22 20 73 6f 20 74 68 .to."*/**/{PrimaryAction}".so.th
1260 61 74 20 74 68 65 20 68 69 65 72 61 72 63 68 79 20 63 72 61 77 6c 69 6e 67 20 62 65 63 6f 6d 65 at.the.hierarchy.crawling.become
1280 73 20 65 78 70 6c 69 63 69 74 3f 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 72 65 6e 61 6d s.explicit?....////REVIEW:.renam
12a0 65 20 74 6f 20 60 49 6e 70 75 74 50 61 74 68 60 3f 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 e.to.`InputPath`?....namespace.U
12c0 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 0d 0a 7b 0d 0a 20 20 20 20 2f nityEngine.InputSystem..{....../
12e0 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 73 20 //.<summary>......///.Functions.
1300 66 6f 72 20 77 6f 72 6b 69 6e 67 20 77 69 74 68 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 20 73 70 for.working.with.control.path.sp
1320 65 63 73 20 28 6c 69 6b 65 20 22 2f 67 61 6d 65 70 61 64 2f 2a 73 74 69 63 6b 22 29 2e 0d 0a 20 ecs.(like."/gamepad/*stick")....
1340 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 3c 72 65 6d 61 ...///.</summary>......///.<rema
1360 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 43 6f 6e 74 72 6f 6c 20 70 61 74 68 73 20 61 72 65 20 rks>......///.Control.paths.are.
1380 61 20 6d 69 6e 69 2d 6c 61 6e 67 75 61 67 65 20 73 69 6d 69 6c 61 72 20 74 6f 20 72 65 67 75 6c a.mini-language.similar.to.regul
13a0 61 72 20 65 78 70 72 65 73 73 69 6f 6e 73 2e 20 54 68 65 79 20 61 72 65 20 75 73 65 64 20 74 68 ar.expressions..They.are.used.th
13c0 72 6f 75 67 68 6f 75 74 0d 0a 20 20 20 20 2f 2f 2f 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 roughout......///.the.input.syst
13e0 65 6d 20 61 73 20 73 74 72 69 6e 67 20 22 61 64 64 72 65 73 73 65 73 22 20 6f 66 20 69 6e 70 75 em.as.string."addresses".of.inpu
1400 74 20 63 6f 6e 74 72 6f 6c 73 2e 20 41 74 20 72 75 6e 74 69 6d 65 2c 20 74 68 65 79 20 63 61 6e t.controls..At.runtime,.they.can
1420 20 62 65 20 6d 61 74 63 68 65 64 0d 0a 20 20 20 20 2f 2f 2f 20 61 67 61 69 6e 73 74 20 74 68 65 .be.matched......///.against.the
1440 20 64 65 76 69 63 65 73 20 61 6e 64 20 63 6f 6e 74 72 6f 6c 73 20 70 72 65 73 65 6e 74 20 69 6e .devices.and.controls.present.in
1460 20 74 68 65 20 73 79 73 74 65 6d 20 74 6f 20 72 65 74 72 69 65 76 65 20 74 68 65 20 61 63 74 75 .the.system.to.retrieve.the.actu
1480 61 6c 20 65 6e 64 70 6f 69 6e 74 73 20 74 6f 0d 0a 20 20 20 20 2f 2f 2f 20 72 65 63 65 69 76 65 al.endpoints.to......///.receive
14a0 20 69 6e 70 75 74 20 66 72 6f 6d 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 4c .input.from.......///......///.L
14c0 69 6b 65 20 6f 6e 20 61 20 66 69 6c 65 20 73 79 73 74 65 6d 2c 20 61 20 70 61 74 68 20 69 73 20 ike.on.a.file.system,.a.path.is.
14e0 6d 61 64 65 20 75 70 20 6f 66 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 74 68 61 74 20 61 72 65 20 65 made.up.of.components.that.are.e
1500 61 63 68 20 73 65 70 61 72 61 74 65 64 20 62 79 20 61 0d 0a 20 20 20 20 2f 2f 2f 20 66 6f 72 77 ach.separated.by.a......///.forw
1520 61 72 64 20 73 6c 61 73 68 20 28 3c 63 3e 2f 3c 2f 63 3e 29 2e 20 45 61 63 68 20 73 75 63 68 20 ard.slash.(<c>/</c>)..Each.such.
1540 63 6f 6d 70 6f 6e 65 6e 74 20 69 6e 20 74 75 72 6e 20 69 73 20 6d 61 64 65 20 75 70 20 6f 66 20 component.in.turn.is.made.up.of.
1560 61 20 73 65 74 20 6f 66 20 66 69 65 6c 64 73 20 74 68 61 74 20 61 72 65 0d 0a 20 20 20 20 2f 2f a.set.of.fields.that.are......//
1580 2f 20 69 6e 64 69 76 69 64 75 61 6c 6c 79 20 6f 70 74 69 6f 6e 61 6c 2e 20 48 6f 77 65 76 65 72 /.individually.optional..However
15a0 2c 20 6f 6e 65 20 6f 66 20 74 68 65 20 66 69 65 6c 64 73 20 6d 75 73 74 20 62 65 20 70 72 65 73 ,.one.of.the.fields.must.be.pres
15c0 65 6e 74 20 28 65 2e 67 2e 20 61 74 20 6c 65 61 73 74 20 61 20 6e 61 6d 65 20 6f 72 0d 0a 20 20 ent.(e.g..at.least.a.name.or....
15e0 20 20 2f 2f 2f 20 61 20 77 69 6c 64 63 61 72 64 29 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 ..///.a.wildcard).......///.....
1600 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 46 69 65 6c 64 20 73 74 .///.<example>......///.Field.st
1620 72 75 63 74 75 72 65 20 6f 66 20 65 61 63 68 20 70 61 74 68 20 63 6f 6d 70 6f 6e 65 6e 74 0d 0a ructure.of.each.path.component..
1640 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 26 6c 74 3b 4c 61 79 6f ....///.<code>......///.&lt;Layo
1660 75 74 26 67 74 3b 7b 55 73 61 67 65 7d 23 28 44 69 73 70 6c 61 79 4e 61 6d 65 29 4e 61 6d 65 0d ut&gt;{Usage}#(DisplayName)Name.
1680 0a 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d .....///.</code>......///.</exam
16a0 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 2a 20 3c 63 3e 4c 61 79 6f ple>......///......///.*.<c>Layo
16c0 75 74 3c 2f 63 3e 3a 20 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 74 ut</c>:.The.name.of.the.layout.t
16e0 68 61 74 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6d 75 73 74 20 62 65 20 62 61 73 65 64 20 6f 6e hat.the.control.must.be.based.on
1700 20 28 65 69 74 68 65 72 20 64 69 72 65 63 74 6c 79 20 6f 72 20 69 6e 64 69 72 65 63 74 6c 79 29 .(either.directly.or.indirectly)
1720 2e 0d 0a 20 20 20 20 2f 2f 2f 20 2a 20 3c 63 3e 55 73 61 67 65 3c 2f 63 3e 3a 20 54 68 65 20 75 .......///.*.<c>Usage</c>:.The.u
1740 73 61 67 65 20 74 68 61 74 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6f 72 20 64 65 76 69 63 65 20 sage.that.the.control.or.device.
1760 68 61 73 20 74 6f 20 68 61 76 65 2c 20 69 2e 65 2e 20 6d 75 73 74 20 62 65 20 66 6f 75 6e 64 20 has.to.have,.i.e..must.be.found.
1780 69 6e 20 3c 73 65 65 0d 0a 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 in.<see......///................
17a0 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 54 68 .cref="InputControl.usages"/>.Th
17c0 69 73 20 66 69 65 6c 64 20 63 61 6e 20 62 65 20 72 65 70 65 61 74 65 64 20 73 65 76 65 72 61 6c is.field.can.be.repeated.several
17e0 20 74 69 6d 65 73 20 74 6f 20 72 65 71 75 69 72 65 0d 0a 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 .times.to.require......///......
1800 20 20 20 20 20 20 20 20 20 20 20 6d 75 6c 74 69 70 6c 65 20 75 73 61 67 65 73 20 28 65 2e 67 2e ...........multiple.usages.(e.g.
1820 20 3c 63 3e 22 7b 4c 65 66 74 48 61 6e 64 7d 7b 56 65 72 74 69 63 61 6c 7d 22 3c 2f 63 3e 29 2e .<c>"{LeftHand}{Vertical}"</c>).
1840 0d 0a 20 20 20 20 2f 2f 2f 20 2a 20 3c 63 3e 44 69 73 70 6c 61 79 4e 61 6d 65 3c 2f 63 3e 3a 20 ......///.*.<c>DisplayName</c>:.
1860 54 68 65 20 6e 61 6d 65 20 74 68 61 74 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f The.name.that.<see.cref="InputCo
1880 6e 74 72 6f 6c 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 20 6f 66 20 74 68 65 20 63 6f 6e 74 ntrol.displayName"/>.of.the.cont
18a0 72 6f 6c 20 6f 72 20 64 65 76 69 63 65 0d 0a 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 rol.or.device......///..........
18c0 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 75 73 74 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 2f 2f .............must.match.......//
18e0 2f 20 2a 20 3c 63 3e 4e 61 6d 65 3c 2f 63 3e 3a 20 54 68 65 20 6e 61 6d 65 20 74 68 61 74 20 3c /.*.<c>Name</c>:.The.name.that.<
1900 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 6e 61 6d 65 22 2f 3e 20 6f see.cref="InputControl.name"/>.o
1920 72 20 6f 6e 65 20 6f 66 20 74 68 65 20 65 6e 74 72 69 65 73 20 69 6e 0d 0a 20 20 20 20 2f 2f 2f r.one.of.the.entries.in......///
1940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 ................<see.cref="Input
1960 43 6f 6e 74 72 6f 6c 2e 61 6c 69 61 73 65 73 22 2f 3e 20 6d 75 73 74 20 6d 61 74 63 68 2e 20 41 Control.aliases"/>.must.match..A
1980 6c 74 65 72 6e 61 74 69 76 65 6c 79 2c 20 74 68 69 73 20 63 61 6e 20 62 65 20 61 0d 0a 20 20 20 lternatively,.this.can.be.a.....
19a0 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 69 6c 64 63 61 72 64 20 28 3c 63 .///................wildcard.(<c
19c0 3e 2a 3c 2f 63 3e 29 20 74 6f 20 6d 61 74 63 68 20 61 6e 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 >*</c>).to.match.any.name.......
19e0 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 61 6c 6c 20 6d 61 74 63 68 ///......///.Note.that.all.match
1a00 69 6e 67 20 69 73 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 0d 0a 20 20 20 20 2f 2f ing.is.case-insensitive.......//
1a20 2f 0d 0a 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 56 61 /......///.<example>......///.Va
1a40 72 69 6f 75 73 20 65 78 61 6d 70 6c 65 73 20 6f 66 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 73 0d rious.examples.of.control.paths.
1a60 0a 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 .....///.<code>......///.//.Matc
1a80 68 65 73 20 61 6c 6c 20 67 61 6d 65 70 61 64 73 20 28 61 6c 73 6f 20 67 61 6d 65 70 61 64 73 20 hes.all.gamepads.(also.gamepads.
1aa0 2a 62 61 73 65 64 2a 20 6f 6e 20 74 68 65 20 47 61 6d 65 70 61 64 20 6c 61 79 6f 75 74 29 3a 0d *based*.on.the.Gamepad.layout):.
1ac0 0a 20 20 20 20 2f 2f 2f 20 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 22 0d 0a 20 20 20 20 .....///."&lt;Gamepad&gt;"......
1ae0 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 68 65 73 20 74 68 65 20 22 53 75 62 ///......///.//.Matches.the."Sub
1b00 6d 69 74 22 20 63 6f 6e 74 72 6f 6c 20 6f 6e 20 61 6c 6c 20 64 65 76 69 63 65 73 3a 0d 0a 20 20 mit".control.on.all.devices:....
1b20 20 20 2f 2f 2f 20 22 2a 2f 7b 53 75 62 6d 69 74 7d 22 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 ..///."*/{Submit}"......///.....
1b40 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 68 65 73 20 74 68 65 20 6b 65 79 20 74 68 61 74 20 70 72 69 .///.//.Matches.the.key.that.pri
1b60 6e 74 73 20 74 68 65 20 22 61 22 20 63 68 61 72 61 63 74 65 72 20 6f 6e 20 74 68 65 20 63 75 72 nts.the."a".character.on.the.cur
1b80 72 65 6e 74 20 6b 65 79 62 6f 61 72 64 20 6c 61 79 6f 75 74 3a 0d 0a 20 20 20 20 2f 2f 2f 20 22 rent.keyboard.layout:......///."
1ba0 26 6c 74 3b 4b 65 79 62 6f 61 72 64 26 67 74 3b 2f 23 28 61 29 22 0d 0a 20 20 20 20 2f 2f 2f 0d &lt;Keyboard&gt;/#(a)"......///.
1bc0 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 68 65 73 20 74 68 65 20 58 20 61 78 69 73 20 6f .....///.//.Matches.the.X.axis.o
1be0 66 20 74 68 65 20 6c 65 66 74 20 73 74 69 63 6b 20 6f 6e 20 61 20 67 61 6d 65 70 61 64 2e 0d 0a f.the.left.stick.on.a.gamepad...
1c00 20 20 20 20 2f 2f 2f 20 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 6c 65 66 74 53 74 69 ....///."&lt;Gamepad&gt;/leftSti
1c20 63 6b 2f 78 22 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 68 ck/x"......///......///.//.Match
1c40 65 73 20 74 68 65 20 6f 72 69 65 6e 74 61 74 69 6f 6e 20 63 6f 6e 74 72 6f 6c 20 6f 66 20 74 68 es.the.orientation.control.of.th
1c60 65 20 72 69 67 68 74 2d 68 61 6e 64 20 58 52 20 63 6f 6e 74 72 6f 6c 6c 65 72 3a 0d 0a 20 20 20 e.right-hand.XR.controller:.....
1c80 20 2f 2f 2f 20 22 26 6c 74 3b 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 26 67 74 3b 7b 52 69 67 68 74 .///."&lt;XRController&gt;{Right
1ca0 48 61 6e 64 7d 2f 6f 72 69 65 6e 74 61 74 69 6f 6e 22 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 Hand}/orientation"......///.....
1cc0 20 2f 2f 2f 20 2f 2f 20 4d 61 74 63 68 65 73 20 61 6c 6c 20 62 75 74 74 6f 6e 73 20 6f 6e 20 61 .///.//.Matches.all.buttons.on.a
1ce0 20 67 61 6d 65 70 61 64 2e 0d 0a 20 20 20 20 2f 2f 2f 20 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 .gamepad.......///."&lt;Gamepad&
1d00 67 74 3b 2f 26 6c 74 3b 42 75 74 74 6f 6e 26 67 74 3b 22 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 63 gt;/&lt;Button&gt;"......///.</c
1d20 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f ode>......///.</example>......//
1d40 2f 0d 0a 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20 /......///.The.structure.of.the.
1d60 41 50 49 20 6f 66 20 74 68 69 73 20 63 6c 61 73 73 20 69 73 20 73 69 6d 69 6c 61 72 20 69 6e 20 API.of.this.class.is.similar.in.
1d80 73 70 69 72 69 74 20 74 6f 20 3c 63 3e 53 79 73 74 65 6d 2e 49 4f 2e 50 61 74 68 3c 2f 63 3e 2c spirit.to.<c>System.IO.Path</c>,
1da0 20 69 2e 65 2e 20 69 74 20 6f 66 66 65 72 73 0d 0a 20 20 20 20 2f 2f 2f 20 61 20 72 61 6e 67 65 .i.e..it.offers......///.a.range
1dc0 20 6f 66 20 73 74 61 74 69 63 20 6d 65 74 68 6f 64 73 20 74 68 61 74 20 70 65 72 66 6f 72 6d 20 .of.static.methods.that.perform.
1de0 76 61 72 69 6f 75 73 20 6f 70 65 72 61 74 69 6f 6e 73 20 6f 6e 20 70 61 74 68 20 73 74 72 69 6e various.operations.on.path.strin
1e00 67 73 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 54 6f 20 71 75 65 72 79 20 63 gs.......///......///.To.query.c
1e20 6f 6e 74 72 6f 6c 73 20 6f 6e 20 64 65 76 69 63 65 73 20 70 72 65 73 65 6e 74 20 69 6e 20 74 68 ontrols.on.devices.present.in.th
1e40 65 20 73 79 73 74 65 6d 20 75 73 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 73 2c 20 75 73 e.system.using.control.paths,.us
1e60 65 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 e......///.<see.cref="InputSyste
1e80 6d 2e 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 22 2f 3e 2e 20 41 6c 73 6f 2c 20 63 6f 6e 74 72 6f 6c m.FindControls"/>..Also,.control
1ea0 20 70 61 74 68 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 77 69 74 68 0d 0a 20 20 20 20 2f 2f 2f .paths.can.be.used.with......///
1ec0 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 74 68 69 73 5b 73 74 .<see.cref="InputControl.this[st
1ee0 72 69 6e 67 5d 22 2f 3e 20 6f 6e 20 65 76 65 72 79 20 63 6f 6e 74 72 6f 6c 2e 20 54 68 69 73 20 ring]"/>.on.every.control..This.
1f00 6d 61 6b 65 73 20 69 74 20 70 6f 73 73 69 62 6c 65 0d 0a 20 20 20 20 2f 2f 2f 20 74 6f 20 64 6f makes.it.possible......///.to.do
1f20 20 74 68 69 6e 67 73 20 6c 69 6b 65 3a 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 .things.like:......///......///.
1f40 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 46 69 6e 64 20 6b 65 79 20 74 68 61 74 <example>......///.Find.key.that
1f60 20 70 72 69 6e 74 73 20 22 74 22 20 6f 6e 20 63 75 72 72 65 6e 74 20 6b 65 79 62 6f 61 72 64 3a .prints."t".on.current.keyboard:
1f80 0d 0a 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 4b 65 79 62 6f 61 ......///.<code>......///.Keyboa
1fa0 72 64 2e 63 75 72 72 65 6e 74 5b 22 23 28 74 29 22 5d 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f rd.current["#(t)"]......///.</co
1fc0 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f de>......///.</example>......///
1fe0 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 .</remarks>......///.<seealso.cr
2000 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 70 61 74 68 22 2f 3e 0d 0a 20 20 20 20 2f 2f ef="InputControl.path"/>......//
2020 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e /.<seealso.cref="InputSystem.Fin
2040 64 43 6f 6e 74 72 6f 6c 73 22 2f 3e 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 dControls"/>......public.static.
2060 63 6c 61 73 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 0d 0a 20 20 20 20 7b 0d 0a 20 class.InputControlPath......{...
2080 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 57 69 6c 64 63 .......public.const.string.Wildc
20a0 61 72 64 20 3d 20 22 2a 22 3b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 ard.=."*";..........public.const
20c0 20 73 74 72 69 6e 67 20 44 6f 75 62 6c 65 57 69 6c 64 63 61 72 64 20 3d 20 22 2a 2a 22 3b 0d 0a .string.DoubleWildcard.=."**";..
20e0 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 20 63 68 61 72 20 53 65 70 61 ..........public.const.char.Sepa
2100 72 61 74 6f 72 20 3d 20 27 2f 27 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 rator.=.'/';............public.s
2120 74 61 74 69 63 20 73 74 72 69 6e 67 20 43 6f 6d 62 69 6e 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f tatic.string.Combine(InputContro
2140 6c 20 70 61 72 65 6e 74 2c 20 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 l.parent,.string.path)..........
2160 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 65 6e 74 20 3d 3d 20 6e 75 6c {..............if.(parent.==.nul
2180 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 20 l)..............{...............
21a0 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 79 28 70 61 74 68 ...if.(string.IsNullOrEmpty(path
21c0 29 29 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 20 73 ))......................return.s
21e0 74 72 69 6e 67 2e 45 6d 70 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tring.Empty;....................
2200 69 66 20 28 70 61 74 68 5b 30 5d 20 21 3d 20 53 65 70 61 72 61 74 6f 72 29 0d 0a 20 20 20 20 20 if.(path[0].!=.Separator).......
2220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 53 65 70 61 72 61 74 6f 72 20 ...............return.Separator.
2240 2b 20 70 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 +.path;....................retur
2260 6e 20 70 61 74 68 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 n.path;..............}..........
2280 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 79 28 70 61 74 ....if.(string.IsNullOrEmpty(pat
22a0 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 72 65 h))..................return.pare
22c0 6e 74 2e 70 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 nt.path;................return.$
22e0 22 7b 70 61 72 65 6e 74 2e 70 61 74 68 7d 2f 7b 70 61 74 68 7d 22 3b 0d 0a 20 20 20 20 20 20 20 "{parent.path}/{path}";.........
2300 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 .}............///.<summary>.....
2320 20 20 20 20 20 2f 2f 2f 20 4f 70 74 69 6f 6e 73 20 66 6f 72 20 63 75 73 74 6f 6d 69 7a 69 6e 67 .....///.Options.for.customizing
2340 20 74 68 65 20 62 65 68 61 76 69 6f 72 20 6f 66 20 3c 73 65 65 20 63 72 65 66 3d 22 54 6f 48 75 .the.behavior.of.<see.cref="ToHu
2360 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f manReadableString"/>.........../
2380 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 46 6c 61 67 73 5d 0d 0a //.</summary>..........[Flags]..
23a0 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 65 6e 75 6d 20 48 75 6d 61 6e 52 65 61 64 61 62 6c ........public.enum.HumanReadabl
23c0 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 eStringOptions..........{.......
23e0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 .......///.<summary>............
2400 20 20 2f 2f 2f 20 54 68 65 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72 2e 0d 0a 20 20 20 ..///.The.default.behavior......
2420 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
2440 20 20 20 20 20 4e 6f 6e 65 20 3d 20 30 2c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .....None.=.0,................//
2460 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 6f 20 /.<summary>..............///.Do.
2480 6e 6f 74 20 6d 65 6e 74 69 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 6f 66 20 74 68 65 20 63 6f not.mention.the.device.of.the.co
24a0 6e 74 72 6f 6c 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 69 6e 73 74 65 61 64 20 6f 66 20 22 ntrol..For.example,.instead.of."
24c0 41 20 5b 47 61 6d 65 70 61 64 5d 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 A.[Gamepad]",..............///.r
24e0 65 74 75 72 6e 20 6a 75 73 74 20 22 41 22 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f eturn.just."A"...............///
2500 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4f 6d 69 74 44 65 76 .</summary>..............OmitDev
2520 69 63 65 20 3d 20 31 20 3c 3c 20 31 2c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f ice.=.1.<<.1,................///
2540 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e .<summary>..............///.When
2560 20 61 76 61 69 6c 61 62 6c 65 2c 20 75 73 65 20 73 68 6f 72 74 20 64 69 73 70 6c 61 79 20 6e 61 .available,.use.short.display.na
2580 6d 65 73 20 69 6e 73 74 65 61 64 20 6f 66 20 6c 6f 6e 67 20 6f 6e 65 73 2e 20 46 6f 72 20 65 78 mes.instead.of.long.ones..For.ex
25a0 61 6d 70 6c 65 2c 20 69 6e 73 74 65 61 64 20 6f 66 20 22 4c 65 66 74 20 42 75 74 74 6f 6e 22 2c ample,.instead.of."Left.Button",
25c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 74 75 72 6e 20 22 4c 4d 42 22 2e 0d ..............///.return."LMB"..
25e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 .............///.</summary>.....
2600 20 20 20 20 20 20 20 20 20 55 73 65 53 68 6f 72 74 4e 61 6d 65 73 20 3d 20 31 20 3c 3c 20 32 2c .........UseShortNames.=.1.<<.2,
2620 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 2f 2f 54 4f 44 4f 3a ..........}............////TODO:
2640 20 66 61 63 74 6f 72 20 6f 75 74 20 74 68 65 20 70 61 72 74 20 74 68 61 74 20 6c 6f 6f 6b 73 20 .factor.out.the.part.that.looks.
2660 75 70 20 61 6e 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 up.an.InputControlLayout.Control
2680 49 74 65 6d 20 66 72 6f 6d 20 61 20 67 69 76 65 6e 20 70 61 74 68 0d 0a 20 20 20 20 20 20 20 20 Item.from.a.given.path..........
26a0 2f 2f 2f 2f 20 20 20 20 20 20 61 6e 64 20 6d 61 6b 65 20 74 68 61 74 20 61 76 61 69 6c 61 62 6c ////......and.make.that.availabl
26c0 65 20 61 73 20 61 20 73 74 61 6e 64 2d 61 6c 6f 6e 65 20 41 50 49 0d 0a 20 20 20 20 20 20 20 20 e.as.a.stand-alone.API..........
26e0 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 64 64 20 6f 70 74 69 6f 6e 20 74 6f 20 63 75 73 74 6f 6d 69 7a ////TODO:.add.option.to.customiz
2700 65 20 70 61 74 68 20 73 65 70 61 72 61 74 69 6f 6e 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 e.path.separation.character.....
2720 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<summary>..........///.
2740 43 72 65 61 74 65 20 61 20 68 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20 73 74 72 69 6e 67 20 66 Create.a.human.readable.string.f
2760 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 2e 0d 0a 20 20 20 rom.the.given.control.path......
2780 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
27a0 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 41 20 63 6f 6e 74 72 6f 6c 20 70 61 .<param.name="path">A.control.pa
27c0 74 68 20 73 75 63 68 20 61 73 20 22 26 6c 74 3b 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 3e 7b 4c 65 th.such.as."&lt;XRController>{Le
27e0 66 74 48 61 6e 64 7d 2f 70 6f 73 69 74 69 6f 6e 22 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 ftHand}/position".</param>......
2800 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6f 70 74 69 6f 6e 73 22 3e 43 75 ....///.<param.name="options">Cu
2820 73 74 6f 6d 69 7a 65 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 73 74 72 69 6e 67 2e 3c 2f 70 stomize.the.resulting.string.</p
2840 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 aram>..........///.<param.name="
2860 63 6f 6e 74 72 6f 6c 22 3e 41 6e 20 6f 70 74 69 6f 6e 61 6c 20 63 6f 6e 74 72 6f 6c 2e 20 49 66 control">An.optional.control..If
2880 20 73 75 70 70 6c 69 65 64 20 61 6e 64 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6f 72 20 6f 6e 65 .supplied.and.the.control.or.one
28a0 20 6f 66 20 69 74 73 20 63 68 69 6c 64 72 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 .of.its.children..........///.ma
28c0 74 63 68 65 73 20 74 68 65 20 67 69 76 65 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 tches.the.given.<paramref.name="
28e0 70 61 74 68 22 2f 3e 2c 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 20 77 69 6c 6c 20 62 65 20 62 path"/>,.display.names.will.be.b
2900 61 73 65 64 20 6f 6e 20 74 68 65 20 6d 61 74 63 68 69 6e 67 20 63 6f 6e 74 72 6f 6c 0d 0a 20 20 ased.on.the.matching.control....
2920 20 20 20 20 20 20 2f 2f 2f 20 72 61 74 68 65 72 20 74 68 61 6e 20 6f 6e 20 73 74 61 74 69 63 20 ......///.rather.than.on.static.
2940 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 20 66 72 6f 6d 20 3c 73 65 65 20 information.available.from.<see.
2960 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 73 2e 3c 2f 70 cref="InputControlLayout"/>s.</p
2980 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 41 20 73 74 aram>..........///.<returns>A.st
29a0 72 69 6e 67 20 73 75 63 68 20 61 73 20 22 4c 65 66 74 20 53 74 69 63 6b 2f 58 20 5b 47 61 6d 65 ring.such.as."Left.Stick/X.[Game
29c0 70 61 64 5d 22 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 pad]".</returns>..........///.<r
29e0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 66 75 6e 63 74 69 emarks>..........///.This.functi
2a00 6f 6e 20 69 73 20 6d 6f 73 74 20 75 73 65 66 75 6c 20 66 6f 72 20 74 75 72 6e 69 6e 67 20 62 69 on.is.most.useful.for.turning.bi
2a20 6e 64 69 6e 67 20 70 61 74 68 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 nding.paths.(see.<see.cref="Inpu
2a40 74 42 69 6e 64 69 6e 67 2e 70 61 74 68 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 tBinding.path"/>)..........///.i
2a60 6e 74 6f 20 73 74 72 69 6e 67 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 64 69 73 70 6c 61 79 65 nto.strings.that.can.be.displaye
2a80 64 20 69 6e 20 55 49 73 20 28 73 75 63 68 20 61 73 20 72 65 62 69 6e 64 69 6e 67 20 73 63 72 65 d.in.UIs.(such.as.rebinding.scre
2aa0 65 6e 73 29 2e 20 49 74 20 69 73 20 75 73 65 64 20 62 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ens)..It.is.used.by..........///
2ac0 20 74 68 65 20 55 6e 69 74 79 20 65 64 69 74 6f 72 20 69 74 73 65 6c 66 20 74 6f 20 64 69 73 70 .the.Unity.editor.itself.to.disp
2ae0 6c 61 79 20 62 69 6e 64 69 6e 67 20 70 61 74 68 73 20 69 6e 20 74 68 65 20 55 49 2e 0d 0a 20 20 lay.binding.paths.in.the.UI.....
2b00 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 6d 65 74 68 6f ......///..........///.The.metho
2b20 64 20 75 73 65 73 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 20 28 73 65 65 20 3c 73 65 65 20 63 d.uses.display.names.(see.<see.c
2b40 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 41 74 74 72 69 62 75 74 65 2e 64 69 73 70 6c ref="InputControlAttribute.displ
2b60 61 79 4e 61 6d 65 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 ayName"/>,..........///.<see.cre
2b80 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 2e 64 f="InputControlLayoutAttribute.d
2ba0 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 2c 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e isplayName"/>,.and.<see.cref="In
2bc0 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 2e 64 69 73 putControlLayout.ControlItem.dis
2be0 70 6c 61 79 4e 61 6d 65 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 65 72 65 20 playName"/>)..........///.where.
2c00 70 6f 73 73 69 62 6c 65 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 22 26 6c 74 3b 58 49 6e 70 possible..For.example,."&lt;XInp
2c20 75 74 43 6f 6e 74 72 6f 6c 6c 65 72 26 67 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 20 77 69 utController&gt;/buttonSouth".wi
2c40 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64 20 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 22 ll.be.returned.as..........///."
2c60 41 20 5b 58 62 6f 78 20 43 6f 6e 74 72 6f 6c 6c 65 72 5d 22 20 61 73 20 74 68 65 20 64 69 73 70 A.[Xbox.Controller]".as.the.disp
2c80 6c 61 79 20 6e 61 6d 65 20 6f 66 20 3c 73 65 65 20 63 72 65 66 3d 22 58 49 6e 70 75 74 2e 58 49 lay.name.of.<see.cref="XInput.XI
2ca0 6e 70 75 74 43 6f 6e 74 72 6f 6c 6c 65 72 22 2f 3e 20 69 73 20 22 58 42 6f 78 20 43 6f 6e 74 72 nputController"/>.is."XBox.Contr
2cc0 6f 6c 6c 65 72 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 74 68 65 20 64 69 73 70 oller"..........///.and.the.disp
2ce0 6c 61 79 20 6e 61 6d 65 20 6f 66 20 69 74 73 20 22 62 75 74 74 6f 6e 53 6f 75 74 68 22 20 63 6f lay.name.of.its."buttonSouth".co
2d00 6e 74 72 6f 6c 20 69 73 20 22 41 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 ntrol.is."A"...........///......
2d20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73 65 20 6c 6f 6f 6b 75 70 73 20 ....///.Note.that.these.lookups.
2d40 64 65 70 65 6e 64 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 6c 79 20 72 65 67 69 73 74 65 72 depend.on.the.currently.register
2d60 65 64 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 73 20 28 73 65 65 20 3c 73 65 65 0d 0a 20 20 ed.control.layouts.(see.<see....
2d80 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f ......///.cref="InputControlLayo
2da0 75 74 22 2f 3e 29 20 61 6e 64 20 64 69 66 66 65 72 65 6e 74 20 73 74 72 69 6e 67 73 20 6d 61 79 ut"/>).and.different.strings.may
2dc0 20 74 68 75 73 20 62 65 20 72 65 74 75 72 6e 65 64 20 66 6f 72 20 74 68 65 20 73 61 6d 65 20 63 .thus.be.returned.for.the.same.c
2de0 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 61 74 68 20 64 65 70 65 6e 64 69 ontrol..........///.path.dependi
2e00 6e 67 20 6f 6e 20 74 68 65 20 6c 61 79 6f 75 74 73 20 72 65 67 69 73 74 65 72 65 64 20 77 69 74 ng.on.the.layouts.registered.wit
2e20 68 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 h.the.system...........///......
2e40 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ....///.<example>..........///.<
2e60 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 code>..........///.InputControlP
2e80 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 22 2a 2f 7b 50 72 ath.ToHumanReadableString("*/{Pr
2ea0 69 6d 61 72 79 41 63 74 69 6f 6e 22 29 3b 20 2f 2f 20 2d 3e 20 22 50 72 69 6d 61 72 79 41 63 74 imaryAction");.//.->."PrimaryAct
2ec0 69 6f 6e 20 5b 41 6e 79 5d 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e ion.[Any]"..........///.InputCon
2ee0 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 22 trolPath.ToHumanReadableString("
2f00 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 20 2f &lt;Gamepad&gt;/buttonSouth");./
2f20 2f 20 2d 3e 20 22 42 75 74 74 6f 6e 20 53 6f 75 74 68 20 5b 47 61 6d 65 70 61 64 5d 22 0d 0a 20 /.->."Button.South.[Gamepad]"...
2f40 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 .......///.InputControlPath.ToHu
2f60 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 22 26 6c 74 3b 58 49 6e 70 75 74 43 6f 6e manReadableString("&lt;XInputCon
2f80 74 72 6f 6c 6c 65 72 26 67 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 20 2f 2f 20 2d 3e troller&gt;/buttonSouth");.//.->
2fa0 20 22 41 20 5b 58 62 6f 78 20 43 6f 6e 74 72 6f 6c 6c 65 72 5d 22 0d 0a 20 20 20 20 20 20 20 20 ."A.[Xbox.Controller]"..........
2fc0 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 64 ///.InputControlPath.ToHumanRead
2fe0 61 62 6c 65 53 74 72 69 6e 67 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 6c 65 66 74 ableString("&lt;Gamepad&gt;/left
3000 53 74 69 63 6b 2f 78 22 29 3b 20 2f 2f 20 2d 3e 20 22 4c 65 66 74 20 53 74 69 63 6b 2f 58 20 5b Stick/x");.//.->."Left.Stick/X.[
3020 47 61 6d 65 70 61 64 5d 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a Gamepad]"..........///.</code>..
3040 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</example>..........
3060 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 ///.</remarks>..........///.<see
3080 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 70 61 74 68 22 2f 3e 0d also.cref="InputBinding.path"/>.
30a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 .........///.<seealso.cref="Inpu
30c0 74 42 69 6e 64 69 6e 67 2e 54 6f 44 69 73 70 6c 61 79 53 74 72 69 6e 67 28 49 6e 70 75 74 42 69 tBinding.ToDisplayString(InputBi
30e0 6e 64 69 6e 67 2e 44 69 73 70 6c 61 79 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2c 49 6e 70 75 74 nding.DisplayStringOptions,Input
3100 43 6f 6e 74 72 6f 6c 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 Control)"/>..........///.<seeals
3120 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 52 65 62 69 6e 64 69 6e 67 45 78 74 65 o.cref="InputActionRebindingExte
3140 6e 73 69 6f 6e 73 2e 47 65 74 42 69 6e 64 69 6e 67 44 69 73 70 6c 61 79 53 74 72 69 6e 67 28 49 nsions.GetBindingDisplayString(I
3160 6e 70 75 74 41 63 74 69 6f 6e 2c 69 6e 74 2c 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 44 69 73 70 nputAction,int,InputBinding.Disp
3180 6c 61 79 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 layStringOptions)"/>..........pu
31a0 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 blic.static.string.ToHumanReadab
31c0 6c 65 53 74 72 69 6e 67 28 73 74 72 69 6e 67 20 70 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 leString(string.path,...........
31e0 20 20 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 20 6f 70 ...HumanReadableStringOptions.op
3200 74 69 6f 6e 73 20 3d 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f tions.=.HumanReadableStringOptio
3220 6e 73 2e 4e 6f 6e 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 43 6f 6e 74 72 ns.None,..............InputContr
3240 6f 6c 20 63 6f 6e 74 72 6f 6c 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 ol.control.=.null)..........{...
3260 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c ...........return.ToHumanReadabl
3280 65 53 74 72 69 6e 67 28 70 61 74 68 2c 20 6f 75 74 20 5f 2c 20 6f 75 74 20 5f 2c 20 6f 70 74 69 eString(path,.out._,.out._,.opti
32a0 6f 6e 73 2c 20 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 ons,.control);..........}.......
32c0 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<summary>..........///.
32e0 43 72 65 61 74 65 20 61 20 68 75 6d 61 6e 20 72 65 61 64 61 62 6c 65 20 73 74 72 69 6e 67 20 66 Create.a.human.readable.string.f
3300 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 2e 0d 0a 20 20 20 rom.the.given.control.path......
3320 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
3340 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 41 20 63 6f 6e 74 72 6f 6c 20 70 61 .<param.name="path">A.control.pa
3360 74 68 20 73 75 63 68 20 61 73 20 22 26 6c 74 3b 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 3e 7b 4c 65 th.such.as."&lt;XRController>{Le
3380 66 74 48 61 6e 64 7d 2f 70 6f 73 69 74 69 6f 6e 22 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 ftHand}/position".</param>......
33a0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 4c 61 79 6f 75 ....///.<param.name="deviceLayou
33c0 74 4e 61 6d 65 22 3e 52 65 63 65 69 76 65 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 tName">Receives.the.name.of.the.
33e0 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 74 68 61 74 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 70 device.layout.that.the.control.p
3400 61 74 68 20 77 61 73 20 72 65 73 6f 6c 76 65 64 20 74 6f 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ath.was.resolved.to...........//
3420 2f 20 54 68 69 73 20 69 73 20 75 73 65 66 75 6c 20 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 /.This.is.useful.</param>.......
3440 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 50 61 74 68 22 ...///.<param.name="controlPath"
3460 3e 52 65 63 65 69 76 65 73 20 74 68 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 72 65 66 65 72 65 >Receives.the.path.to.the.refere
3480 6e 63 65 64 20 63 6f 6e 74 72 6f 6c 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 6f 72 20 3c 63 nced.control.on.the.device.or.<c
34a0 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e 6f 74 20 61 70 70 6c 69 63 61 62 6c 65 2e 0d 0a 20 20 >null</c>.if.not.applicable.....
34c0 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 77 69 74 68 20 61 20 3c 70 ......///.For.example,.with.a.<p
34e0 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 20 6f 66 20 3c 63 3e 22 26 6c 74 aramref.name="path"/>.of.<c>"&lt
3500 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 64 70 61 64 2f 75 70 22 3c 2f 63 3e 2c 20 74 68 65 20 72 ;Gamepad&gt;/dpad/up"</c>,.the.r
3520 65 73 75 6c 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 0d 0a 20 20 20 20 20 20 20 20 2f esulting.control.path........../
3540 2f 2f 20 77 69 6c 6c 20 62 65 20 3c 63 3e 22 64 70 61 64 2f 75 70 22 3c 2f 63 3e 2e 20 54 68 69 //.will.be.<c>"dpad/up"</c>..Thi
3560 73 20 69 73 20 75 73 65 66 75 6c 20 77 68 65 6e 20 74 72 79 69 6e 67 20 74 6f 20 6c 6f 6f 6b 20 s.is.useful.when.trying.to.look.
3580 75 70 20 61 64 64 69 74 69 6f 6e 61 6c 20 72 65 73 6f 75 72 63 65 73 20 28 73 75 63 68 20 61 73 up.additional.resources.(such.as
35a0 20 69 6d 61 67 65 73 29 20 62 61 73 65 64 20 6f 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f .images).based.on.the........../
35c0 2f 2f 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 69 73 20 62 65 69 6e 67 20 72 65 66 65 72 65 6e //.control.that.is.being.referen
35e0 63 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d ced.</param>..........///.<param
3600 20 6e 61 6d 65 3d 22 6f 70 74 69 6f 6e 73 22 3e 43 75 73 74 6f 6d 69 7a 65 20 74 68 65 20 72 65 .name="options">Customize.the.re
3620 73 75 6c 74 69 6e 67 20 73 74 72 69 6e 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 sulting.string.</param>.........
3640 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 41 6e 20 6f 70 .///.<param.name="control">An.op
3660 74 69 6f 6e 61 6c 20 63 6f 6e 74 72 6f 6c 2e 20 49 66 20 73 75 70 70 6c 69 65 64 20 61 6e 64 20 tional.control..If.supplied.and.
3680 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6f 72 20 6f 6e 65 20 6f 66 20 69 74 73 20 63 68 69 6c 64 72 the.control.or.one.of.its.childr
36a0 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 74 63 68 65 73 20 74 68 65 20 67 69 76 65 en..........///.matches.the.give
36c0 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 2c 20 64 69 73 70 6c n.<paramref.name="path"/>,.displ
36e0 61 79 20 6e 61 6d 65 73 20 77 69 6c 6c 20 62 65 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 6d 61 ay.names.will.be.based.on.the.ma
3700 74 63 68 69 6e 67 20 63 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 61 74 68 tching.control..........///.rath
3720 65 72 20 74 68 61 6e 20 6f 6e 20 73 74 61 74 69 63 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 76 er.than.on.static.information.av
3740 61 69 6c 61 62 6c 65 20 66 72 6f 6d 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e ailable.from.<see.cref="InputCon
3760 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 trolLayout"/>s.</param>.........
3780 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 41 20 73 74 72 69 6e 67 20 73 75 63 68 20 61 73 20 22 .///.<returns>A.string.such.as."
37a0 4c 65 66 74 20 53 74 69 63 6b 2f 58 20 5b 47 61 6d 65 70 61 64 5d 22 2e 3c 2f 72 65 74 75 72 6e Left.Stick/X.[Gamepad]".</return
37c0 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 s>..........///.<remarks>.......
37e0 20 20 20 2f 2f 2f 20 54 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 6d 6f 73 74 20 75 73 65 ...///.This.function.is.most.use
3800 66 75 6c 20 66 6f 72 20 74 75 72 6e 69 6e 67 20 62 69 6e 64 69 6e 67 20 70 61 74 68 73 20 28 73 ful.for.turning.binding.paths.(s
3820 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 70 61 74 68 22 ee.<see.cref="InputBinding.path"
3840 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 74 6f 20 73 74 72 69 6e 67 73 20 74 68 />)..........///.into.strings.th
3860 61 74 20 63 61 6e 20 62 65 20 64 69 73 70 6c 61 79 65 64 20 69 6e 20 55 49 73 20 28 73 75 63 68 at.can.be.displayed.in.UIs.(such
3880 20 61 73 20 72 65 62 69 6e 64 69 6e 67 20 73 63 72 65 65 6e 73 29 2e 20 49 74 20 69 73 20 75 73 .as.rebinding.screens)..It.is.us
38a0 65 64 20 62 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 55 6e 69 74 79 20 65 64 69 ed.by..........///.the.Unity.edi
38c0 74 6f 72 20 69 74 73 65 6c 66 20 74 6f 20 64 69 73 70 6c 61 79 20 62 69 6e 64 69 6e 67 20 70 61 tor.itself.to.display.binding.pa
38e0 74 68 73 20 69 6e 20 74 68 65 20 55 49 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 ths.in.the.UI...........///.....
3900 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 6d 65 74 68 6f 64 20 75 73 65 73 20 64 69 73 70 6c 61 79 .....///.The.method.uses.display
3920 20 6e 61 6d 65 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 .names.(see.<see.cref="InputCont
3940 72 6f 6c 41 74 74 72 69 62 75 74 65 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 2c 0d 0a 20 20 rolAttribute.displayName"/>,....
3960 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f ......///.<see.cref="InputContro
3980 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 2c lLayoutAttribute.displayName"/>,
39a0 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f .and.<see.cref="InputControlLayo
39c0 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 29 0d 0a ut.ControlItem.displayName"/>)..
39e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 65 72 65 20 70 6f 73 73 69 62 6c 65 2e 20 46 6f 72 20 ........///.where.possible..For.
3a00 65 78 61 6d 70 6c 65 2c 20 22 26 6c 74 3b 58 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 6c 65 72 26 67 example,."&lt;XInputController&g
3a20 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64 t;/buttonSouth".will.be.returned
3a40 20 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 22 41 20 5b 58 62 6f 78 20 43 6f 6e 74 72 6f .as..........///."A.[Xbox.Contro
3a60 6c 6c 65 72 5d 22 20 61 73 20 74 68 65 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 20 6f 66 20 3c 73 ller]".as.the.display.name.of.<s
3a80 65 65 20 63 72 65 66 3d 22 58 49 6e 70 75 74 2e 58 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 6c 65 72 ee.cref="XInput.XInputController
3aa0 22 2f 3e 20 69 73 20 22 58 42 6f 78 20 43 6f 6e 74 72 6f 6c 6c 65 72 22 0d 0a 20 20 20 20 20 20 "/>.is."XBox.Controller"........
3ac0 20 20 2f 2f 2f 20 61 6e 64 20 74 68 65 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 20 6f 66 20 69 74 ..///.and.the.display.name.of.it
3ae0 73 20 22 62 75 74 74 6f 6e 53 6f 75 74 68 22 20 63 6f 6e 74 72 6f 6c 20 69 73 20 22 41 22 2e 0d s."buttonSouth".control.is."A"..
3b00 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 .........///..........///.Note.t
3b20 68 61 74 20 74 68 65 73 65 20 6c 6f 6f 6b 75 70 73 20 64 65 70 65 6e 64 20 6f 6e 20 74 68 65 20 hat.these.lookups.depend.on.the.
3b40 63 75 72 72 65 6e 74 6c 79 20 72 65 67 69 73 74 65 72 65 64 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 currently.registered.control.lay
3b60 6f 75 74 73 20 28 73 65 65 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 outs.(see.<see..........///.cref
3b80 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 29 20 61 6e 64 20 64 69 66 ="InputControlLayout"/>).and.dif
3ba0 66 65 72 65 6e 74 20 73 74 72 69 6e 67 73 20 6d 61 79 20 74 68 75 73 20 62 65 20 72 65 74 75 72 ferent.strings.may.thus.be.retur
3bc0 6e 65 64 20 66 6f 72 20 74 68 65 20 73 61 6d 65 20 63 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 ned.for.the.same.control........
3be0 20 20 2f 2f 2f 20 70 61 74 68 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68 65 20 6c 61 79 6f ..///.path.depending.on.the.layo
3c00 75 74 73 20 72 65 67 69 73 74 65 72 65 64 20 77 69 74 68 20 74 68 65 20 73 79 73 74 65 6d 2e 0d uts.registered.with.the.system..
3c20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 .........///..........///.<examp
3c40 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 le>..........///.<code>.........
3c60 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 .///.InputControlPath.ToHumanRea
3c80 64 61 62 6c 65 53 74 72 69 6e 67 28 22 2a 2f 7b 50 72 69 6d 61 72 79 41 63 74 69 6f 6e 22 29 3b dableString("*/{PrimaryAction");
3ca0 20 2f 2f 20 2d 3e 20 22 50 72 69 6d 61 72 79 41 63 74 69 6f 6e 20 5b 41 6e 79 5d 22 0d 0a 20 20 .//.->."PrimaryAction.[Any]"....
3cc0 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 6d ......///.InputControlPath.ToHum
3ce0 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 anReadableString("&lt;Gamepad&gt
3d00 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 20 2f 2f 20 2d 3e 20 22 42 75 74 74 6f 6e 20 53 ;/buttonSouth");.//.->."Button.S
3d20 6f 75 74 68 20 5b 47 61 6d 65 70 61 64 5d 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 outh.[Gamepad]"..........///.Inp
3d40 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 utControlPath.ToHumanReadableStr
3d60 69 6e 67 28 22 26 6c 74 3b 58 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 6c 65 72 26 67 74 3b 2f 62 75 ing("&lt;XInputController&gt;/bu
3d80 74 74 6f 6e 53 6f 75 74 68 22 29 3b 20 2f 2f 20 2d 3e 20 22 41 20 5b 58 62 6f 78 20 43 6f 6e 74 ttonSouth");.//.->."A.[Xbox.Cont
3da0 72 6f 6c 6c 65 72 5d 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 roller]"..........///.InputContr
3dc0 6f 6c 50 61 74 68 2e 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 22 26 6c olPath.ToHumanReadableString("&l
3de0 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 6c 65 66 74 53 74 69 63 6b 2f 78 22 29 3b 20 2f 2f 20 t;Gamepad&gt;/leftStick/x");.//.
3e00 2d 3e 20 22 4c 65 66 74 20 53 74 69 63 6b 2f 58 20 5b 47 61 6d 65 70 61 64 5d 22 0d 0a 20 20 20 ->."Left.Stick/X.[Gamepad]".....
3e20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f .....///.</code>..........///.</
3e40 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e example>..........///.</remarks>
3e60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 ..........///.<seealso.cref="Inp
3e80 75 74 42 69 6e 64 69 6e 67 2e 70 61 74 68 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c utBinding.path"/>..........///.<
3ea0 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 54 6f 44 69 73 seealso.cref="InputBinding.ToDis
3ec0 70 6c 61 79 53 74 72 69 6e 67 28 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 44 69 73 70 6c 61 79 53 playString(InputBinding.DisplayS
3ee0 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 29 22 2f 3e 0d 0a 20 tringOptions,InputControl)"/>...
3f00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 41 .......///.<seealso.cref="InputA
3f20 63 74 69 6f 6e 52 65 62 69 6e 64 69 6e 67 45 78 74 65 6e 73 69 6f 6e 73 2e 47 65 74 42 69 6e 64 ctionRebindingExtensions.GetBind
3f40 69 6e 67 44 69 73 70 6c 61 79 53 74 72 69 6e 67 28 49 6e 70 75 74 41 63 74 69 6f 6e 2c 69 6e 74 ingDisplayString(InputAction,int
3f60 2c 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 44 69 73 70 6c 61 79 53 74 72 69 6e 67 4f 70 74 69 6f ,InputBinding.DisplayStringOptio
3f80 6e 73 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 ns)"/>..........public.static.st
3fa0 72 69 6e 67 20 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 73 74 72 69 6e ring.ToHumanReadableString(strin
3fc0 67 20 70 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f 75 74 20 73 74 72 69 6e 67 20 g.path,..............out.string.
3fe0 64 65 76 69 63 65 4c 61 79 6f 75 74 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f deviceLayoutName,..............o
4000 75 74 20 73 74 72 69 6e 67 20 63 6f 6e 74 72 6f 6c 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 ut.string.controlPath,..........
4020 20 20 20 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 20 6f ....HumanReadableStringOptions.o
4040 70 74 69 6f 6e 73 20 3d 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 ptions.=.HumanReadableStringOpti
4060 6f 6e 73 2e 4e 6f 6e 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 43 6f 6e 74 ons.None,..............InputCont
4080 72 6f 6c 20 63 6f 6e 74 72 6f 6c 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a rol.control.=.null)..........{..
40a0 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 6e ............deviceLayoutName.=.n
40c0 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 50 61 74 68 20 3d 20 ull;..............controlPath.=.
40e0 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e null;................if.(string.
4100 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 70 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 IsNullOrEmpty(path))............
4120 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 3b 0d 0a 0d 0a 20 20 ......return.string.Empty;......
4140 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 63 6f 6e 74 72 6f ..........//.If.we.have.a.contro
4160 6c 2c 20 73 65 65 20 69 66 20 74 68 65 20 70 61 74 68 20 6d 61 74 63 68 65 73 20 73 6f 6d 65 74 l,.see.if.the.path.matches.somet
4180 68 69 6e 67 20 69 6e 20 69 74 73 20 68 69 65 72 61 72 63 68 79 2e 20 49 66 20 73 6f 2c 0d 0a 20 hing.in.its.hierarchy..If.so,...
41a0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 64 6f 6e 27 74 20 62 6f 74 68 20 70 61 72 73 69 6e 67 ...........//.don't.both.parsing
41c0 20 74 68 65 20 70 61 74 68 20 61 6e 64 20 6a 75 73 74 20 75 73 65 20 74 68 65 20 6d 61 74 63 68 .the.path.and.just.use.the.match
41e0 65 64 20 63 6f 6e 74 72 6f 6c 20 66 6f 72 20 63 72 65 61 74 69 6e 67 20 61 20 64 69 73 70 6c 61 ed.control.for.creating.a.displa
4200 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 y..............//.string........
4220 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 .......if.(control.!=.null).....
4240 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 72 20 .........{..................var.
4260 63 68 69 6c 64 43 6f 6e 74 72 6f 6c 20 3d 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 28 63 6f childControl.=.TryFindControl(co
4280 6e 74 72 6f 6c 2c 20 70 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 ntrol,.path);..................v
42a0 61 72 20 6d 61 74 63 68 65 64 43 6f 6e 74 72 6f 6c 20 3d 20 63 68 69 6c 64 43 6f 6e 74 72 6f 6c ar.matchedControl.=.childControl
42c0 20 3f 3f 20 28 4d 61 74 63 68 65 73 28 70 61 74 68 2c 20 63 6f 6e 74 72 6f 6c 29 20 3f 20 63 6f .??.(Matches(path,.control).?.co
42e0 6e 74 72 6f 6c 20 3a 20 6e 75 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntrol.:.null);..................
4300 20 20 69 66 20 28 6d 61 74 63 68 65 64 43 6f 6e 74 72 6f 6c 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 ..if.(matchedControl.!=.null)...
4320 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 20 ...............{................
4340 20 20 20 20 20 20 76 61 72 20 74 65 78 74 20 3d 20 28 6f 70 74 69 6f 6e 73 20 26 20 48 75 6d 61 ......var.text.=.(options.&.Huma
4360 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 55 73 65 53 68 6f 72 74 4e nReadableStringOptions.UseShortN
4380 61 6d 65 73 29 20 21 3d 20 30 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ames).!=.0.&&...................
43a0 20 20 20 20 20 20 20 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6d 61 74 .......!string.IsNullOrEmpty(mat
43c0 63 68 65 64 43 6f 6e 74 72 6f 6c 2e 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 29 0d 0a 20 chedControl.shortDisplayName)...
43e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6d 61 74 63 68 65 64 .......................?.matched
4400 43 6f 6e 74 72 6f 6c 2e 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 0d 0a 20 20 20 20 20 20 Control.shortDisplayName........
4420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 6d 61 74 63 68 65 64 43 6f 6e 74 72 ..................:.matchedContr
4440 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;.................
4460 20 20 20 20 20 20 20 69 66 20 28 28 6f 70 74 69 6f 6e 73 20 26 20 48 75 6d 61 6e 52 65 61 64 61 .......if.((options.&.HumanReada
4480 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 4f 6d 69 74 44 65 76 69 63 65 29 20 3d 3d 20 bleStringOptions.OmitDevice).==.
44a0 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 74 65 78 74 0)..........................text
44c0 20 3d 20 24 22 7b 74 65 78 74 7d 20 5b 7b 6d 61 74 63 68 65 64 43 6f 6e 74 72 6f 6c 2e 64 65 76 .=.$"{text}.[{matchedControl.dev
44e0 69 63 65 2e 64 69 73 70 6c 61 79 4e 61 6d 65 7d 5d 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ice.displayName}]";.............
4500 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 6d 61 ...........deviceLayoutName.=.ma
4520 74 63 68 65 64 43 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2e 6c 61 79 6f 75 74 3b 0d 0a 20 20 20 tchedControl.device.layout;.....
4540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 6d 61 74 63 68 65 64 43 6f .................if.(!(matchedCo
4560 6e 74 72 6f 6c 20 69 73 20 49 6e 70 75 74 44 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 20 ntrol.is.InputDevice))..........
4580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 50 61 74 68 20 3d 20 6d 61 ................controlPath.=.ma
45a0 74 63 68 65 64 43 6f 6e 74 72 6f 6c 2e 70 61 74 68 2e 53 75 62 73 74 72 69 6e 67 28 6d 61 74 63 tchedControl.path.Substring(matc
45c0 68 65 64 43 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2e 70 61 74 68 2e 4c 65 6e 67 74 68 20 2b 20 hedControl.device.path.Length.+.
45e0 31 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 72 65 74 75 72 1);........................retur
4600 6e 20 74 65 78 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 n.text;..................}......
4620 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 76 61 72 20 62 75 66 ........}................var.buf
4640 66 65 72 20 3d 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 fer.=.new.StringBuilder();......
4660 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 73 65 72 20 3d 20 6e 65 77 20 50 61 74 68 50 61 72 ........var.parser.=.new.PathPar
4680 73 65 72 28 70 61 74 68 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 6f 72 ser(path);................//.For
46a0 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 20 6f 66 20 63 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 64 .display.names.of.controls.and.d
46c0 65 76 69 63 65 73 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 6c 6f 6f 6b 20 61 74 20 49 6e 70 75 74 evices,.we.need.to.look.at.Input
46e0 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ControlLayouts...............//.
4700 49 66 20 6e 6f 6e 65 20 69 73 20 69 6e 20 70 6c 61 63 65 20 68 65 72 65 2c 20 77 65 20 65 73 74 If.none.is.in.place.here,.we.est
4720 61 62 6c 69 73 68 20 61 20 74 65 6d 70 6f 72 61 72 79 20 6c 61 79 6f 75 74 20 63 61 63 68 65 20 ablish.a.temporary.layout.cache.
4740 77 68 69 6c 65 20 77 65 20 67 6f 20 74 68 72 6f 75 67 68 0d 0a 20 20 20 20 20 20 20 20 20 20 20 while.we.go.through.............
4760 20 2f 2f 20 74 68 65 20 70 61 74 68 2e 20 49 66 20 6f 6e 65 20 69 73 20 69 6e 20 70 6c 61 63 65 .//.the.path..If.one.is.in.place
4780 20 61 6c 72 65 61 64 79 2c 20 77 65 20 72 65 75 73 65 20 77 68 61 74 27 73 20 61 6c 72 65 61 64 .already,.we.reuse.what's.alread
47a0 79 20 74 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 28 49 6e 70 y.there...............using.(Inp
47c0 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 61 63 68 65 52 65 66 28 29 29 0d 0a 20 20 20 utControlLayout.CacheRef()).....
47e0 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 46 .........{..................//.F
4800 69 72 73 74 20 6c 65 76 65 6c 20 69 73 20 74 61 6b 65 6e 20 74 6f 20 62 65 20 64 65 76 69 63 65 irst.level.is.taken.to.be.device
4820 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 73 65 72 2e 4d 6f ...................if.(parser.Mo
4840 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 veToNextComponent())............
4860 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 20 20 2f 2f 20 ......{......................//.
4880 4b 65 65 70 20 74 72 61 63 6b 20 6f 66 20 77 68 69 63 68 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f Keep.track.of.which.control.layo
48a0 75 74 20 77 65 27 72 65 20 6f 6e 20 28 69 66 20 61 6e 79 29 20 61 73 20 77 65 27 72 65 20 63 72 ut.we're.on.(if.any).as.we're.cr
48c0 61 77 6c 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 64 awling......................//.d
48e0 6f 77 6e 20 74 68 65 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 own.the.path....................
4900 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 54 ...var.device.=.parser.current.T
4920 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 6e 75 6c 6c 2c 20 6e 75 6c 6c 2c oHumanReadableString(null,.null,
4940 20 6f 75 74 20 76 61 72 20 63 75 72 72 65 6e 74 4c 61 79 6f 75 74 4e 61 6d 65 2c 20 6f 75 74 20 .out.var.currentLayoutName,.out.
4960 76 61 72 20 5f 2c 20 6f 70 74 69 6f 6e 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 var._,.options);................
4980 20 20 20 20 20 20 64 65 76 69 63 65 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 63 75 72 72 65 6e 74 ......deviceLayoutName.=.current
49a0 4c 61 79 6f 75 74 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 LayoutName;.....................
49c0 20 20 20 2f 2f 20 41 6e 79 20 61 64 64 69 74 69 6f 6e 61 6c 20 6c 65 76 65 6c 73 20 28 69 66 20 ...//.Any.additional.levels.(if.
49e0 70 72 65 73 65 6e 74 29 20 61 72 65 20 74 61 6b 65 6e 20 74 6f 20 66 6f 72 6d 20 61 20 63 6f 6e present).are.taken.to.form.a.con
4a00 74 72 6f 6c 20 70 61 74 68 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 trol.path.on.the.device.........
4a20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 73 46 69 72 73 74 43 6f 6e 74 72 6f 6c ..............var.isFirstControl
4a40 4c 65 76 65 6c 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Level.=.true;...................
4a60 20 20 20 77 68 69 6c 65 20 28 70 61 72 73 65 72 2e 4d 6f 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f ...while.(parser.MoveToNextCompo
4a80 6e 65 6e 74 28 29 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 nent())......................{..
4aa0 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 21 69 73 46 ........................if.(!isF
4ac0 69 72 73 74 43 6f 6e 74 72 6f 6c 4c 65 76 65 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 irstControlLevel)...............
4ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 66 66 65 72 2e 41 70 70 65 6e 64 28 27 2f 27 ...............buffer.Append('/'
4b00 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 20 20 20 20 62 75 );............................bu
4b20 66 66 65 72 2e 41 70 70 65 6e 64 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 54 6f 48 75 6d ffer.Append(parser.current.ToHum
4b40 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 anReadableString(...............
4b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 4c 61 79 6f 75 74 4e 61 6d 65 ...............currentLayoutName
4b80 2c 20 63 6f 6e 74 72 6f 6c 50 61 74 68 2c 20 6f 75 74 20 63 75 72 72 65 6e 74 4c 61 79 6f 75 74 ,.controlPath,.out.currentLayout
4ba0 4e 61 6d 65 2c 20 6f 75 74 20 63 6f 6e 74 72 6f 6c 50 61 74 68 2c 20 6f 70 74 69 6f 6e 73 29 29 Name,.out.controlPath,.options))
4bc0 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 73 46 69 72 ;..........................isFir
4be0 73 74 43 6f 6e 74 72 6f 6c 4c 65 76 65 6c 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 stControlLevel.=.false;.........
4c00 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 20 20 .............}..................
4c20 20 20 20 20 20 20 69 66 20 28 28 6f 70 74 69 6f 6e 73 20 26 20 48 75 6d 61 6e 52 65 61 64 61 62 ......if.((options.&.HumanReadab
4c40 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 4f 6d 69 74 44 65 76 69 63 65 29 20 3d 3d 20 30 leStringOptions.OmitDevice).==.0
4c60 20 26 26 20 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 64 65 76 69 63 65 .&&.!string.IsNullOrEmpty(device
4c80 29 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 20 20 ))......................{.......
4ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 66 66 65 72 2e 41 70 70 65 6e 64 ...................buffer.Append
4cc0 28 22 20 5b 22 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 (".[");.........................
4ce0 20 62 75 66 66 65 72 2e 41 70 70 65 6e 64 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 .buffer.Append(device);.........
4d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 66 66 65 72 2e 41 70 70 65 6e 64 28 27 .................buffer.Append('
4d20 5d 27 29 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 20 20 20 ]');......................}.....
4d40 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 20 20 .............}..................
4d60 20 20 2f 2f 20 49 66 20 77 65 20 64 69 64 6e 27 74 20 6d 61 6e 61 67 65 20 74 6f 20 66 69 67 75 ..//.If.we.didn't.manage.to.figu
4d80 72 65 20 6f 75 74 20 61 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 2c 20 64 65 66 61 75 6c 74 20 74 re.out.a.display.name,.default.t
4da0 6f 20 64 69 73 70 6c 61 79 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f o.displaying..................//
4dc0 20 74 68 65 20 70 61 74 68 20 61 73 20 69 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .the.path.as.is.................
4de0 20 20 69 66 20 28 62 75 66 66 65 72 2e 4c 65 6e 67 74 68 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 ..if.(buffer.Length.==.0).......
4e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 74 68 3b 0d 0a 0d 0a 20 ...............return.path;.....
4e20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 62 75 66 66 65 72 2e 54 6f 53 ...............return.buffer.ToS
4e40 74 72 69 6e 67 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 tring();..............}.........
4e60 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 69 .}............public.static.stri
4e80 6e 67 5b 5d 20 54 72 79 47 65 74 44 65 76 69 63 65 55 73 61 67 65 73 28 73 74 72 69 6e 67 20 70 ng[].TryGetDeviceUsages(string.p
4ea0 61 74 68 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 69 66 20 ath)..........{..............if.
4ec0 28 70 61 74 68 20 3d 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 (path.==.null)..................
4ee0 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 throw.new.ArgumentNullException(
4f00 6e 61 6d 65 6f 66 28 70 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 nameof(path));................va
4f20 72 20 70 61 72 73 65 72 20 3d 20 6e 65 77 20 50 61 74 68 50 61 72 73 65 72 28 70 61 74 68 29 3b r.parser.=.new.PathParser(path);
4f40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 70 61 72 73 65 72 2e 4d 6f 76 65 54 6f ..............if.(!parser.MoveTo
4f60 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 NextComponent())................
4f80 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ..return.null;................if
4fa0 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 20 21 3d 20 6e 75 6c 6c 20 .(parser.current.usages.!=.null.
4fc0 26 26 20 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 2e 4c 65 6e 67 74 68 20 &&.parser.current.usages.Length.
4fe0 3e 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)..............{.............
5000 20 20 20 20 20 72 65 74 75 72 6e 20 41 72 72 61 79 2e 43 6f 6e 76 65 72 74 41 6c 6c 28 70 61 72 .....return.Array.ConvertAll(par
5020 73 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 2c 20 69 20 3d 3e 20 7b 20 72 65 74 75 72 ser.current.usages,.i.=>.{.retur
5040 6e 20 69 2e 54 6f 53 74 72 69 6e 67 28 29 3b 20 7d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n.i.ToString();.});.............
5060 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a .}................return.null;..
5080 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ........}............///.<summar
50a0 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 63 y>..........///.From.the.given.c
50c0 6f 6e 74 72 6f 6c 20 70 61 74 68 2c 20 74 72 79 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 74 68 ontrol.path,.try.to.determine.th
50e0 65 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 62 65 69 6e 67 20 75 73 65 64 2e 0d 0a 20 20 20 e.device.layout.being.used......
5100 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
5120 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 66 75 6e .<remarks>..........///.This.fun
5140 63 74 69 6f 6e 20 77 69 6c 6c 20 6f 6e 6c 79 20 75 73 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 ction.will.only.use.information.
5160 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 74 68 65 20 70 61 74 68 20 69 74 73 65 6c 66 20 6f 72 0d available.in.the.path.itself.or.
5180 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 6c 61 79 6f 75 74 73 20 72 65 66 65 72 65 6e 63 .........///.in.layouts.referenc
51a0 65 64 20 62 79 20 74 68 65 20 70 61 74 68 2e 20 49 74 20 77 69 6c 6c 20 6e 6f 74 20 6c 6f 6f 6b ed.by.the.path..It.will.not.look
51c0 20 61 74 20 61 63 74 75 61 6c 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .at.actual.devices..........///.
51e0 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 20 54 68 69 73 20 69 73 20 74 6f 20 6d 61 6b 65 20 74 in.the.system..This.is.to.make.t
5200 68 65 20 62 65 68 61 76 69 6f 72 20 70 72 65 64 69 63 74 61 62 6c 65 20 61 6e 64 20 6e 6f 74 20 he.behavior.predictable.and.not.
5220 64 65 70 65 6e 64 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 20 77 68 65 74 68 65 dependent..........///.on.whethe
5240 72 20 79 6f 75 20 63 75 72 72 65 6e 74 6c 79 20 68 61 76 65 20 74 68 65 20 72 69 67 68 74 20 64 r.you.currently.have.the.right.d
5260 65 76 69 63 65 20 63 6f 6e 6e 65 63 74 65 64 20 6f 72 20 6e 6f 74 2e 0d 0a 20 20 20 20 20 20 20 evice.connected.or.not..........
5280 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 .///.</remarks>..........///.<pa
52a0 72 61 6d 20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 41 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 20 28 ram.name="path">A.control.path.(
52c0 6c 69 6b 65 20 22 2f 26 6c 74 3b 67 61 6d 65 70 61 64 26 67 74 3b 2f 6c 65 66 74 53 74 69 63 6b like."/&lt;gamepad&gt;/leftStick
52e0 22 29 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 ")</param>..........///.<returns
5300 3e 54 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 75 >The.name.of.the.device.layout.u
5320 73 65 64 20 62 79 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 20 6f 72 sed.by.the.given.control.path.or
5340 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 66 20 74 68 65 20 70 61 74 68 20 64 .null..........///.if.the.path.d
5360 6f 65 73 20 6e 6f 74 20 73 70 65 63 69 66 79 20 61 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 20 oes.not.specify.a.device.layout.
5380 6f 72 20 64 6f 65 73 20 73 6f 20 69 6e 20 61 20 77 61 79 20 74 68 61 74 20 69 73 20 6e 6f 74 0d or.does.so.in.a.way.that.is.not.
53a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 74 68 65 20 66 75 .........///.supported.by.the.fu
53c0 6e 63 74 69 6f 6e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c nction.</returns>..........///.<
53e0 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 exception.cref="ArgumentNullExce
5400 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 20 69 ption"><paramref.name="path"/>.i
5420 73 20 6e 75 6c 6c 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 s.null</exception>..........///.
5440 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 <example>..........///.<code>...
5460 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 47 .......///.InputControlPath.TryG
5480 65 74 44 65 76 69 63 65 4c 61 79 6f 75 74 28 22 2f 26 6c 74 3b 67 61 6d 65 70 61 64 26 67 74 3b etDeviceLayout("/&lt;gamepad&gt;
54a0 2f 6c 65 66 74 53 74 69 63 6b 22 29 3b 20 2f 2f 20 52 65 74 75 72 6e 73 20 22 67 61 6d 65 70 61 /leftStick");.//.Returns."gamepa
54c0 64 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 d"...........///.InputControlPat
54e0 68 2e 54 72 79 47 65 74 44 65 76 69 63 65 4c 61 79 6f 75 74 28 22 2f 2a 2f 6c 65 66 74 53 74 69 h.TryGetDeviceLayout("/*/leftSti
5500 63 6b 22 29 3b 20 2f 2f 20 52 65 74 75 72 6e 73 20 22 2a 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f ck");.//.Returns."*".........../
5520 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 47 65 74 44 65 76 69 63 65 //.InputControlPath.TryGetDevice
5540 4c 61 79 6f 75 74 28 22 2f 67 61 6d 65 70 61 64 2f 6c 65 66 74 53 74 69 63 6b 22 29 3b 20 2f 2f Layout("/gamepad/leftStick");.//
5560 20 52 65 74 75 72 6e 73 20 6e 75 6c 6c 2e 20 22 67 61 6d 65 70 61 64 22 20 69 73 20 61 20 64 65 .Returns.null.."gamepad".is.a.de
5580 76 69 63 65 20 6e 61 6d 65 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 vice.name.here...........///.</c
55a0 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 ode>..........///.</example>....
55c0 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 54 72 79 47 65 ......public.static.string.TryGe
55e0 74 44 65 76 69 63 65 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 tDeviceLayout(string.path)......
5600 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 74 68 20 3d 3d 20 6e ....{..............if.(path.==.n
5620 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.
5640 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 70 61 74 ArgumentNullException(nameof(pat
5660 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 73 65 72 20 3d h));................var.parser.=
5680 20 6e 65 77 20 50 61 74 68 50 61 72 73 65 72 28 70 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 .new.PathParser(path);..........
56a0 20 20 20 20 69 66 20 28 21 70 61 72 73 65 72 2e 4d 6f 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e ....if.(!parser.MoveToNextCompon
56c0 65 6e 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e ent())..................return.n
56e0 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 73 65 72 2e 63 ull;................if.(parser.c
5700 75 72 72 65 6e 74 2e 6c 61 79 6f 75 74 2e 6c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 20 20 20 20 urrent.layout.length.>.0).......
5720 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 ...........return.parser.current
5740 2e 6c 61 79 6f 75 74 2e 54 6f 53 74 72 69 6e 67 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .layout.ToString();.............
5760 20 20 20 69 66 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 69 73 57 69 6c 64 63 61 72 64 ...if.(parser.current.isWildcard
5780 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 57 69 6c 64 63 61 )..................return.Wildca
57a0 72 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d rd;................return.null;.
57c0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 .........}............////TODO:.
57e0 72 65 74 75 72 6e 20 53 75 62 73 74 72 69 6e 67 20 61 6e 64 20 75 73 65 20 70 61 74 68 20 70 61 return.Substring.and.use.path.pa
5800 72 73 65 72 3b 20 73 68 6f 75 6c 64 20 67 65 74 20 72 69 64 20 6f 66 20 61 6c 6c 6f 63 61 74 69 rser;.should.get.rid.of.allocati
5820 6f 6e 73 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 46 72 6f 6d 20 74 68 65 20 67 69 76 65 6e ons............//.From.the.given
5840 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 2c 20 74 72 79 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 .control.path,.try.to.determine.
5860 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 20 62 65 69 6e 67 20 75 73 65 64 2e 0d 0a the.control.layout.being.used...
5880 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 41 6c 6c 6f 63 61 74 65 73 21 0d 0a 20 20 20 ........//.NOTE:.Allocates!.....
58a0 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 54 72 79 47 65 74 .....public.static.string.TryGet
58c0 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 ControlLayout(string.path)......
58e0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 74 68 20 3d 3d 20 6e ....{..............if.(path.==.n
5900 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.
5920 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 70 61 74 ArgumentNullException(nameof(pat
5940 68 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 4c 65 6e 67 74 68 h));..............var.pathLength
5960 20 3d 20 70 61 74 68 2e 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 .=.path.Length;................v
5980 61 72 20 69 6e 64 65 78 4f 66 4c 61 73 74 53 6c 61 73 68 20 3d 20 70 61 74 68 2e 4c 61 73 74 49 ar.indexOfLastSlash.=.path.LastI
59a0 6e 64 65 78 4f 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 ndexOf('/');..............if.(in
59c0 64 65 78 4f 66 4c 61 73 74 53 6c 61 73 68 20 3d 3d 20 2d 31 20 7c 7c 20 69 6e 64 65 78 4f 66 4c dexOfLastSlash.==.-1.||.indexOfL
59e0 61 73 74 53 6c 61 73 68 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 astSlash.==.0)..............{...
5a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 72 65 27 73 20 6e 6f 20 ...............//.If.there's.no.
5a20 27 2f 27 20 61 74 20 61 6c 6c 20 69 6e 20 74 68 65 20 70 61 74 68 2c 20 69 74 20 73 75 72 65 6c '/'.at.all.in.the.path,.it.surel
5a40 79 20 64 6f 65 73 20 6e 6f 74 20 6d 65 6e 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 y.does.not.mention..............
5a60 20 20 20 20 2f 2f 20 61 20 63 6f 6e 74 72 6f 6c 2e 20 53 61 6d 65 20 69 66 20 74 68 65 20 27 2f ....//.a.control..Same.if.the.'/
5a80 27 20 69 73 20 74 68 65 20 66 69 72 73 74 20 74 68 69 6e 67 20 69 6e 20 74 68 65 20 70 61 74 68 '.is.the.first.thing.in.the.path
5aa0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d ...................return.null;.
5ac0 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 .............}................//
5ae0 20 53 69 6d 70 6c 65 73 74 20 63 61 73 65 20 77 68 65 72 65 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 .Simplest.case.where.control.lay
5b00 6f 75 74 20 69 73 20 6d 65 6e 74 69 6f 6e 65 64 20 65 78 70 6c 69 63 69 74 6c 79 20 77 69 74 68 out.is.mentioned.explicitly.with
5b20 20 27 3c 2e 2e 3e 27 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 65 20 74 68 .'<..>'...............//.Note.th
5b40 69 73 20 77 69 6c 6c 20 6f 6e 6c 79 20 63 61 74 63 68 20 69 66 20 74 68 65 20 63 6f 6e 74 72 6f is.will.only.catch.if.the.contro
5b60 6c 20 69 73 20 2a 6f 6e 6c 79 2a 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 6c 61 79 6f 75 74 l.is.*only*.referenced.by.layout
5b80 20 61 6e 64 20 6e 6f 74 20 62 79 20 61 6e 79 74 68 69 6e 67 20 65 6c 73 65 0d 0a 20 20 20 20 20 .and.not.by.anything.else.......
5ba0 20 20 20 20 20 20 20 2f 2f 20 69 6e 20 61 64 64 69 74 69 6f 6e 20 28 6c 69 6b 65 20 75 73 61 67 .......//.in.addition.(like.usag
5bc0 65 20 6f 72 20 6e 61 6d 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 74 e.or.name)...............if.(pat
5be0 68 4c 65 6e 67 74 68 20 3e 20 69 6e 64 65 78 4f 66 4c 61 73 74 53 6c 61 73 68 20 2b 20 32 20 26 hLength.>.indexOfLastSlash.+.2.&
5c00 26 20 70 61 74 68 5b 69 6e 64 65 78 4f 66 4c 61 73 74 53 6c 61 73 68 20 2b 20 31 5d 20 3d 3d 20 &.path[indexOfLastSlash.+.1].==.
5c20 27 3c 27 20 26 26 20 70 61 74 68 5b 70 61 74 68 4c 65 6e 67 74 68 20 2d 20 31 5d 20 3d 3d 20 27 '<'.&&.path[pathLength.-.1].==.'
5c40 3e 27 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 >')..............{..............
5c60 20 20 20 20 76 61 72 20 6c 61 79 6f 75 74 4e 61 6d 65 53 74 61 72 74 20 3d 20 69 6e 64 65 78 4f ....var.layoutNameStart.=.indexO
5c80 66 4c 61 73 74 53 6c 61 73 68 20 2b 20 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 fLastSlash.+.2;.................
5ca0 20 76 61 72 20 6c 61 79 6f 75 74 4e 61 6d 65 4c 65 6e 67 74 68 20 3d 20 70 61 74 68 4c 65 6e 67 .var.layoutNameLength.=.pathLeng
5cc0 74 68 20 2d 20 6c 61 79 6f 75 74 4e 61 6d 65 53 74 61 72 74 20 2d 20 31 3b 0d 0a 20 20 20 20 20 th.-.layoutNameStart.-.1;.......
5ce0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 74 68 2e 53 75 62 73 74 72 69 6e 67 ...........return.path.Substring
5d00 28 6c 61 79 6f 75 74 4e 61 6d 65 53 74 61 72 74 2c 20 6c 61 79 6f 75 74 4e 61 6d 65 4c 65 6e 67 (layoutNameStart,.layoutNameLeng
5d20 74 68 29 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 th);..............}.............
5d40 20 20 20 2f 2f 20 48 61 76 65 20 74 6f 20 61 63 74 75 61 6c 6c 79 20 6c 6f 6f 6b 20 61 74 20 74 ...//.Have.to.actually.look.at.t
5d60 68 65 20 70 61 74 68 20 69 6e 20 64 65 74 61 69 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 he.path.in.detail...............
5d80 76 61 72 20 70 61 72 73 65 72 20 3d 20 6e 65 77 20 50 61 74 68 50 61 72 73 65 72 28 70 61 74 68 var.parser.=.new.PathParser(path
5da0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 70 61 72 73 65 72 2e 4d 6f 76 65 );..............if.(!parser.Move
5dc0 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ToNextComponent())..............
5de0 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ....return.null;................
5e00 69 66 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 69 73 57 69 6c 64 63 61 72 64 29 0d 0a if.(parser.current.isWildcard)..
5e20 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 4e 6f 74 49 6d 70 ................throw.new.NotImp
5e40 6c 65 6d 65 6e 74 65 64 45 78 63 65 70 74 69 6f 6e 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 lementedException();............
5e60 20 20 20 20 69 66 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 6c 61 79 6f 75 74 2e 6c 65 ....if.(parser.current.layout.le
5e80 6e 67 74 68 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 65 74 75 ngth.==.0)..................retu
5ea0 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 rn.null;................var.devi
5ec0 63 65 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 6c 61 ceLayoutName.=.parser.current.la
5ee0 79 6f 75 74 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 69 66 yout.ToString();..............if
5f00 20 28 21 70 61 72 73 65 72 2e 4d 6f 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 29 .(!parser.MoveToNextComponent())
5f20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 20 2f ..................return.null;./
5f40 2f 20 4e 6f 20 63 6f 6e 74 72 6f 6c 20 63 6f 6d 70 6f 6e 65 6e 74 2e 0d 0a 0d 0a 20 20 20 20 20 /.No.control.component..........
5f60 20 20 20 20 20 20 20 69 66 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 69 73 57 69 6c 64 .......if.(parser.current.isWild
5f80 63 61 72 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 57 69 card)..................return.Wi
5fa0 6c 64 63 61 72 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 46 69 ldcard;................return.Fi
5fc0 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 52 65 63 75 72 73 69 76 65 28 72 65 66 20 70 61 72 ndControlLayoutRecursive(ref.par
5fe0 73 65 72 2c 20 64 65 76 69 63 65 4c 61 79 6f 75 74 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 ser,.deviceLayoutName);.........
6000 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 69 63 20 73 74 72 .}............private.static.str
6020 69 6e 67 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 52 65 63 75 72 73 69 76 65 28 72 ing.FindControlLayoutRecursive(r
6040 65 66 20 50 61 74 68 50 61 72 73 65 72 20 70 61 72 73 65 72 2c 20 73 74 72 69 6e 67 20 6c 61 79 ef.PathParser.parser,.string.lay
6060 6f 75 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 20 20 outName)..........{.............
6080 20 75 73 69 6e 67 20 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 61 63 68 65 .using.(InputControlLayout.Cache
60a0 52 65 66 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 Ref())..............{...........
60c0 20 20 20 20 20 20 20 2f 2f 20 4c 6f 61 64 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 .......//.Load.layout...........
60e0 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 79 6f 75 74 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f ........var.layout.=.InputContro
6100 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 28 6e lLayout.cache.FindOrLoadLayout(n
6120 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 6c 61 79 6f 75 74 4e 61 6d 65 29 2c 20 74 ew.InternedString(layoutName),.t
6140 68 72 6f 77 49 66 4e 6f 74 46 6f 75 6e 64 3a 20 66 61 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 20 hrowIfNotFound:.false);.........
6160 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 61 79 6f 75 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 .........if.(layout.==.null)....
6180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a ..................return.null;..
61a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 61 72 63 68 20 66 6f 72 20 ..................//.Search.for.
61c0 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 2e 20 4d 61 79 20 68 61 76 65 20 74 6f 20 6a 75 6d 70 control.layout..May.have.to.jump
61e0 20 74 6f 20 6f 74 68 65 72 20 6c 61 79 6f 75 74 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .to.other.layouts...............
6200 20 20 20 2f 2f 20 61 6e 64 20 73 65 61 72 63 68 20 69 6e 20 74 68 65 6d 2e 0d 0a 20 20 20 20 20 ...//.and.search.in.them........
6220 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 ...........return.FindControlLay
6240 6f 75 74 52 65 63 75 72 73 69 76 65 28 72 65 66 20 70 61 72 73 65 72 2c 20 6c 61 79 6f 75 74 29 outRecursive(ref.parser,.layout)
6260 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 20 ;..............}..........}.....
6280 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 46 69 6e .......private.static.string.Fin
62a0 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 52 65 63 75 72 73 69 76 65 28 72 65 66 20 50 61 74 68 dControlLayoutRecursive(ref.Path
62c0 50 61 72 73 65 72 20 70 61 72 73 65 72 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 Parser.parser,.InputControlLayou
62e0 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 20 20 t.layout)..........{............
6300 20 20 73 74 72 69 6e 67 20 63 75 72 72 65 6e 74 52 65 73 75 6c 74 20 3d 20 6e 75 6c 6c 3b 0d 0a ..string.currentResult.=.null;..
6320 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 43 6f 75 6e 74 20 3d ..............var.controlCount.=
6340 20 6c 61 79 6f 75 74 2e 63 6f 6e 74 72 6f 6c 73 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 .layout.controls.Count;.........
6360 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 6e 74 72 6f 6c .....for.(var.i.=.0;.i.<.control
6380 43 6f 75 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 Count;.++i)..............{......
63a0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 73 68 6f 72 74 63 75 74 20 74 ............////TODO:.shortcut.t
63c0 68 65 20 73 65 61 72 63 68 20 69 66 20 77 65 20 68 61 76 65 20 61 20 6d 61 74 63 68 20 61 6e 64 he.search.if.we.have.a.match.and
63e0 20 74 68 65 72 65 27 73 20 6e 6f 20 77 69 6c 64 63 61 72 64 73 20 74 6f 20 63 6f 6e 73 69 64 65 .there's.no.wildcards.to.conside
6400 72 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 r....................//.Skip.con
6420 74 72 6f 6c 20 6c 61 79 6f 75 74 20 69 66 20 69 74 20 64 6f 65 73 6e 27 74 20 6d 61 74 63 68 2e trol.layout.if.it.doesn't.match.
6440 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 43 6f 6e 74 72 6f 6c 4c 61 ..................if.(!ControlLa
6460 79 6f 75 74 4d 61 74 63 68 65 73 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 72 65 66 20 6c 61 79 youtMatchesPathComponent(ref.lay
6480 6f 75 74 2e 6d 5f 43 6f 6e 74 72 6f 6c 73 5b 69 5d 2c 20 72 65 66 20 70 61 72 73 65 72 29 29 0d out.m_Controls[i],.ref.parser)).
64a0 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;..
64c0 0d 0a 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 6c 4c 61 79 ..................var.controlLay
64e0 6f 75 74 4e 61 6d 65 20 3d 20 6c 61 79 6f 75 74 2e 6d 5f 43 6f 6e 74 72 6f 6c 73 5b 69 5d 2e 6c outName.=.layout.m_Controls[i].l
6500 61 79 6f 75 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 ayout;....................//.If.
6520 74 68 65 72 65 27 73 20 6d 6f 72 65 20 69 6e 20 74 68 65 20 70 61 74 68 2c 20 74 72 79 20 74 6f there's.more.in.the.path,.try.to
6540 20 64 69 76 65 20 69 6e 74 6f 20 63 68 69 6c 64 72 65 6e 20 62 79 20 6a 75 6d 70 69 6e 67 20 74 .dive.into.children.by.jumping.t
6560 6f 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 6f 6e 74 72 6f o.the..................//.contro
6580 6c 27 73 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 l's.layout...................if.
65a0 28 21 70 61 72 73 65 72 2e 69 73 41 74 45 6e 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 (!parser.isAtEnd)...............
65c0 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 76 61 72 20 63 68 ...{......................var.ch
65e0 69 6c 64 50 61 74 68 50 61 72 73 65 72 20 3d 20 70 61 72 73 65 72 3b 0d 0a 20 20 20 20 20 20 20 ildPathParser.=.parser;.........
6600 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 50 61 74 68 50 61 72 73 65 72 .............if.(childPathParser
6620 2e 4d 6f 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 29 0d 0a 20 20 20 20 20 20 20 .MoveToNextComponent()).........
6640 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 20 .............{..................
6660 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 ........var.childControlLayoutNa
6680 6d 65 20 3d 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 52 65 63 75 72 73 69 76 65 28 me.=.FindControlLayoutRecursive(
66a0 72 65 66 20 63 68 69 6c 64 50 61 74 68 50 61 72 73 65 72 2c 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f ref.childPathParser,.controlLayo
66c0 75 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 20 20 20 20 20 20 utName);........................
66e0 20 20 69 66 20 28 63 68 69 6c 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 6d 65 20 21 3d 20 ..if.(childControlLayoutName.!=.
6700 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 20 20 20 20 7b null)..........................{
6720 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 69 66 ..............................if
6740 20 28 63 75 72 72 65 6e 74 52 65 73 75 6c 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 63 68 69 6c 64 .(currentResult.!=.null.&&.child
6760 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 6d 65 20 21 3d 20 63 75 72 72 65 6e 74 52 65 73 75 ControlLayoutName.!=.currentResu
6780 6c 74 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 20 20 20 lt).............................
67a0 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .....return.null;...............
67c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 52 65 73 75 6c 74 20 3d 20 63 ...............currentResult.=.c
67e0 68 69 6c 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 hildControlLayoutName;..........
6800 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 20 20 ................}...............
6820 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 20 20 .......}..................}.....
6840 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 75 72 72 65 6e 74 52 65 73 .............else.if.(currentRes
6860 75 6c 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 6d 65 ult.!=.null.&&.controlLayoutName
6880 20 21 3d 20 63 75 72 72 65 6e 74 52 65 73 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .!=.currentResult)..............
68a0 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ........return.null;............
68c0 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 20 20 20 ......else......................
68e0 63 75 72 72 65 6e 74 52 65 73 75 6c 74 20 3d 20 63 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4e 61 6d currentResult.=.controlLayoutNam
6900 65 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 0a 0d 0a e.ToString();..............}....
6920 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 75 72 72 65 6e 74 52 65 73 75 6c 74 ............return.currentResult
6940 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.
6960 73 74 61 74 69 63 20 62 6f 6f 6c 20 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4d 61 74 63 68 65 73 static.bool.ControlLayoutMatches
6980 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 PathComponent(ref.InputControlLa
69a0 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 72 65 yout.ControlItem.controlItem,.re
69c0 66 20 50 61 74 68 50 61 72 73 65 72 20 70 61 72 73 65 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d f.PathParser.parser)..........{.
69e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 6c 61 79 6f 75 74 2e 0d 0a 20 .............//.Match.layout....
6a00 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 79 6f 75 74 20 3d 20 70 61 72 73 65 72 2e 63 ...........var.layout.=.parser.c
6a20 75 72 72 65 6e 74 2e 6c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 urrent.layout;..............if.(
6a40 6c 61 79 6f 75 74 2e 6c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 layout.length.>.0)..............
6a60 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 53 74 72 69 6e 67 4d 61 {..................if.(!StringMa
6a80 74 63 68 65 73 28 6c 61 79 6f 75 74 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 6c 61 79 6f 75 74 tches(layout,.controlItem.layout
6aa0 29 29 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 20 66 ))......................return.f
6ac0 61 6c 73 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 alse;..............}............
6ae0 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 75 73 61 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ....//.Match.usage..............
6b00 20 69 66 20 28 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 20 21 3d 20 6e 75 .if.(parser.current.usages.!=.nu
6b20 6c 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 ll)..............{..............
6b40 20 20 20 20 2f 2f 20 41 6c 6c 20 6f 66 20 75 73 61 67 65 73 20 73 68 6f 75 6c 64 20 6d 61 74 63 ....//.All.of.usages.should.matc
6b60 68 20 74 6f 20 74 68 65 20 6f 6e 65 20 6f 66 20 75 73 61 67 65 20 69 6e 20 74 68 65 20 63 6f 6e h.to.the.one.of.usage.in.the.con
6b80 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 75 trol..................for.(int.u
6ba0 73 61 67 65 49 6e 64 65 78 20 3d 20 30 3b 20 75 73 61 67 65 49 6e 64 65 78 20 3c 20 70 61 72 73 sageIndex.=.0;.usageIndex.<.pars
6bc0 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 75 73 61 67 er.current.usages.Length;.++usag
6be0 65 49 6e 64 65 78 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 eIndex)..................{......
6c00 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 20 3d 20 70 61 72 73 ................var.usage.=.pars
6c20 65 72 2e 63 75 72 72 65 6e 74 2e 75 73 61 67 65 73 5b 75 73 61 67 65 49 6e 64 65 78 5d 3b 0d 0a er.current.usages[usageIndex];..
6c40 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 75 73 61 67 65 2e ......................if.(usage.
6c60 6c 65 6e 67 74 68 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 length.>.0).....................
6c80 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 76 61 72 20 .{..........................var.
6ca0 75 73 61 67 65 43 6f 75 6e 74 20 3d 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 75 73 61 67 65 73 2e usageCount.=.controlItem.usages.
6cc0 43 6f 75 6e 74 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 Count;..........................
6ce0 76 61 72 20 61 6e 79 55 73 61 67 65 4d 61 74 63 68 65 73 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 var.anyUsageMatches.=.false;....
6d00 20 20 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 20 69 ......................for.(var.i
6d20 20 3d 20 30 3b 20 69 20 3c 20 75 73 61 67 65 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 .=.0;.i.<.usageCount;.++i)......
6d40 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 20 20 20 20 20 20 ....................{...........
6d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 53 74 72 69 6e 67 4d 61 74 ...................if.(StringMat
6d80 63 68 65 73 28 75 73 61 67 65 2c 20 63 6f 6e 74 72 6f 6c 49 74 65 6d 2e 75 73 61 67 65 73 5b 69 ches(usage,.controlItem.usages[i
6da0 5d 29 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 20 20 20 ])).............................
6dc0 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 20 20 20 20 .{..............................
6de0 20 20 20 20 61 6e 79 55 73 61 67 65 4d 61 74 63 68 65 73 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 ....anyUsageMatches.=.true;.....
6e00 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 20 62 72 65 .............................bre
6e20 61 6b 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 20 20 20 ak;.............................
6e40 20 7d 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 7d 0d 0a 0d .}..........................}...
6e60 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 21 61 6e .........................if.(!an
6e80 79 55 73 61 67 65 4d 61 74 63 68 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yUsageMatches)..................
6ea0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 ............return.false;.......
6ec0 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 ...............}................
6ee0 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 ..}..............}..............
6f00 20 20 2f 2f 20 4d 61 74 63 68 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 ..//.Match.name...............va
6f20 72 20 6e 61 6d 65 20 3d 20 70 61 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 6e 61 6d 65 3b 0d 0a 20 r.name.=.parser.current.name;...
6f40 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 61 6d 65 2e 6c 65 6e 67 74 68 20 3e 20 30 29 0d ...........if.(name.length.>.0).
6f60 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 .............{..................
6f80 69 66 20 28 21 53 74 72 69 6e 67 4d 61 74 63 68 65 73 28 6e 61 6d 65 2c 20 63 6f 6e 74 72 6f 6c if.(!StringMatches(name,.control
6fa0 49 74 65 6d 2e 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Item.name)).....................
6fc0 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d .return.false;..............}...
6fe0 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 .............return.true;.......
7000 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 74 77 6f 20 6e 61 6d ...}............//.Match.two.nam
7020 65 20 73 74 72 69 6e 67 73 20 61 6c 6c 6f 77 69 6e 67 20 66 6f 72 20 77 69 6c 64 63 61 72 64 73 e.strings.allowing.for.wildcards
7040 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 27 73 74 72 27 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 ...........//.'str'.may.contain.
7060 77 69 6c 64 63 61 72 64 73 2e 20 27 6d 61 74 63 68 54 6f 27 20 6d 61 79 20 6e 6f 74 2e 0d 0a 20 wildcards..'matchTo'.may.not....
7080 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 53 74 72 69 6e .......private.static.bool.Strin
70a0 67 4d 61 74 63 68 65 73 28 53 75 62 73 74 72 69 6e 67 20 73 74 72 2c 20 49 6e 74 65 72 6e 65 64 gMatches(Substring.str,.Interned
70c0 53 74 72 69 6e 67 20 6d 61 74 63 68 54 6f 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 String.matchTo)..........{......
70e0 20 20 20 20 20 20 20 20 76 61 72 20 73 74 72 4c 65 6e 67 74 68 20 3d 20 73 74 72 2e 6c 65 6e 67 ........var.strLength.=.str.leng
7100 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 74 63 68 54 6f 4c 65 6e 67 th;..............var.matchToLeng
7120 74 68 20 3d 20 6d 61 74 63 68 54 6f 2e 6c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 th.=.matchTo.length;............
7140 20 20 20 20 2f 2f 20 43 61 6e 27 74 20 63 6f 6d 70 61 72 65 20 6c 65 6e 67 74 68 73 20 68 65 72 ....//.Can't.compare.lengths.her
7160 65 20 62 65 63 61 75 73 65 20 73 74 72 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 77 69 6c 64 63 61 e.because.str.may.contain.wildca
7180 72 64 73 20 61 6e 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 75 73 20 62 65 20 rds.and..............//.thus.be.
71a0 73 68 6f 72 74 65 72 20 74 68 61 6e 20 6d 61 74 63 68 54 6f 20 61 6e 64 20 73 74 69 6c 6c 20 6d shorter.than.matchTo.and.still.m
71c0 61 74 63 68 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 74 63 68 54 6f atch.................var.matchTo
71e0 4c 6f 77 65 72 43 61 73 65 20 3d 20 6d 61 74 63 68 54 6f 2e 54 6f 4c 6f 77 65 72 28 29 3b 0d 0a LowerCase.=.matchTo.ToLower();..
7200 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 6d 61 6e 75 61 6c 6c 79 20 77 61 6c ..............//.We.manually.wal
7220 6b 20 74 68 65 20 73 74 72 69 6e 67 20 68 65 72 65 20 73 6f 20 74 68 61 74 20 77 65 20 63 61 6e k.the.string.here.so.that.we.can
7240 20 64 65 61 6c 20 77 69 74 68 20 22 6e 6f 72 6d 61 6c 22 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .deal.with."normal".............
7260 20 2f 2f 20 63 6f 6d 70 61 72 69 73 6f 6e 73 20 61 73 20 77 65 6c 6c 20 61 73 20 77 69 74 68 20 .//.comparisons.as.well.as.with.
7280 77 69 6c 64 63 61 72 64 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 6f 73 49 wildcards...............var.posI
72a0 6e 4d 61 74 63 68 54 6f 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 nMatchTo.=.0;..............var.p
72c0 6f 73 49 6e 53 74 72 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 osInStr.=.0;..............while.
72e0 28 70 6f 73 49 6e 53 74 72 20 3c 20 73 74 72 4c 65 6e 67 74 68 20 26 26 20 70 6f 73 49 6e 4d 61 (posInStr.<.strLength.&&.posInMa
7300 74 63 68 54 6f 20 3c 20 6d 61 74 63 68 54 6f 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 tchTo.<.matchToLength)..........
7320 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 6e 65 78 74 43 ....{..................var.nextC
7340 68 61 72 20 3d 20 73 74 72 5b 70 6f 73 49 6e 53 74 72 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 har.=.str[posInStr];............
7360 20 20 20 20 20 20 69 66 20 28 6e 65 78 74 43 68 61 72 20 3d 3d 20 27 2a 27 29 0d 0a 20 20 20 20 ......if.(nextChar.==.'*')......
7380 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 20 ............{...................
73a0 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 6d 61 6b 65 20 73 75 72 65 20 77 65 20 64 6f 6e 27 74 20 ...////TODO:.make.sure.we.don't.
73c0 65 6e 64 20 75 70 20 77 69 74 68 20 2a 2a 20 68 65 72 65 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 end.up.with.**.here.............
73e0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 6f 73 49 6e 53 74 72 20 3d 3d 20 73 74 72 4c 65 ...........if.(posInStr.==.strLe
7400 6e 67 74 68 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ngth.-.1).......................
7420 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 20 2f 2f 20 57 69 6c 64 63 61 72 64 20 61 74 20 65 ...return.true;.//.Wildcard.at.e
7440 6e 64 20 6f 66 20 73 74 72 69 6e 67 20 73 6f 20 72 65 73 74 20 69 73 20 6d 61 74 63 68 65 64 2e nd.of.string.so.rest.is.matched.
7460 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 70 6f 73 49 6e 53 ........................++posInS
7480 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 78 74 43 68 61 tr;......................nextCha
74a0 72 20 3d 20 63 68 61 72 2e 54 6f 4c 6f 77 65 72 28 73 74 72 5b 70 6f 73 49 6e 53 74 72 5d 29 3b r.=.char.ToLower(str[posInStr]);
74c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 70 ........................while.(p
74e0 6f 73 49 6e 4d 61 74 63 68 54 6f 20 3c 20 6d 61 74 63 68 54 6f 4c 65 6e 67 74 68 20 26 26 20 6d osInMatchTo.<.matchToLength.&&.m
7500 61 74 63 68 54 6f 4c 6f 77 65 72 43 61 73 65 5b 70 6f 73 49 6e 4d 61 74 63 68 54 6f 5d 20 21 3d atchToLowerCase[posInMatchTo].!=
7520 20 6e 65 78 74 43 68 61 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .nextChar)......................
7540 20 20 20 20 2b 2b 70 6f 73 49 6e 4d 61 74 63 68 54 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ....++posInMatchTo;.............
7560 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 6f 73 49 6e 4d 61 74 63 68 54 6f 20 3d 3d 20 6d ...........if.(posInMatchTo.==.m
7580 61 74 63 68 54 6f 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 atchToLength)...................
75a0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 20 2f 2f 20 4d 61 74 63 68 65 64 20 .......return.false;.//.Matched.
75c0 61 6c 6c 20 74 68 65 20 77 61 79 20 74 6f 20 65 6e 64 20 6f 66 20 6d 61 74 63 68 54 6f 20 62 75 all.the.way.to.end.of.matchTo.bu
75e0 74 20 74 68 65 72 65 27 73 20 6d 6f 72 65 20 69 6e 20 73 74 72 20 61 66 74 65 72 20 74 68 65 20 t.there's.more.in.str.after.the.
7600 77 69 6c 64 63 61 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 wildcard...................}....
7620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 61 72 2e 54 6f 4c 6f ..............else.if.(char.ToLo
7640 77 65 72 28 6e 65 78 74 43 68 61 72 29 20 21 3d 20 6d 61 74 63 68 54 6f 4c 6f 77 65 72 43 61 73 wer(nextChar).!=.matchToLowerCas
7660 65 5b 70 6f 73 49 6e 4d 61 74 63 68 54 6f 5d 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e[posInMatchTo])................
7680 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 72 65 74 75 72 6e 20 ..{......................return.
76a0 66 61 6c 73 65 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 false;..................}.......
76c0 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 70 6f 73 49 6e 4d 61 74 63 68 54 6f 3b 0d 0a 20 20 .............++posInMatchTo;....
76e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 70 6f 73 49 6e 53 74 72 3b 0d 0a 20 20 20 20 20 ..............++posInStr;.......
7700 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 .......}................return.p
7720 6f 73 49 6e 4d 61 74 63 68 54 6f 20 3d 3d 20 6d 61 74 63 68 54 6f 4c 65 6e 67 74 68 20 26 26 20 osInMatchTo.==.matchToLength.&&.
7740 70 6f 73 49 6e 53 74 72 20 3d 3d 20 73 74 72 4c 65 6e 67 74 68 3b 20 2f 2f 20 43 68 65 63 6b 20 posInStr.==.strLength;.//.Check.
7760 69 66 20 77 65 20 68 61 76 65 20 63 6f 6e 73 75 6d 65 64 20 61 6c 6c 20 69 6e 70 75 74 2e 20 50 if.we.have.consumed.all.input..P
7780 72 65 76 65 6e 74 20 70 72 65 66 69 78 2d 6f 6e 6c 79 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 revent.prefix-only.match........
77a0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e ...}............public.static.In
77c0 70 75 74 43 6f 6e 74 72 6f 6c 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 28 49 6e 70 75 74 43 putControl.TryFindControl(InputC
77e0 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 ontrol.control,.string.path,.int
7800 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 .indexInPath.=.0)..........{....
7820 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 3c ..........return.TryFindControl<
7840 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 28 63 6f 6e 74 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 InputControl>(control,.path,.ind
7860 65 78 49 6e 50 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 exInPath);..........}...........
7880 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 5b 5d 20 54 72 .public.static.InputControl[].Tr
78a0 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 yFindControls(InputControl.contr
78c0 6f 6c 2c 20 73 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 ol,.string.path,.int.indexInPath
78e0 20 3d 20 30 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 .=.0)..........{..............va
7900 72 20 6d 61 74 63 68 65 73 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 r.matches.=.new.InputControlList
7920 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 28 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d 70 29 3b 0d <InputControl>(Allocator.Temp);.
7940 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 0d .............try..............{.
7960 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 .................TryFindControls
7980 28 63 6f 6e 74 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 72 65 66 (control,.path,.indexInPath,.ref
79a0 20 6d 61 74 63 68 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 .matches);..................retu
79c0 72 6e 20 6d 61 74 63 68 65 73 2e 54 6f 41 72 72 61 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 rn.matches.ToArray();...........
79e0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 61 6c 6c 79 0d 0a 20 20 20 20 20 ...}..............finally.......
7a00 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 6d 61 74 63 68 65 .......{..................matche
7a20 73 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 s.Dispose();..............}.....
7a40 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 .....}............public.static.
7a60 69 6e 74 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c int.TryFindControls(InputControl
7a80 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 70 61 74 68 2c 20 72 65 66 20 49 6e 70 75 74 .control,.string.path,.ref.Input
7aa0 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 20 6d 61 74 63 68 65 ControlList<InputControl>.matche
7ac0 73 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 s,.int.indexInPath.=.0).........
7ae0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 54 72 79 46 69 6e 64 43 6f .{..............return.TryFindCo
7b00 6e 74 72 6f 6c 73 28 63 6f 6e 74 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 ntrols(control,.path,.indexInPat
7b20 68 2c 20 72 65 66 20 6d 61 74 63 68 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 h,.ref.matches);..........}.....
7b40 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<summary>..........//
7b60 2f 20 52 65 74 75 72 6e 20 74 68 65 20 66 69 72 73 74 20 63 68 69 6c 64 20 63 6f 6e 74 72 6f 6c /.Return.the.first.child.control
7b80 20 74 68 61 74 20 6d 61 74 63 68 65 73 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 2e 0d 0a 20 .that.matches.the.given.path....
7ba0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</summary>........../
7bc0 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c //.<param.name="control">Control
7be0 20 72 6f 6f 74 20 61 74 20 77 68 69 63 68 20 74 6f 20 73 74 61 72 74 20 74 68 65 20 73 65 61 72 .root.at.which.to.start.the.sear
7c00 63 68 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 ch.</param>..........///.<param.
7c20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 50 61 74 68 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 name="path">Path.of.the.control.
7c40 74 6f 20 66 69 6e 64 2e 20 43 61 6e 20 62 65 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 to.find..Can.be.<c>null</c>.or.e
7c60 6d 70 74 79 2c 20 69 6e 20 77 68 69 63 68 20 63 61 73 65 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 0d mpty,.in.which.case.<c>null</c>.
7c80 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 72 65 74 75 72 6e 65 64 2e 3c 2f 70 61 72 61 6d .........///.is.returned.</param
7ca0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 69 6e 64 65 >..........///.<param.name="inde
7cc0 78 49 6e 50 61 74 68 22 3e 49 6e 64 65 78 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 xInPath">Index.in.<paramref.name
7ce0 3d 22 70 61 74 68 22 2f 3e 20 61 74 20 77 68 69 63 68 20 74 6f 20 73 74 61 72 74 20 70 61 72 73 ="path"/>.at.which.to.start.pars
7d00 69 6e 67 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 30 2c ing..Defaults.to..........///.0,
7d20 20 69 2e 65 2e 20 70 61 72 73 69 6e 67 20 73 74 61 72 74 73 20 61 74 20 74 68 65 20 66 69 72 73 .i.e..parsing.starts.at.the.firs
7d40 74 20 63 68 61 72 61 63 74 65 72 20 69 6e 20 74 68 65 20 70 61 74 68 2e 3c 2f 70 61 72 61 6d 3e t.character.in.the.path.</param>
7d60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 66 69 72 73 74 ..........///.<returns>The.first
7d80 20 28 64 69 72 65 63 74 20 6f 72 20 69 6e 64 69 72 65 63 74 29 20 63 68 69 6c 64 20 63 6f 6e 74 .(direct.or.indirect).child.cont
7da0 72 6f 6c 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f rol.of.<paramref.name="control"/
7dc0 3e 20 74 68 61 74 20 6d 61 74 63 68 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 >.that.matches..........///.<par
7de0 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a amref.name="path"/>.</returns>..
7e00 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 ........///.<exception.cref="Arg
7e20 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 umentNullException"><paramref.na
7e40 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f me="control"/>.is.<c>null</c>.</
7e60 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 exception>..........///.<remarks
7e80 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 63 61 74 65 >..........///.Does.not.allocate
7ea0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 ...........///..........///.Note
7ec0 20 74 68 61 74 20 69 66 20 6d 75 6c 74 69 70 6c 65 20 63 68 69 6c 64 20 63 6f 6e 74 72 6f 6c 73 .that.if.multiple.child.controls
7ee0 20 6d 61 74 63 68 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 2c 20 77 68 69 63 68 20 6f 6e 65 .match.the.given.path,.which.one
7f00 20 69 73 20 72 65 74 75 72 6e 65 64 20 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 0d 0a 20 20 20 .is.returned.depends.on.the.....
7f20 20 20 20 20 20 2f 2f 2f 20 6f 72 64 65 72 69 6e 67 20 6f 66 20 63 6f 6e 74 72 6f 6c 73 2e 20 54 .....///.ordering.of.controls..T
7f40 68 65 20 72 65 73 75 6c 74 20 73 68 6f 75 6c 64 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 69 he.result.should.be.considered.i
7f60 6e 64 65 74 65 72 6d 69 6e 69 73 74 69 63 20 69 6e 20 74 68 69 73 20 63 61 73 65 2e 0d 0a 20 20 ndeterministic.in.this.case.....
7f80 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e ......///..........///.<example>
7fa0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ..........///.<code>..........//
7fc0 2f 20 2f 2f 20 46 69 6e 64 20 58 20 63 6f 6e 74 72 6f 6c 20 6f 66 20 6c 65 66 74 20 73 74 69 63 /.//.Find.X.control.of.left.stic
7fe0 6b 20 6f 6e 20 63 75 72 72 65 6e 74 20 67 61 6d 65 70 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f k.on.current.gamepad.........../
8000 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 46 69 6e 64 43 6f 6e 74 72 //.InputControlPath.TryFindContr
8020 6f 6c 28 47 61 6d 65 70 61 64 2e 63 75 72 72 65 6e 74 2c 20 22 6c 65 66 74 53 74 69 63 6b 2f 78 ol(Gamepad.current,."leftStick/x
8040 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f ");..........///..........///.//
8060 20 46 69 6e 64 20 63 6f 6e 74 72 6f 6c 20 77 69 74 68 20 50 72 69 6d 61 72 79 41 63 74 69 6f 6e .Find.control.with.PrimaryAction
8080 20 75 73 61 67 65 20 6f 6e 20 63 75 72 72 65 6e 74 20 6d 6f 75 73 65 2e 0d 0a 20 20 20 20 20 20 .usage.on.current.mouse.........
80a0 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 46 69 6e 64 43 6f ..///.InputControlPath.TryFindCo
80c0 6e 74 72 6f 6c 28 4d 6f 75 73 65 2e 63 75 72 72 65 6e 74 2c 20 22 7b 50 72 69 6d 61 72 79 41 63 ntrol(Mouse.current,."{PrimaryAc
80e0 74 69 6f 6e 7d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 tion}");..........///.</code>...
8100 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</example>........../
8120 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 //.</remarks>..........///.<seea
8140 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 74 68 69 73 5b 73 74 72 69 lso.cref="InputControl.this[stri
8160 6e 67 5d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 43 ng]"/>..........public.static.TC
8180 6f 6e 74 72 6f 6c 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 3c 54 43 6f 6e 74 72 6f 6c 3e 28 ontrol.TryFindControl<TControl>(
81a0 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 70 61 74 InputControl.control,.string.pat
81c0 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 h,.int.indexInPath.=.0).........
81e0 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 .....where.TControl.:.InputContr
8200 6f 6c 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 69 66 20 28 63 ol..........{..............if.(c
8220 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ontrol.==.null).................
8240 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e .throw.new.ArgumentNullException
8260 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 (nameof(control));..............
8280 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 70 61 74 68 29 29 0d if.(string.IsNullOrEmpty(path)).
82a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d .................return.null;...
82c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 3d 20 .............if.(indexInPath.==.
82e0 30 20 26 26 20 70 61 74 68 5b 30 5d 20 3d 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 0.&&.path[0].==.'/')............
8300 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ......++indexInPath;............
8320 20 20 20 20 76 61 72 20 6e 6f 6e 65 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c ....var.none.=.new.InputControlL
8340 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ist<TControl>();..............re
8360 74 75 72 6e 20 4d 61 74 63 68 43 6f 6e 74 72 6f 6c 73 52 65 63 75 72 73 69 76 65 28 63 6f 6e 74 turn.MatchControlsRecursive(cont
8380 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 72 65 66 20 6e 6f 6e 65 rol,.path,.indexInPath,.ref.none
83a0 2c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 3a 20 66 61 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 ,.matchMultiple:.false);........
83c0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ..}............///.<summary>....
83e0 20 20 20 20 20 20 2f 2f 2f 20 50 65 72 66 6f 72 6d 20 61 20 73 65 61 72 63 68 20 66 6f 72 20 63 ......///.Perform.a.search.for.c
8400 6f 6e 74 72 6f 6c 73 20 73 74 61 72 74 69 6e 67 20 77 69 74 68 20 74 68 65 20 67 69 76 65 6e 20 ontrols.starting.with.the.given.
8420 63 6f 6e 74 72 6f 6c 20 61 73 20 72 6f 6f 74 20 61 6e 64 20 6d 61 74 63 68 69 6e 67 0d 0a 20 20 control.as.root.and.matching....
8440 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 20 66 72 6f 6d 20 74 68 ......///.the.given.path.from.th
8460 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 2e 20 50 75 74 73 20 61 6c 6c 20 6d 61 74 63 68 e.given.position..Puts.all.match
8480 69 6e 67 20 63 6f 6e 74 72 6f 6c 73 20 6f 6e 20 74 68 65 20 6c 69 73 74 20 61 6e 64 0d 0a 20 20 ing.controls.on.the.list.and....
84a0 20 20 20 20 20 20 2f 2f 2f 20 72 65 74 75 72 6e 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 ......///.returns.the.number.of.
84c0 63 6f 6e 74 72 6f 6c 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 6d 61 74 63 68 65 64 2e controls.that.have.been.matched.
84e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 ..........///.</summary>........
8500 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 ..///.<param.name="control">Cont
8520 72 6f 6c 20 61 74 20 77 68 69 63 68 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 20 69 73 20 72 rol.at.which.the.given.path.is.r
8540 6f 6f 74 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 ooted.</param>..........///.<par
8560 61 6d 20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 am.name="path"></param>.........
8580 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 69 6e 64 65 78 49 6e 50 61 74 68 22 3e 3c .///.<param.name="indexInPath"><
85a0 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 /param>..........///.<param.name
85c0 3d 22 6d 61 74 63 68 65 73 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ="matches"></param>..........///
85e0 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 43 6f 6e 74 72 6f 6c 22 3e 3c 2f 74 79 .<typeparam.name="TControl"></ty
8600 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c peparam>..........///.<returns><
8620 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f /returns>..........///.<exceptio
8640 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c n.cref="ArgumentNullException"><
8660 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b /exception>..........///.<remark
8680 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 61 74 63 68 69 6e 67 20 69 73 20 63 61 73 65 s>..........///.Matching.is.case
86a0 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 -insensitive...........///......
86c0 20 20 20 20 2f 2f 2f 20 44 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 63 61 74 65 20 6d 61 6e 61 67 65 ....///.Does.not.allocate.manage
86e0 64 20 6d 65 6d 6f 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 d.memory...........///.</remarks
8700 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 54 72 79 >..........public.static.int.Try
8720 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 3c 54 43 6f 6e 74 72 6f 6c 3e 28 49 6e 70 75 74 43 6f 6e 74 FindControls<TControl>(InputCont
8740 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 20 69 6e rol.control,.string.path,.int.in
8760 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 49 6e 70 75 dexInPath,..............ref.Inpu
8780 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e 20 6d 61 74 63 68 65 73 29 0d tControlList<TControl>.matches).
87a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e .............where.TControl.:.In
87c0 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 putControl..........{...........
87e0 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ...if.(control.==.null).........
8800 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
8820 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 xception(nameof(control));......
8840 20 20 20 20 20 20 20 20 69 66 20 28 70 61 74 68 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 ........if.(path.==.null).......
8860 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c ...........throw.new.ArgumentNul
8880 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 70 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 lException(nameof(path));.......
88a0 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 3d 20 30 20 26 26 .........if.(indexInPath.==.0.&&
88c0 20 70 61 74 68 5b 30 5d 20 3d 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .path[0].==.'/')................
88e0 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..++indexInPath;................
8900 76 61 72 20 63 6f 75 6e 74 42 65 66 6f 72 65 20 3d 20 6d 61 74 63 68 65 73 2e 43 6f 75 6e 74 3b var.countBefore.=.matches.Count;
8920 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4d 61 74 63 68 43 6f 6e 74 72 6f 6c 73 52 65 63 75 72 ..............MatchControlsRecur
8940 73 69 76 65 28 63 6f 6e 74 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 2c sive(control,.path,.indexInPath,
8960 20 72 65 66 20 6d 61 74 63 68 65 73 2c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 3a 20 74 72 75 .ref.matches,.matchMultiple:.tru
8980 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 61 74 63 68 65 73 2e e);..............return.matches.
89a0 43 6f 75 6e 74 20 2d 20 63 6f 75 6e 74 42 65 66 6f 72 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d Count.-.countBefore;..........}.
89c0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 77 68 61 74 27 73 20 74 68 ...........////REVIEW:.what's.th
89e0 65 20 64 69 66 66 65 72 65 6e 63 65 20 62 65 74 77 65 65 6e 20 54 72 79 46 69 6e 64 43 68 69 6c e.difference.between.TryFindChil
8a00 64 20 61 6e 64 20 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 3f 3f 0d 0a 0d 0a 20 20 20 20 20 20 d.and.TryFindControl??..........
8a20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 54 72 79 ..public.static.InputControl.Try
8a40 46 69 6e 64 43 68 69 6c 64 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 FindChild(InputControl.control,.
8a60 73 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 string.path,.int.indexInPath.=.0
8a80 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 72 65 74 75 72 6e )..........{..............return
8aa0 20 54 72 79 46 69 6e 64 43 68 69 6c 64 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 28 63 6f 6e 74 .TryFindChild<InputControl>(cont
8ac0 72 6f 6c 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 rol,.path,.indexInPath);........
8ae0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 43 6f ..}............public.static.TCo
8b00 6e 74 72 6f 6c 20 54 72 79 46 69 6e 64 43 68 69 6c 64 3c 54 43 6f 6e 74 72 6f 6c 3e 28 49 6e 70 ntrol.TryFindChild<TControl>(Inp
8b20 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 70 61 74 68 2c 20 utControl.control,.string.path,.
8b40 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 int.indexInPath.=.0)............
8b60 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d ..where.TControl.:.InputControl.
8b80 0a 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 63 6f 6e 74 .........{..............if.(cont
8ba0 72 6f 6c 20 3d 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 74 68 rol.==.null)..................th
8bc0 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 row.new.ArgumentNullException(na
8be0 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 meof(control));..............if.
8c00 28 70 61 74 68 20 3d 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 (path.==.null)..................
8c20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 throw.new.ArgumentNullException(
8c40 6e 61 6d 65 6f 66 28 70 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 nameof(path));................va
8c60 72 20 63 68 69 6c 64 72 65 6e 20 3d 20 63 6f 6e 74 72 6f 6c 2e 63 68 69 6c 64 72 65 6e 3b 0d 0a r.children.=.control.children;..
8c80 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 43 6f 75 6e 74 20 3d 20 63 68 69 ............var.childCount.=.chi
8ca0 6c 64 72 65 6e 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 ldren.Count;..............for.(v
8cc0 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 68 69 6c 64 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a ar.i.=.0;.i.<.childCount;.++i)..
8ce0 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 76 ............{..................v
8d00 61 72 20 63 68 69 6c 64 20 3d 20 63 68 69 6c 64 72 65 6e 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 ar.child.=.children[i];.........
8d20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 74 63 68 20 3d 20 54 72 79 46 69 6e 64 43 6f 6e 74 .........var.match.=.TryFindCont
8d40 72 6f 6c 3c 54 43 6f 6e 74 72 6f 6c 3e 28 63 68 69 6c 64 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 rol<TControl>(child,.path,.index
8d60 49 6e 50 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 InPath);..................if.(ma
8d80 74 63 68 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 tch.!=.null)....................
8da0 20 20 72 65 74 75 72 6e 20 6d 61 74 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ..return.match;..............}..
8dc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 ..............return.null;......
8de0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 70 72 6f ....}............////REVIEW:.pro
8e00 62 61 62 6c 79 20 77 6f 75 6c 64 20 62 65 20 67 6f 6f 64 20 74 6f 20 68 61 76 65 20 61 20 4d 61 bably.would.be.good.to.have.a.Ma
8e20 74 63 68 65 73 28 73 74 72 69 6e 67 2c 73 74 72 69 6e 67 29 20 76 65 72 73 69 6f 6e 0d 0a 0d 0a tches(string,string).version....
8e40 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 4d 61 74 63 68 ........public.static.bool.Match
8e60 65 73 28 73 74 72 69 6e 67 20 65 78 70 65 63 74 65 64 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c es(string.expected,.InputControl
8e80 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 20 .control)..........{............
8ea0 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 79 28 65 78 70 65 63 ..if.(string.IsNullOrEmpty(expec
8ec0 74 65 64 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 65 77 ted))..................throw.new
8ee0 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 65 78 .ArgumentNullException(nameof(ex
8f00 70 65 63 74 65 64 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 pected));..............if.(contr
8f20 6f 6c 20 3d 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 74 68 72 ol.==.null)..................thr
8f40 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d ow.new.ArgumentNullException(nam
8f60 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 eof(control));................va
8f80 72 20 70 61 72 73 65 72 20 3d 20 6e 65 77 20 50 61 74 68 50 61 72 73 65 72 28 65 78 70 65 63 74 r.parser.=.new.PathParser(expect
8fa0 65 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 4d 61 74 63 68 65 73 ed);..............return.Matches
8fc0 52 65 63 75 72 73 69 76 65 28 72 65 66 20 70 61 72 73 65 72 2c 20 63 6f 6e 74 72 6f 6c 29 3b 0d Recursive(ref.parser,.control);.
8fe0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .........}............///.<summa
9000 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 68 65 63 6b 20 77 68 65 74 68 65 72 20 74 ry>..........///.Check.whether.t
9020 68 65 20 67 69 76 65 6e 20 70 61 74 68 20 6d 61 74 63 68 65 73 20 3c 70 61 72 61 6d 72 65 66 20 he.given.path.matches.<paramref.
9040 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 6f 72 20 61 6e 79 20 6f 66 20 69 74 73 20 70 name="control"/>.or.any.of.its.p
9060 61 72 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d arents...........///.</summary>.
9080 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 65 78 70 65 63 74 .........///.<param.name="expect
90a0 65 64 22 3e 41 20 63 6f 6e 74 72 6f 6c 20 70 61 74 68 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 ed">A.control.path.</param>.....
90c0 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 41 .....///.<param.name="control">A
90e0 6e 20 69 6e 70 75 74 20 63 6f 6e 74 72 6f 6c 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 n.input.control.</param>........
9100 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 68 65 20 67 69 76 65 6e ..///.<returns>True.if.the.given
9120 20 70 61 74 68 20 6d 61 74 63 68 65 73 20 61 74 20 6c 65 61 73 74 20 61 20 70 61 72 74 69 61 6c .path.matches.at.least.a.partial
9140 20 70 61 74 68 20 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c .path.to.<paramref.name="control
9160 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 "/>.</returns>..........///.<exc
9180 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 eption.cref="ArgumentNullExcepti
91a0 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 65 78 70 65 63 74 65 64 22 2f 3e 20 on"><paramref.name="expected"/>.
91c0 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 20 2d 6f 72 2d 0d 0a 20 20 is.<c>null</c>.or.empty.-or-....
91e0 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f ......///.<paramref.name="contro
9200 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e l"/>.is.<c>null</c>.</exception>
9220 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<remarks>.........
9240 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 .///.<example>..........///.<cod
9260 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 72 75 65 20 61 73 20 74 68 65 20 70 e>..........///.//.True.as.the.p
9280 61 74 68 20 6d 61 74 63 68 65 73 20 74 68 65 20 4b 65 79 62 6f 61 72 64 20 64 65 76 69 63 65 20 ath.matches.the.Keyboard.device.
92a0 69 74 73 65 6c 66 2c 20 69 2e 65 2e 20 74 68 65 20 70 61 72 65 6e 74 20 6f 66 0d 0a 20 20 20 20 itself,.i.e..the.parent.of......
92c0 20 20 20 20 2f 2f 2f 20 2f 2f 20 4b 65 79 62 6f 61 72 64 2e 61 4b 65 79 2e 0d 0a 20 20 20 20 20 ....///.//.Keyboard.aKey........
92e0 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 4d 61 74 63 68 65 73 50 ...///.InputControlPath.MatchesP
9300 72 65 66 69 78 28 22 26 6c 74 3b 4b 65 79 62 6f 61 72 64 26 67 74 3b 22 2c 20 4b 65 79 62 6f 61 refix("&lt;Keyboard&gt;",.Keyboa
9320 72 64 2e 63 75 72 72 65 6e 74 2e 61 4b 65 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a rd.current.aKey);..........///..
9340 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 46 61 6c 73 65 20 61 73 20 74 68 65 20 70 61 74 68 ........///.//.False.as.the.path
9360 20 6d 61 74 63 68 65 73 20 6e 6f 6e 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 73 20 6c 65 .matches.none.of.the.controls.le
9380 61 64 69 6e 67 20 74 6f 20 4b 65 79 62 6f 61 72 64 2e 61 4b 65 79 2e 0d 0a 20 20 20 20 20 20 20 ading.to.Keyboard.aKey..........
93a0 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 4d 61 74 63 68 65 73 50 72 65 .///.InputControlPath.MatchesPre
93c0 66 69 78 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 22 2c 20 4b 65 79 62 6f 61 72 64 2e fix("&lt;Gamepad&gt;",.Keyboard.
93e0 63 75 72 72 65 6e 74 2e 61 4b 65 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 current.aKey);..........///.....
9400 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 72 75 65 20 61 73 20 74 68 65 20 70 61 74 68 20 6d 61 74 .....///.//.True.as.the.path.mat
9420 63 68 65 73 20 4b 65 79 62 6f 61 72 64 2e 61 4b 65 79 20 69 74 73 65 6c 66 2e 0d 0a 20 20 20 20 ches.Keyboard.aKey.itself.......
9440 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 4d 61 74 63 68 65 73 ....///.InputControlPath.Matches
9460 50 72 65 66 69 78 28 22 26 6c 74 3b 4b 65 79 62 6f 61 72 64 26 67 74 3b 2f 61 22 2c 20 4b 65 79 Prefix("&lt;Keyboard&gt;/a",.Key
9480 62 6f 61 72 64 2e 63 75 72 72 65 6e 74 2e 61 4b 65 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f board.current.aKey);..........//
94a0 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 /.</code>..........///.</example
94c0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 >..........///.</remarks>.......
94e0 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 4d 61 74 63 68 65 73 50 72 65 ...public.static.bool.MatchesPre
9500 66 69 78 28 73 74 72 69 6e 67 20 65 78 70 65 63 74 65 64 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f fix(string.expected,.InputContro
9520 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)..........{...........
9540 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 79 28 65 78 70 65 ...if.(string.IsNullOrEmpty(expe
9560 63 74 65 64 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 65 cted))..................throw.ne
9580 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 65 w.ArgumentNullException(nameof(e
95a0 78 70 65 63 74 65 64 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 xpected));..............if.(cont
95c0 72 6f 6c 20 3d 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 74 68 rol.==.null)..................th
95e0 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 row.new.ArgumentNullException(na
9600 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f meof(control));................/
9620 2f 2f 2f 52 45 56 49 45 57 3a 20 74 68 69 73 20 63 61 6e 20 70 72 6f 62 61 62 6c 79 20 62 65 20 ///REVIEW:.this.can.probably.be.
9640 64 6f 6e 65 20 6d 6f 72 65 20 65 66 66 69 63 69 65 6e 74 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 done.more.efficiently...........
9660 20 20 20 66 6f 72 20 28 76 61 72 20 63 75 72 72 65 6e 74 20 3d 20 63 6f 6e 74 72 6f 6c 3b 20 63 ...for.(var.current.=.control;.c
9680 75 72 72 65 6e 74 20 21 3d 20 6e 75 6c 6c 3b 20 63 75 72 72 65 6e 74 20 3d 20 63 75 72 72 65 6e urrent.!=.null;.current.=.curren
96a0 74 2e 70 61 72 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 t.parent)..............{........
96c0 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 73 65 72 20 3d 20 6e 65 77 20 50 61 74 68 50 ..........var.parser.=.new.PathP
96e0 61 72 73 65 72 28 65 78 70 65 63 74 65 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 arser(expected);................
9700 20 20 69 66 20 28 4d 61 74 63 68 65 73 52 65 63 75 72 73 69 76 65 28 72 65 66 20 70 61 72 73 65 ..if.(MatchesRecursive(ref.parse
9720 72 2c 20 63 75 72 72 65 6e 74 29 20 26 26 20 70 61 72 73 65 72 2e 69 73 41 74 45 6e 64 29 0d 0a r,.current).&&.parser.isAtEnd)..
9740 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 20 74 72 75 65 3b ....................return.true;
9760 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 72 ..............}................r
9780 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 eturn.false;..........}.........
97a0 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 4d 61 74 63 68 65 73 52 65 ...private.static.bool.MatchesRe
97c0 63 75 72 73 69 76 65 28 72 65 66 20 50 61 74 68 50 61 72 73 65 72 20 70 61 72 73 65 72 2c 20 49 cursive(ref.PathParser.parser,.I
97e0 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 75 72 72 65 6e 74 43 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 nputControl.currentControl).....
9800 20 20 20 20 20 7b 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 .....{..............//.Recurse.i
9820 6e 74 6f 20 70 61 72 65 6e 74 20 62 65 66 6f 72 65 20 6c 6f 6f 6b 69 6e 67 20 61 74 20 74 68 65 nto.parent.before.looking.at.the
9840 20 63 75 72 72 65 6e 74 20 63 6f 6e 74 72 6f 6c 2e 20 54 68 69 73 0d 0a 20 20 20 20 20 20 20 20 .current.control..This..........
9860 20 20 20 20 2f 2f 20 77 69 6c 6c 20 61 64 76 61 6e 63 65 20 74 68 65 20 70 61 72 73 65 72 20 74 ....//.will.advance.the.parser.t
9880 6f 20 77 68 65 72 65 20 6f 75 72 20 63 6f 6e 74 72 6f 6c 20 69 73 20 69 6e 20 74 68 65 20 70 61 o.where.our.control.is.in.the.pa
98a0 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 65 6e 74 20 3d 20 63 75 th...............var.parent.=.cu
98c0 72 72 65 6e 74 43 6f 6e 74 72 6f 6c 2e 70 61 72 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 rrentControl.parent;............
98e0 20 20 69 66 20 28 70 61 72 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 21 4d 61 74 63 68 65 73 ..if.(parent.!=.null.&&.!Matches
9900 52 65 63 75 72 73 69 76 65 28 72 65 66 20 70 61 72 73 65 72 2c 20 70 61 72 65 6e 74 29 29 0d 0a Recursive(ref.parser,.parent))..
9920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d ................return.false;...
9940 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 61 69 6c 20 69 66 20 74 68 65 72 65 27 73 20 .............//.Fail.if.there's.
9960 6e 6f 20 6d 6f 72 65 20 70 61 74 68 20 6c 65 66 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 no.more.path.left...............
9980 69 66 20 28 21 70 61 72 73 65 72 2e 4d 6f 76 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 if.(!parser.MoveToNextComponent(
99a0 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 ))..................return.false
99c0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 63 75 72 72 65 6e ;................//.Match.curren
99e0 74 20 70 61 74 68 20 63 6f 6d 70 6f 6e 65 6e 74 20 61 67 61 69 6e 73 74 20 63 75 72 72 65 6e 74 t.path.component.against.current
9a00 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 .control...............return.pa
9a20 72 73 65 72 2e 63 75 72 72 65 6e 74 2e 4d 61 74 63 68 65 73 28 63 75 72 72 65 6e 74 43 6f 6e 74 rser.current.Matches(currentCont
9a40 72 6f 6c 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 2f 2f rol);..........}............////
9a60 54 4f 44 4f 3a 20 72 65 66 61 63 74 6f 72 20 74 68 69 73 20 74 6f 20 75 73 65 20 74 68 65 20 6e TODO:.refactor.this.to.use.the.n
9a80 65 77 20 50 61 74 68 50 61 72 73 65 72 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 ew.PathParser............///.<su
9aa0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 63 75 72 73 69 76 65 6c 79 20 mmary>..........///.Recursively.
9ac0 6d 61 74 63 68 20 70 61 74 68 20 65 6c 65 6d 65 6e 74 73 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 match.path.elements.in.<paramref
9ae0 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 .name="path"/>...........///.</s
9b00 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 ummary>..........///.<param.name
9b20 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 75 72 72 65 6e 74 20 63 6f 6e 74 72 6f 6c 20 77 65 27 72 65 ="control">Current.control.we're
9b40 20 61 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d .at.</param>..........///.<param
9b60 20 6e 61 6d 65 3d 22 70 61 74 68 22 3e 43 6f 6e 74 72 6f 6c 20 70 61 74 68 20 77 65 20 61 72 65 .name="path">Control.path.we.are
9b80 20 6d 61 74 63 68 69 6e 67 20 61 67 61 69 6e 73 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 .matching.against.</param>......
9ba0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 69 6e 64 65 78 49 6e 50 61 74 68 ....///.<param.name="indexInPath
9bc0 22 3e 49 6e 64 65 78 20 6f 66 20 63 75 72 72 65 6e 74 20 63 6f 6d 70 6f 6e 65 6e 74 20 69 6e 20 ">Index.of.current.component.in.
9be0 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 70 61 74 68 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e <paramref.name="path"/>.</param>
9c00 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 63 68 ..........///.<param.name="match
9c20 65 73 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d es"></param>..........///.<param
9c40 20 6e 61 6d 65 3d 22 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a .name="matchMultiple"></param>..
9c60 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 43 6f ........///.<typeparam.name="TCo
9c80 6e 74 72 6f 6c 22 3e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ntrol"></typeparam>..........///
9ca0 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 .<returns></returns>..........pr
9cc0 69 76 61 74 65 20 73 74 61 74 69 63 20 54 43 6f 6e 74 72 6f 6c 20 4d 61 74 63 68 43 6f 6e 74 72 ivate.static.TControl.MatchContr
9ce0 6f 6c 73 52 65 63 75 72 73 69 76 65 3c 54 43 6f 6e 74 72 6f 6c 3e 28 49 6e 70 75 74 43 6f 6e 74 olsRecursive<TControl>(InputCont
9d00 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 20 69 6e rol.control,.string.path,.int.in
9d20 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 20 49 6e 70 75 dexInPath,..............ref.Inpu
9d40 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e 20 6d 61 74 63 68 65 73 2c 20 tControlList<TControl>.matches,.
9d60 62 6f 6f 6c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 bool.matchMultiple).............
9d80 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a .where.TControl.:.InputControl..
9da0 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 4c ........{..............var.pathL
9dc0 65 6e 67 74 68 20 3d 20 70 61 74 68 2e 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ength.=.path.Length;............
9de0 20 20 20 20 2f 2f 20 54 72 79 20 74 6f 20 67 65 74 20 61 20 6d 61 74 63 68 2e 20 41 20 70 61 74 ....//.Try.to.get.a.match..A.pat
9e00 68 20 73 70 65 63 20 68 61 73 20 74 68 72 65 65 20 63 6f 6d 70 6f 6e 65 6e 74 73 3a 0d 0a 20 20 h.spec.has.three.components:....
9e20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 22 3c 6c 61 79 6f 75 74 3e 7b 75 73 61 67 65 7d ..........//...."<layout>{usage}
9e40 6e 61 6d 65 22 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 6c 6c 20 61 72 65 20 6f 70 name"..............//.All.are.op
9e60 74 69 6f 6e 61 6c 20 62 75 74 20 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 63 6f 6d 70 6f 6e 65 6e tional.but.at.least.one.componen
9e80 74 20 6d 75 73 74 20 62 65 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 t.must.be.present...............
9ea0 2f 2f 20 4e 61 6d 65 73 20 63 61 6e 20 62 65 20 61 6c 69 61 73 65 73 2c 20 74 6f 6f 2e 0d 0a 20 //.Names.can.be.aliases,.too....
9ec0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 64 6f 6e 27 74 20 74 61 70 20 49 6e 70 75 74 ...........//.We.don't.tap.Input
9ee0 43 6f 6e 74 72 6f 6c 2e 70 61 74 68 20 73 74 72 69 6e 67 73 20 6f 66 20 63 6f 6e 74 72 6f 6c 73 Control.path.strings.of.controls
9f00 20 73 6f 20 61 73 20 74 6f 20 6e 6f 74 20 63 72 65 61 74 65 20 61 0d 0a 20 20 20 20 20 20 20 20 .so.as.to.not.create.a..........
9f20 20 20 20 20 2f 2f 20 62 75 6e 63 68 20 6f 66 20 73 74 72 69 6e 67 20 6f 62 6a 65 63 74 73 20 77 ....//.bunch.of.string.objects.w
9f40 68 69 6c 65 20 66 65 65 6c 69 6e 67 20 6f 75 72 20 77 61 79 20 64 6f 77 6e 20 74 68 65 20 68 69 hile.feeling.our.way.down.the.hi
9f60 65 72 61 72 63 68 79 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 erarchy.................var.cont
9f80 72 6f 6c 49 73 4d 61 74 63 68 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 rolIsMatch.=.true;..............
9fa0 20 20 2f 2f 20 4d 61 74 63 68 20 62 79 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 ..//.Match.by.layout............
9fc0 20 20 20 69 66 20 28 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 3c 27 29 ...if.(path[indexInPath].==.'<')
9fe0 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 20 20 20 ..............{.................
a000 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .++indexInPath;.................
a020 20 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .controlIsMatch.=...............
a040 20 20 20 20 20 20 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 63 6f 6e 74 72 6f .......MatchPathComponent(contro
a060 6c 2e 6c 61 79 6f 75 74 2c 20 70 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c l.layout,.path,.ref.indexInPath,
a080 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 4c 61 79 6f 75 74 29 3b 0d 0a 0d 0a 20 .PathComponentType.Layout);.....
a0a0 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 6c 61 79 6f 75 74 20 ...............//.If.the.layout.
a0c0 69 73 6e 27 74 20 61 20 6d 61 74 63 68 2c 20 77 61 6c 6b 20 75 70 20 74 68 65 20 62 61 73 65 20 isn't.a.match,.walk.up.the.base.
a0e0 6c 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 63 68 61 69 6e layout..................//.chain
a100 20 61 6e 64 20 6d 61 74 63 68 20 65 61 63 68 20 62 61 73 65 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 .and.match.each.base.layout.....
a120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 ..............if.(!controlIsMatc
a140 68 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 h)..................{...........
a160 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 62 61 73 65 4c 61 79 6f 75 74 20 3d 20 63 6f 6e 74 ...........var.baseLayout.=.cont
a180 72 6f 6c 2e 6d 5f 4c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rol.m_Layout;...................
a1a0 20 20 20 77 68 69 6c 65 20 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 73 5f 4c ...while.(InputControlLayout.s_L
a1c0 61 79 6f 75 74 73 2e 62 61 73 65 4c 61 79 6f 75 74 54 61 62 6c 65 2e 54 72 79 47 65 74 56 61 6c ayouts.baseLayoutTable.TryGetVal
a1e0 75 65 28 62 61 73 65 4c 61 79 6f 75 74 2c 20 6f 75 74 20 62 61 73 65 4c 61 79 6f 75 74 29 29 0d ue(baseLayout,.out.baseLayout)).
a200 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 20 20 20 20 20 .....................{..........
a220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 20 3d ................controlIsMatch.=
a240 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 62 61 73 65 4c 61 79 6f 75 74 2c 20 .MatchPathComponent(baseLayout,.
a260 70 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 path,.ref.indexInPath,..........
a280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e ....................PathComponen
a2a0 74 54 79 70 65 2e 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 tType.Layout);..................
a2c0 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 29 0d 0a 20 20 20 ........if.(controlIsMatch).....
a2e0 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 72 65 61 6b 3b 0d .........................break;.
a300 0a 20 20 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 .....................}..........
a320 20 20 20 20 20 20 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 ........}..............}........
a340 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 62 79 20 75 73 61 67 65 2e 0d 0a 20 20 20 20 ........//.Match.by.usage.......
a360 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 70 61 74 ........while.(indexInPath.<.pat
a380 68 4c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 hLength.&&.path[indexInPath].==.
a3a0 27 7b 27 20 26 26 20 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 29 0d 0a 20 20 20 20 20 20 20 20 '{'.&&.controlIsMatch)..........
a3c0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e ....{..................++indexIn
a3e0 50 61 74 68 3b 0d 0a 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 Path;....................for.(va
a400 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 2e 43 6f 75 6e r.i.=.0;.i.<.control.usages.Coun
a420 74 3b 20 2b 2b 69 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 t;.++i)..................{......
a440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 20 3d ................controlIsMatch.=
a460 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 63 6f 6e 74 72 6f 6c 2e 75 73 61 67 .MatchPathComponent(control.usag
a480 65 73 5b 69 5d 2c 20 70 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 50 61 es[i],.path,.ref.indexInPath,.Pa
a4a0 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 55 73 61 67 65 29 3b 0d 0a 20 20 20 20 20 20 20 thComponentType.Usage);.........
a4c0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 29 .............if.(controlIsMatch)
a4e0 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 62 72 65 61 6b 3b ..........................break;
a500 0d 0a 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 ..................}.............
a520 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 62 79 20 64 69 .}................//.Match.by.di
a540 73 70 6c 61 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 splay.name...............if.(ind
a560 65 78 49 6e 50 61 74 68 20 3c 20 70 61 74 68 4c 65 6e 67 74 68 20 2d 20 31 20 26 26 20 63 6f 6e exInPath.<.pathLength.-.1.&&.con
a580 74 72 6f 6c 49 73 4d 61 74 63 68 20 26 26 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d trolIsMatch.&&.path[indexInPath]
a5a0 20 3d 3d 20 27 23 27 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 74 68 .==.'#'.&&..................path
a5c0 5b 69 6e 64 65 78 49 6e 50 61 74 68 20 2b 20 31 5d 20 3d 3d 20 27 28 27 29 0d 0a 20 20 20 20 20 [indexInPath.+.1].==.'(').......
a5e0 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 69 6e 64 65 78 49 .......{..................indexI
a600 6e 50 61 74 68 20 2b 3d 20 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e nPath.+=.2;..................con
a620 74 72 6f 6c 49 73 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 trolIsMatch.=.MatchPathComponent
a640 28 63 6f 6e 74 72 6f 6c 2e 64 69 73 70 6c 61 79 4e 61 6d 65 2c 20 70 61 74 68 2c 20 72 65 66 20 (control.displayName,.path,.ref.
a660 69 6e 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 indexInPath,....................
a680 20 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 44 69 73 70 6c 61 79 4e 61 6d 65 29 ..PathComponentType.DisplayName)
a6a0 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 ;..............}................
a6c0 2f 2f 20 4d 61 74 63 68 20 62 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 //.Match.by.name...............i
a6e0 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 70 61 74 68 4c 65 6e 67 74 68 20 26 26 20 63 f.(indexInPath.<.pathLength.&&.c
a700 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 20 26 26 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 ontrolIsMatch.&&.path[indexInPat
a720 68 5d 20 21 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 h].!=.'/')..............{.......
a740 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 72 6d 61 6c 20 6e 61 6d 65 20 6d 61 74 63 68 2e ...........//.Normal.name.match.
a760 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 49 73 4d 61 74 63 68 ..................controlIsMatch
a780 20 3d 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 63 6f 6e 74 72 6f 6c 2e 6e 61 .=.MatchPathComponent(control.na
a7a0 6d 65 2c 20 70 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 50 61 74 68 43 me,.path,.ref.indexInPath,.PathC
a7c0 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 4e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 omponentType.Name);.............
a7e0 20 20 20 20 20 20 20 2f 2f 20 41 6c 74 65 72 6e 61 74 69 76 65 20 6d 61 74 63 68 20 62 79 20 61 .......//.Alternative.match.by.a
a800 6c 69 61 73 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 lias...................if.(!cont
a820 72 6f 6c 49 73 4d 61 74 63 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a rolIsMatch)..................{..
a840 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 20 69 20 3d ....................for.(var.i.=
a860 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 2e 61 6c 69 61 73 65 73 2e 43 6f 75 6e 74 20 26 26 .0;.i.<.control.aliases.Count.&&
a880 20 21 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 .!controlIsMatch;.++i)..........
a8a0 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 20 ............{...................
a8c0 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 49 73 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 50 61 74 .......controlIsMatch.=.MatchPat
a8e0 68 43 6f 6d 70 6f 6e 65 6e 74 28 63 6f 6e 74 72 6f 6c 2e 61 6c 69 61 73 65 73 5b 69 5d 2c 20 70 hComponent(control.aliases[i],.p
a900 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 ath,.ref.indexInPath,...........
a920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 ...................PathComponent
a940 54 79 70 65 2e 4e 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 Type.Name);.....................
a960 20 7d 0d 0a 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 .}..................}...........
a980 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 77 65 20 68 61 76 ...}................//.If.we.hav
a9a0 65 20 61 20 6d 61 74 63 68 2c 20 72 65 74 75 72 6e 20 69 74 20 6f 72 2c 20 69 66 20 74 68 65 72 e.a.match,.return.it.or,.if.ther
a9c0 65 27 73 20 63 68 69 6c 64 72 65 6e 2c 20 72 65 63 75 72 73 65 20 69 6e 74 6f 20 74 68 65 6d 2e e's.children,.recurse.into.them.
a9e0 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 73 4d 61 74 63 68 ..............if.(controlIsMatch
aa00 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 20 20 )..............{................
aa20 20 20 2f 2f 20 49 66 20 77 65 20 65 6e 64 65 64 20 75 70 20 6f 6e 20 61 20 77 69 6c 64 63 61 72 ..//.If.we.ended.up.on.a.wildcar
aa40 64 2c 20 77 65 27 76 65 20 73 75 63 63 65 73 73 66 75 6c 6c 79 20 6d 61 74 63 68 65 64 20 69 74 d,.we've.successfully.matched.it
aa60 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 ...................if.(indexInPa
aa80 74 68 20 3c 20 70 61 74 68 4c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 th.<.pathLength.&&.path[indexInP
aaa0 61 74 68 5d 20 3d 3d 20 27 2a 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ath].==.'*')....................
aac0 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..++indexInPath;................
aae0 20 20 20 20 2f 2f 20 49 66 20 77 65 27 76 65 20 72 65 61 63 68 65 64 20 74 68 65 20 65 6e 64 20 ....//.If.we've.reached.the.end.
ab00 6f 66 20 74 68 65 20 70 61 74 68 2c 20 77 65 20 68 61 76 65 20 61 20 6d 61 74 63 68 2e 0d 0a 20 of.the.path,.we.have.a.match....
ab20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3d ...............if.(indexInPath.=
ab40 3d 20 70 61 74 68 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b =.pathLength)..................{
ab60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 74 ......................//.Check.t
ab80 79 70 65 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 28 ype.......................if.(!(
aba0 63 6f 6e 74 72 6f 6c 20 69 73 20 54 43 6f 6e 74 72 6f 6c 20 6d 61 74 63 68 29 29 0d 0a 20 20 20 control.is.TControl.match)).....
abc0 20 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 20 6e 75 6c 6c .....................return.null
abe0 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 69 66 20 28 6d 61 74 ;........................if.(mat
ac00 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 chMultiple).....................
ac20 20 20 20 20 20 6d 61 74 63 68 65 73 2e 41 64 64 28 6d 61 74 63 68 29 3b 0d 0a 20 20 20 20 20 20 .....matches.Add(match);........
ac40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 61 74 63 68 3b 0d 0a 20 20 20 ..............return.match;.....
ac60 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 20 20 .............}..................
ac80 20 20 2f 2f 20 49 66 20 77 65 27 76 65 20 72 65 61 63 68 65 64 20 61 20 73 65 70 61 72 61 74 6f ..//.If.we've.reached.a.separato
aca0 72 2c 20 64 69 76 65 20 69 6e 74 6f 20 6f 75 72 20 63 68 69 6c 64 72 65 6e 2e 0d 0a 20 20 20 20 r,.dive.into.our.children.......
acc0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 ............if.(path[indexInPath
ace0 5d 20 3d 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ].==.'/')..................{....
ad00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b ..................++indexInPath;
ad20 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 69 6c 65 6e ........................//.Silen
ad40 74 6c 79 20 61 63 63 65 70 74 20 74 72 61 69 6c 69 6e 67 20 73 6c 61 73 68 65 73 2e 0d 0a 20 20 tly.accept.trailing.slashes.....
ad60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 ..................if.(indexInPat
ad80 68 20 3d 3d 20 70 61 74 68 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 h.==.pathLength)................
ada0 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 20 20 20 20 20 ......{.........................
adc0 20 2f 2f 20 43 68 65 63 6b 20 74 79 70 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .//.Check.type..................
ade0 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 63 6f 6e 74 72 6f 6c 20 69 73 20 54 43 6f 6e 74 72 .........if.(!(control.is.TContr
ae00 6f 6c 20 6d 61 74 63 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ol.match))......................
ae20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ........return.null;............
ae40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 74 63 68 4d 75 6c 74 69 70 6c ................if.(matchMultipl
ae60 65 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 20 20 20 20 e)..............................
ae80 6d 61 74 63 68 65 73 2e 41 64 64 28 6d 61 74 63 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 matches.Add(match);.............
aea0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 61 74 63 68 3b 0d 0a 20 20 20 20 .............return.match;......
aec0 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 20 ................}...............
aee0 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 77 65 20 77 61 6e 74 20 74 6f 20 6d 61 .........//.See.if.we.want.to.ma
af00 74 63 68 20 63 68 69 6c 64 72 65 6e 20 62 79 20 75 73 61 67 65 20 6f 72 20 62 79 20 6e 61 6d 65 tch.children.by.usage.or.by.name
af20 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 43 6f 6e 74 72 6f 6c 20 .......................TControl.
af40 6c 61 73 74 4d 61 74 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lastMatch;......................
af60 69 66 20 28 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 7b 27 29 0d 0a 20 if.(path[indexInPath].==.'{')...
af80 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 20 20 20 20 20 20 20 ...................{............
afa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 73 75 70 70 6f 72 74 20 ..............////TODO:.support.
afc0 73 63 61 76 65 6e 67 69 6e 67 20 61 20 73 75 62 68 69 65 72 61 72 63 68 79 20 66 6f 72 20 75 73 scavenging.a.subhierarchy.for.us
afe0 61 67 65 73 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 ages..........................if
b000 20 28 21 52 65 66 65 72 65 6e 63 65 45 71 75 61 6c 73 28 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 .(!ReferenceEquals(control.devic
b020 65 2c 20 63 6f 6e 74 72 6f 6c 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e,.control))....................
b040 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 4e 6f 74 49 6d 70 6c 65 6d 65 6e 74 ..........throw.new.NotImplement
b060 65 64 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 edException(....................
b080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 4d 61 74 63 68 69 6e 67 20 75 73 61 67 65 73 20 69 .............."Matching.usages.i
b0a0 6e 73 69 64 65 20 73 75 62 63 6f 6e 74 72 6f 6c 73 20 69 6e 73 74 65 61 64 20 6f 66 20 61 74 20 nside.subcontrols.instead.of.at.
b0c0 64 65 76 69 63 65 20 72 6f 6f 74 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 device.root");..................
b0e0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 73 61 67 65 73 20 61 72 65 20 6b 69 6e 64 20 6f 66 20 ..........//.Usages.are.kind.of.
b100 6c 69 6b 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 73 20 74 68 61 74 20 63 61 6e 20 72 6f 75 74 65 like.entry.points.that.can.route
b120 20 74 6f 20 61 6e 79 77 68 65 72 65 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .to.anywhere.else...............
b140 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 6e 20 61 20 64 65 76 69 63 65 27 73 20 63 6f 6e 74 ...........//.on.a.device's.cont
b160 72 6f 6c 20 68 69 65 72 61 72 63 68 79 20 61 6e 64 20 74 68 65 6e 20 77 65 20 6b 65 65 70 20 67 rol.hierarchy.and.then.we.keep.g
b180 6f 69 6e 67 20 66 72 6f 6d 20 74 68 61 74 20 72 65 2d 72 6f 75 74 65 64 0d 0a 20 20 20 20 20 20 oing.from.that.re-routed........
b1a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 70 6f 69 6e 74 2e 0d 0a 20 20 20 ..................//.point......
b1c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 4d 61 74 63 68 20 3d .....................lastMatch.=
b1e0 20 4d 61 74 63 68 42 79 55 73 61 67 65 41 74 44 65 76 69 63 65 52 6f 6f 74 52 65 63 75 72 73 69 .MatchByUsageAtDeviceRootRecursi
b200 76 65 28 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e ve(control.device,.path,.indexIn
b220 50 61 74 68 2c 20 72 65 66 20 6d 61 74 63 68 65 73 2c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 Path,.ref.matches,.matchMultiple
b240 29 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 20 20 20 20 20 );......................}.......
b260 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.............
b280 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 20 20 .........{......................
b2a0 20 20 20 20 2f 2f 20 47 6f 20 74 68 72 6f 75 67 68 20 63 68 69 6c 64 72 65 6e 20 61 6e 64 20 73 ....//.Go.through.children.and.s
b2c0 65 65 20 77 68 61 74 20 77 65 20 63 61 6e 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 ee.what.we.can.match............
b2e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 ...............lastMatch.=.Match
b300 43 68 69 6c 64 72 65 6e 52 65 63 75 72 73 69 76 65 28 63 6f 6e 74 72 6f 6c 2c 20 70 61 74 68 2c ChildrenRecursive(control,.path,
b320 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 72 65 66 20 6d 61 74 63 68 65 73 2c 20 6d 61 74 63 68 .indexInPath,.ref.matches,.match
b340 4d 75 6c 74 69 70 6c 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 Multiple);......................
b360 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 72 65 74 75 72 6e 20 }........................return.
b380 6c 61 73 74 4d 61 74 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 lastMatch;..................}...
b3a0 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 72 65 74 75 ...........}................retu
b3c0 72 6e 20 6e 75 6c 6c 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 rn.null;..........}............p
b3e0 72 69 76 61 74 65 20 73 74 61 74 69 63 20 54 43 6f 6e 74 72 6f 6c 20 4d 61 74 63 68 42 79 55 73 rivate.static.TControl.MatchByUs
b400 61 67 65 41 74 44 65 76 69 63 65 52 6f 6f 74 52 65 63 75 72 73 69 76 65 3c 54 43 6f 6e 74 72 6f ageAtDeviceRootRecursive<TContro
b420 6c 3e 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 73 74 72 69 6e 67 20 70 61 l>(InputDevice.device,.string.pa
b440 74 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 th,.int.indexInPath,............
b460 20 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e ..ref.InputControlList<TControl>
b480 20 6d 61 74 63 68 65 73 2c 20 62 6f 6f 6c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a 20 .matches,.bool.matchMultiple)...
b4a0 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 ...........where.TControl.:.Inpu
b4c0 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tControl..........{.............
b4e0 20 76 61 72 20 75 73 61 67 65 73 20 3d 20 64 65 76 69 63 65 2e 6d 5f 55 73 61 67 65 73 46 6f 72 .var.usages.=.device.m_UsagesFor
b500 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 69 66 20 28 75 73 EachControl;..............if.(us
b520 61 67 65 73 20 3d 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 72 ages.==.null)..................r
b540 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 eturn.null;................var.u
b560 73 61 67 65 43 6f 75 6e 74 20 3d 20 64 65 76 69 63 65 2e 6d 5f 55 73 61 67 65 54 6f 43 6f 6e 74 sageCount.=.device.m_UsageToCont
b580 72 6f 6c 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 rol.Length;..............var.sta
b5a0 72 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 49 6e 50 61 74 68 20 2b 20 31 3b 0d 0a 20 20 20 20 rtIndex.=.indexInPath.+.1;......
b5c0 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 43 61 6e 4d 61 74 63 68 4d 75 6c 74 69 70 6c 65 ........var.pathCanMatchMultiple
b5e0 20 3d 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 43 61 6e 59 69 65 6c 64 4d 75 6c 74 69 70 6c 65 .=.PathComponentCanYieldMultiple
b600 4d 61 74 63 68 65 73 28 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 29 3b 0d 0a 20 20 20 Matches(path,.indexInPath);.....
b620 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 4c 65 6e 67 74 68 20 3d 20 70 61 74 68 2e 4c .........var.pathLength.=.path.L
b640 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 ength;................Debug.Asse
b660 72 74 28 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 7b 27 29 3b 0d 0a 20 rt(path[indexInPath].==.'{');...
b680 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 ...........++indexInPath;.......
b6a0 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 3d 20 70 61 74 68 4c 65 .......if.(indexInPath.==.pathLe
b6c0 6e 67 74 68 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 ngth)..................throw.new
b6e0 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 24 22 49 6e 76 61 6c 69 64 20 70 61 74 .ArgumentException($"Invalid.pat
b700 68 20 73 70 65 63 20 27 7b 70 61 74 68 7d 27 3b 20 74 72 61 69 6c 69 6e 67 20 27 7b 7b 27 22 2c h.spec.'{path}';.trailing.'{{'",
b720 20 6e 61 6d 65 6f 66 28 70 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 .nameof(path));................T
b740 43 6f 6e 74 72 6f 6c 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 Control.lastMatch.=.null;.......
b760 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 75 73 61 .........for.(var.i.=.0;.i.<.usa
b780 67 65 43 6f 75 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 geCount;.++i)..............{....
b7a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 61 67 65 20 3d 20 75 73 61 67 65 73 ..............var.usage.=.usages
b7c0 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 [i];..................Debug.Asse
b7e0 72 74 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 75 73 61 67 65 29 2c rt(!string.IsNullOrEmpty(usage),
b800 20 22 55 73 61 67 65 20 65 6e 74 72 79 20 69 73 20 65 6d 70 74 79 22 29 3b 0d 0a 0d 0a 20 20 20 ."Usage.entry.is.empty");.......
b820 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 75 73 61 67 65 20 61 67 61 69 .............//.Match.usage.agai
b840 6e 73 74 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 nst.path...................var.u
b860 73 61 67 65 49 73 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 sageIsMatch.=.MatchPathComponent
b880 28 75 73 61 67 65 2c 20 70 61 74 68 2c 20 72 65 66 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 50 (usage,.path,.ref.indexInPath,.P
b8a0 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 55 73 61 67 65 29 3b 0d 0a 0d 0a 20 20 20 20 athComponentType.Usage);........
b8c0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 20 69 73 6e 27 74 20 61 20 6d 61 74 ............//.If.it.isn't.a.mat
b8e0 63 68 2c 20 67 6f 20 74 6f 20 6e 65 78 74 20 75 73 61 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 ch,.go.to.next.usage............
b900 20 20 20 20 20 20 20 69 66 20 28 21 75 73 61 67 65 49 73 4d 61 74 63 68 29 0d 0a 20 20 20 20 20 .......if.(!usageIsMatch).......
b920 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 ...........{....................
b940 20 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 73 74 61 72 74 49 6e 64 65 78 3b 0d 0a 20 20 20 ..indexInPath.=.startIndex;.....
b960 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 20 20 20 20 .................continue;......
b980 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 20 20 20 ............}...................
b9a0 20 76 61 72 20 63 6f 6e 74 72 6f 6c 4d 61 74 63 68 65 64 42 79 55 73 61 67 65 20 3d 20 64 65 76 .var.controlMatchedByUsage.=.dev
b9c0 69 63 65 2e 6d 5f 55 73 61 67 65 54 6f 43 6f 6e 74 72 6f 6c 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 ice.m_UsageToControl[i];........
b9e0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 72 65 27 73 20 6d 6f 72 65 20 74 ............//.If.there's.more.t
ba00 6f 20 67 6f 20 69 6e 20 74 68 65 20 70 61 74 68 2c 20 64 69 76 65 20 69 6e 74 6f 20 74 68 65 20 o.go.in.the.path,.dive.into.the.
ba20 63 68 69 6c 64 72 65 6e 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 children.of.the.control.........
ba40 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 70 61 74 68 ..........if.(indexInPath.<.path
ba60 4c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 Length.&&.path[indexInPath].==.'
ba80 2f 27 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 /')..................{..........
baa0 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 43 68 69 ............lastMatch.=.MatchChi
bac0 6c 64 72 65 6e 52 65 63 75 72 73 69 76 65 28 63 6f 6e 74 72 6f 6c 4d 61 74 63 68 65 64 42 79 55 ldrenRecursive(controlMatchedByU
bae0 73 61 67 65 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 20 2b 20 31 2c 0d 0a 20 20 sage,.path,.indexInPath.+.1,....
bb00 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 6d 61 74 63 68 65 ......................ref.matche
bb20 73 2c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 s,.matchMultiple);..............
bb40 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 63 61 6e 20 73 74 6f 70 20 67 6f 69 6e 67 20 74 ..........//.We.can.stop.going.t
bb60 68 72 6f 75 67 68 20 75 73 61 67 65 73 20 69 66 20 77 65 20 6d 61 74 63 68 65 64 20 73 6f 6d 65 hrough.usages.if.we.matched.some
bb80 74 68 69 6e 67 20 61 6e 64 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 thing.and.the...................
bba0 20 20 20 2f 2f 20 70 61 74 68 20 63 6f 6d 70 6f 6e 65 6e 74 20 63 6f 76 65 72 69 6e 67 20 75 73 ...//.path.component.covering.us
bbc0 61 67 65 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 77 69 6c 64 63 61 72 64 73 2e 0d age.does.not.contain.wildcards..
bbe0 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 6c 61 73 74 4d 61 74 .....................if.(lastMat
bc00 63 68 20 21 3d 20 6e 75 6c 6c 20 26 26 20 21 70 61 74 68 43 61 6e 4d 61 74 63 68 4d 75 6c 74 69 ch.!=.null.&&.!pathCanMatchMulti
bc20 70 6c 65 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 62 72 ple)..........................br
bc40 65 61 6b 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 2f 2f 20 57 eak;........................//.W
bc60 65 20 63 61 6e 20 73 74 6f 70 20 67 6f 69 6e 67 20 74 68 72 6f 75 67 68 20 75 73 61 67 65 73 20 e.can.stop.going.through.usages.
bc80 69 66 20 77 65 20 68 61 76 65 20 61 20 6d 61 74 63 68 20 61 6e 64 20 61 72 65 20 6f 6e 6c 79 0d if.we.have.a.match.and.are.only.
bca0 0a 20 20 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 .....................//.looking.
bcc0 66 6f 72 20 61 20 73 69 6e 67 6c 65 20 6f 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 for.a.single.one................
bce0 20 20 20 20 20 20 20 69 66 20 28 6c 61 73 74 4d 61 74 63 68 20 21 3d 20 6e 75 6c 6c 20 26 26 20 .......if.(lastMatch.!=.null.&&.
bd00 21 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 !matchMultiple).................
bd20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........break;.................
bd40 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........
bd60 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 20 ..........{.....................
bd80 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 63 6f 6e 74 72 6f 6c 4d 61 74 63 68 65 64 42 79 55 73 61 .lastMatch.=.controlMatchedByUsa
bda0 67 65 20 61 73 20 54 43 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ge.as.TControl;.................
bdc0 20 20 20 20 20 69 66 20 28 6c 61 73 74 4d 61 74 63 68 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 .....if.(lastMatch.!=.null).....
bde0 20 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 .................{..............
be00 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a ............if.(matchMultiple)..
be20 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 6d 61 74 63 ............................matc
be40 68 65 73 2e 41 64 64 28 6c 61 73 74 4d 61 74 63 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 hes.Add(lastMatch);.............
be60 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 20 20 .............else...............
be80 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 ...........{....................
bea0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 6c 6f 6f 6b 69 6e 67 20 66 6f 72 20 73 69 ..........//.Only.looking.for.si
bec0 6e 67 6c 65 20 6d 61 74 63 68 20 61 6e 64 20 77 65 20 68 61 76 65 20 6f 6e 65 2e 0d 0a 20 20 20 ngle.match.and.we.have.one......
bee0 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 72 65 61 6b 3b 0d .........................break;.
bf00 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 7d 0d 0a 20 20 20 20 .........................}......
bf20 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 20 20 ................}...............
bf40 20 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 ...}..............}.............
bf60 20 20 20 72 65 74 75 72 6e 20 6c 61 73 74 4d 61 74 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ...return.lastMatch;..........}.
bf80 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 54 43 6f 6e 74 72 ...........private.static.TContr
bfa0 6f 6c 20 4d 61 74 63 68 43 68 69 6c 64 72 65 6e 52 65 63 75 72 73 69 76 65 3c 54 43 6f 6e 74 72 ol.MatchChildrenRecursive<TContr
bfc0 6f 6c 3e 28 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 ol>(InputControl.control,.string
bfe0 20 70 61 74 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 0d 0a 20 20 20 20 20 20 20 .path,.int.indexInPath,.........
c000 20 20 20 20 20 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 .....ref.InputControlList<TContr
c020 6f 6c 3e 20 6d 61 74 63 68 65 73 2c 20 62 6f 6f 6c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 ol>.matches,.bool.matchMultiple)
c040 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 ..............where.TControl.:.I
c060 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 nputControl..........{..........
c080 20 20 20 20 76 61 72 20 63 68 69 6c 64 72 65 6e 20 3d 20 63 6f 6e 74 72 6f 6c 2e 63 68 69 6c 64 ....var.children.=.control.child
c0a0 72 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 43 6f 75 6e 74 ren;..............var.childCount
c0c0 20 3d 20 63 68 69 6c 64 72 65 6e 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .=.children.Count;..............
c0e0 54 43 6f 6e 74 72 6f 6c 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 TControl.lastMatch.=.null;......
c100 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 43 61 6e 4d 61 74 63 68 4d 75 6c 74 69 70 6c 65 ........var.pathCanMatchMultiple
c120 20 3d 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 43 61 6e 59 69 65 6c 64 4d 75 6c 74 69 70 6c 65 .=.PathComponentCanYieldMultiple
c140 4d 61 74 63 68 65 73 28 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 29 3b 0d 0a 0d 0a 20 Matches(path,.indexInPath);.....
c160 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 69 20 3c 20 63 ...........for.(var.i.=.0;.i.<.c
c180 68 69 6c 64 43 6f 75 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 hildCount;.++i)..............{..
c1a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 20 3d 20 63 68 69 6c ................var.child.=.chil
c1c0 64 72 65 6e 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 dren[i];..................var.ch
c1e0 69 6c 64 4d 61 74 63 68 20 3d 20 4d 61 74 63 68 43 6f 6e 74 72 6f 6c 73 52 65 63 75 72 73 69 76 ildMatch.=.MatchControlsRecursiv
c200 65 28 63 68 69 6c 64 2c 20 70 61 74 68 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 72 65 66 20 e(child,.path,.indexInPath,.ref.
c220 6d 61 74 63 68 65 73 2c 20 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 3b 0d 0a 0d 0a 20 20 20 20 matches,.matchMultiple);........
c240 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 69 6c 64 4d 61 74 63 68 20 3d 3d 20 6e 75 ............if.(childMatch.==.nu
c260 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 63 6f 6e 74 69 6e 75 ll)......................continu
c280 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 49 66 20 74 68 65 20 e;....................//.If.the.
c2a0 63 68 69 6c 64 20 6d 61 74 63 68 65 64 20 73 6f 6d 65 74 68 69 6e 67 20 61 6e 20 74 68 65 72 65 child.matched.something.an.there
c2c0 27 73 20 6e 6f 20 77 69 6c 64 63 61 72 64 73 20 69 6e 20 74 68 65 20 63 68 69 6c 64 0d 0a 20 20 's.no.wildcards.in.the.child....
c2e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 70 6f 72 74 69 6f 6e 20 6f 66 20 74 68 65 20 ..............//.portion.of.the.
c300 70 61 74 68 2c 20 77 65 20 63 61 6e 20 73 74 6f 70 20 73 65 61 72 63 68 69 6e 67 2e 0d 0a 20 20 path,.we.can.stop.searching.....
c320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 70 61 74 68 43 61 6e 4d 61 74 63 68 4d ..............if.(!pathCanMatchM
c340 75 6c 74 69 70 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ultiple)......................re
c360 74 75 72 6e 20 63 68 69 6c 64 4d 61 74 63 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 turn.childMatch;................
c380 20 20 20 20 2f 2f 20 49 66 20 77 65 20 61 72 65 20 6f 6e 6c 79 20 6c 6f 6f 6b 69 6e 67 20 66 6f ....//.If.we.are.only.looking.fo
c3a0 72 20 74 68 65 20 66 69 72 73 74 20 6d 61 74 63 68 20 61 6e 64 20 61 20 63 68 69 6c 64 20 6d 61 r.the.first.match.and.a.child.ma
c3c0 74 63 68 65 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 65 20 63 61 tched,..................//.we.ca
c3e0 6e 20 61 6c 73 6f 20 73 74 6f 70 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 n.also.stop...................if
c400 20 28 21 6d 61 74 63 68 4d 75 6c 74 69 70 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .(!matchMultiple)...............
c420 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 68 69 6c 64 4d 61 74 63 68 3b 0d 0a 0d 0a 20 20 20 .......return.childMatch;.......
c440 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 74 68 65 72 77 69 73 65 20 77 65 20 68 61 76 .............//.Otherwise.we.hav
c460 65 20 74 6f 20 67 6f 20 68 75 6e 74 69 6e 67 20 74 68 72 6f 75 67 68 20 74 68 65 20 68 69 65 72 e.to.go.hunting.through.the.hier
c480 61 72 63 68 79 20 69 6e 20 63 61 73 65 20 74 68 65 72 65 20 61 72 65 0d 0a 20 20 20 20 20 20 20 archy.in.case.there.are.........
c4a0 20 20 20 20 20 20 20 20 20 2f 2f 20 6d 6f 72 65 20 6d 61 74 63 68 65 73 2e 0d 0a 20 20 20 20 20 .........//.more.matches........
c4c0 20 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 4d 61 74 63 68 20 3d 20 63 68 69 6c 64 4d 61 74 63 ...........lastMatch.=.childMatc
c4e0 68 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 h;..............}...............
c500 20 72 65 74 75 72 6e 20 6c 61 73 74 4d 61 74 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d .return.lastMatch;..........}...
c520 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 65 6e 75 6d 20 50 61 74 68 43 6f 6d 70 6f 6e .........private.enum.PathCompon
c540 65 6e 74 54 79 70 65 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 entType..........{..............
c560 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 69 73 70 6c 61 79 4e 61 6d 65 2c 0d Name,..............DisplayName,.
c580 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 73 61 67 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .............Usage,.............
c5a0 20 4c 61 79 6f 75 74 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 .Layout..........}............pr
c5c0 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 4d 61 74 63 68 50 61 74 68 43 6f 6d 70 6f ivate.static.bool.MatchPathCompo
c5e0 6e 65 6e 74 28 73 74 72 69 6e 67 20 63 6f 6d 70 6f 6e 65 6e 74 2c 20 73 74 72 69 6e 67 20 70 61 nent(string.component,.string.pa
c600 74 68 2c 20 72 65 66 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 50 61 74 68 43 6f 6d th,.ref.int.indexInPath,.PathCom
c620 70 6f 6e 65 6e 74 54 79 70 65 20 63 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2c 20 69 6e 74 20 73 74 ponentType.componentType,.int.st
c640 61 72 74 49 6e 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 artIndexInComponent.=.0)........
c660 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 72 74 28 63 6f ..{..............Debug.Assert(co
c680 6d 70 6f 6e 65 6e 74 20 21 3d 20 6e 75 6c 6c 2c 20 22 43 6f 6d 70 6f 6e 65 6e 74 20 73 74 72 69 mponent.!=.null,."Component.stri
c6a0 6e 67 20 69 73 20 6e 75 6c 6c 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 ng.is.null");..............Debug
c6c0 2e 41 73 73 65 72 74 28 70 61 74 68 20 21 3d 20 6e 75 6c 6c 2c 20 22 50 61 74 68 20 69 73 20 6e .Assert(path.!=.null,."Path.is.n
c6e0 75 6c 6c 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6d 70 6f 6e ull");................var.compon
c700 65 6e 74 4c 65 6e 67 74 68 20 3d 20 63 6f 6d 70 6f 6e 65 6e 74 2e 4c 65 6e 67 74 68 3b 0d 0a 20 entLength.=.component.Length;...
c720 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 74 68 4c 65 6e 67 74 68 20 3d 20 70 61 74 68 ...........var.pathLength.=.path
c740 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 72 74 49 .Length;..............var.startI
c760 6e 64 65 78 20 3d 20 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ndex.=.indexInPath;.............
c780 20 20 20 2f 2f 20 54 72 79 20 74 6f 20 77 61 6c 6b 20 74 68 65 20 6e 61 6d 65 20 61 73 20 66 61 ...//.Try.to.walk.the.name.as.fa
c7a0 72 20 61 73 20 77 65 20 63 61 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e r.as.we.can...............var.in
c7c0 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 20 3d 20 73 74 61 72 74 49 6e 64 65 78 49 6e 43 6f 6d dexInComponent.=.startIndexInCom
c7e0 70 6f 6e 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 69 6e 64 65 ponent;..............while.(inde
c800 78 49 6e 50 61 74 68 20 3c 20 70 61 74 68 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 xInPath.<.pathLength)...........
c820 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 43 68 65 63 6b 20 69 ...{..................//.Check.i
c840 66 20 77 65 27 76 65 20 72 65 61 63 68 65 64 20 61 20 74 65 72 6d 69 6e 61 74 6f 72 20 69 6e 20 f.we've.reached.a.terminator.in.
c860 74 68 65 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e the.path...................var.n
c880 65 78 74 43 68 61 72 49 6e 50 61 74 68 20 3d 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 extCharInPath.=.path[indexInPath
c8a0 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 78 74 43 68 61 72 ];..................if.(nextChar
c8c0 49 6e 50 61 74 68 20 3d 3d 20 27 5c 5c 27 20 26 26 20 69 6e 64 65 78 49 6e 50 61 74 68 20 2b 20 InPath.==.'\\'.&&.indexInPath.+.
c8e0 31 20 3c 20 70 61 74 68 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1.<.pathLength).................
c900 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 73 63 61 70 .{......................//.Escap
c920 65 64 20 63 68 61 72 61 63 74 65 72 2e 20 42 79 70 61 73 73 20 74 72 65 61 74 6d 65 6e 74 20 6f ed.character..Bypass.treatment.o
c940 66 20 73 70 65 63 69 61 6c 20 63 68 61 72 61 63 74 65 72 73 20 62 65 6c 6f 77 2e 0d 0a 20 20 20 f.special.characters.below......
c960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d .................++indexInPath;.
c980 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 78 74 43 68 61 72 49 6e 50 .....................nextCharInP
c9a0 61 74 68 20 3d 20 70 61 74 68 5b 69 6e 64 65 78 49 6e 50 61 74 68 5d 3b 0d 0a 20 20 20 20 20 20 ath.=.path[indexInPath];........
c9c0 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 20 20 65 6c 73 ..........}..................els
c9e0 65 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 e..................{............
ca00 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 78 74 43 68 61 72 49 6e 50 61 74 68 20 3d 3d 20 ..........if.(nextCharInPath.==.
ca20 27 2f 27 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 62 72 '/')..........................br
ca40 65 61 6b 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 20 28 28 6e eak;......................if.((n
ca60 65 78 74 43 68 61 72 49 6e 50 61 74 68 20 3d 3d 20 27 3e 27 20 26 26 20 63 6f 6d 70 6f 6e 65 6e extCharInPath.==.'>'.&&.componen
ca80 74 54 79 70 65 20 3d 3d 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 4c 61 79 6f 75 tType.==.PathComponentType.Layou
caa0 74 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 7c 7c 20 28 t)..........................||.(
cac0 6e 65 78 74 43 68 61 72 49 6e 50 61 74 68 20 3d 3d 20 27 7d 27 20 26 26 20 63 6f 6d 70 6f 6e 65 nextCharInPath.==.'}'.&&.compone
cae0 6e 74 54 79 70 65 20 3d 3d 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 55 73 61 67 ntType.==.PathComponentType.Usag
cb00 65 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 7c 7c 20 28 e)..........................||.(
cb20 6e 65 78 74 43 68 61 72 49 6e 50 61 74 68 20 3d 3d 20 27 29 27 20 26 26 20 63 6f 6d 70 6f 6e 65 nextCharInPath.==.')'.&&.compone
cb40 6e 74 54 79 70 65 20 3d 3d 20 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 54 79 70 65 2e 44 69 73 70 ntType.==.PathComponentType.Disp
cb60 6c 61 79 4e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b layName))......................{
cb80 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 2b 2b 69 6e 64 65 ..........................++inde
cba0 78 49 6e 50 61 74 68 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 xInPath;........................
cbc0 20 20 62 72 65 61 6b 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 ..break;......................}.
cbe0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a .......................////TODO:
cc00 20 61 6c 6c 6f 77 20 6f 6e 6c 79 20 73 69 6e 67 6c 65 20 27 2a 27 20 61 6e 64 20 72 65 63 6f 67 .allow.only.single.'*'.and.recog
cc20 6e 69 7a 65 20 27 2a 2a 27 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f nize.'**'....................../
cc40 2f 20 49 66 20 77 65 27 76 65 20 72 65 61 63 68 65 64 20 61 20 27 2a 27 20 69 6e 20 74 68 65 20 /.If.we've.reached.a.'*'.in.the.
cc60 70 61 74 68 2c 20 73 6b 69 70 20 63 68 61 72 61 63 74 65 72 20 69 6e 20 6e 61 6d 65 2e 0d 0a 20 path,.skip.character.in.name....
cc80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 78 74 43 68 61 72 49 ...................if.(nextCharI
cca0 6e 50 61 74 68 20 3d 3d 20 27 2a 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nPath.==.'*')...................
ccc0 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 ...{..........................//
cce0 20 42 75 74 20 66 69 72 73 74 20 6c 65 74 27 73 20 73 65 65 20 69 66 20 77 65 20 68 61 76 65 20 .But.first.let's.see.if.we.have.
cd00 73 6f 6d 65 74 68 69 6e 67 20 61 66 74 65 72 20 74 68 65 20 77 69 6c 64 63 61 72 64 20 74 68 61 something.after.the.wildcard.tha
cd20 74 20 6d 61 74 63 68 65 73 20 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65 20 63 6f 6d 70 6f 6e t.matches.the.rest.of.the.compon
cd40 65 6e 74 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 2f 2f ent...........................//
cd60 20 54 68 69 73 20 63 6f 75 6c 64 20 62 65 20 77 68 65 6e 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 .This.could.be.when,.for.example
cd80 2c 20 77 65 20 68 69 74 20 22 54 22 20 6f 6e 20 6d 61 74 63 68 69 6e 67 20 22 6c 65 66 74 54 72 ,.we.hit."T".on.matching."leftTr
cda0 69 67 67 65 72 22 20 61 67 61 69 6e 73 74 20 22 2a 54 72 69 67 67 65 72 22 2e 20 57 65 20 68 61 igger".against."*Trigger"..We.ha
cdc0 76 65 20 74 6f 20 73 74 6f 70 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ve.to.stop......................
cde0 20 20 20 20 2f 2f 20 67 6f 62 62 6c 69 6e 67 20 75 70 20 63 68 61 72 61 63 74 65 72 73 20 66 6f ....//.gobbling.up.characters.fo
ce00 72 20 74 68 65 20 77 69 6c 64 63 61 72 64 20 77 68 65 6e 20 72 65 61 63 68 69 6e 67 20 22 54 72 r.the.wildcard.when.reaching."Tr
ce20 69 67 67 65 72 22 20 69 6e 20 74 68 65 20 63 6f 6d 70 6f 6e 65 6e 74 20 6e 61 6d 65 2e 0d 0a 20 igger".in.the.component.name....
ce40 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 0d 0a 20 20 20 20 20 .......................//.......
ce60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 4a 75 73 74 ...................//.NOTE:.Just
ce80 20 6c 6f 6f 6b 69 6e 67 20 61 74 20 74 68 65 20 76 65 72 79 20 6e 65 78 74 20 63 68 61 72 61 63 .looking.at.the.very.next.charac
cea0 74 65 72 20 6f 6e 6c 79 20 69 73 20 2a 4e 4f 54 2a 20 65 6e 6f 75 67 68 2e 20 57 65 20 6e 65 65 ter.only.is.*NOT*.enough..We.nee
cec0 64 20 74 6f 20 6d 61 74 63 68 20 74 68 65 20 65 6e 74 69 72 65 20 72 65 73 74 20 6f 66 0d 0a 20 d.to.match.the.entire.rest.of...
cee0 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 20 20 20 20 20 20 .......................//.......
cf00 74 68 65 20 70 61 74 68 2e 20 4f 74 68 65 72 77 69 73 65 2c 20 69 6e 20 74 68 65 20 65 78 61 6d the.path..Otherwise,.in.the.exam
cf20 70 6c 65 20 61 62 6f 76 65 2c 20 77 65 20 77 6f 75 6c 64 20 73 74 6f 70 20 6f 6e 20 73 65 65 69 ple.above,.we.would.stop.on.seei
cf40 6e 67 20 74 68 65 20 6c 6f 77 65 72 63 61 73 65 20 27 74 27 20 61 6e 64 20 74 68 65 6e 20 62 65 ng.the.lowercase.'t'.and.then.be
cf60 20 6c 65 66 74 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 .left........................../
cf80 2f 20 20 20 20 20 20 20 74 72 79 69 6e 67 20 74 6f 20 6d 61 74 63 68 20 22 74 54 72 69 67 67 65 /.......trying.to.match."tTrigge
cfa0 72 22 20 61 67 61 69 6e 73 74 20 22 54 72 69 67 67 65 72 22 2e 0d 0a 20 20 20 20 20 20 20 20 20 r".against."Trigger"............
cfc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e 64 65 78 41 66 74 65 72 57 69 6c ...............var.indexAfterWil
cfe0 64 63 61 72 64 20 3d 20 69 6e 64 65 78 49 6e 50 61 74 68 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 dcard.=.indexInPath.+.1;........
d000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 50 61 74 ..................if.(indexInPat
d020 68 20 3c 20 28 70 61 74 68 4c 65 6e 67 74 68 20 2d 20 31 29 20 26 26 0d 0a 20 20 20 20 20 20 20 h.<.(pathLength.-.1).&&.........
d040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 64 65 78 49 6e 43 6f 6d 70 .....................indexInComp
d060 6f 6e 65 6e 74 20 3c 20 63 6f 6d 70 6f 6e 65 6e 74 4c 65 6e 67 74 68 20 26 26 0d 0a 20 20 20 20 onent.<.componentLength.&&......
d080 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 61 74 63 68 50 61 74 ........................MatchPat
d0a0 68 43 6f 6d 70 6f 6e 65 6e 74 28 63 6f 6d 70 6f 6e 65 6e 74 2c 20 70 61 74 68 2c 20 72 65 66 20 hComponent(component,.path,.ref.
d0c0 69 6e 64 65 78 41 66 74 65 72 57 69 6c 64 63 61 72 64 2c 20 63 6f 6d 70 6f 6e 65 6e 74 54 79 70 indexAfterWildcard,.componentTyp
d0e0 65 2c 20 69 6e 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 29 29 0d 0a 20 20 20 20 20 20 20 20 20 e,.indexInComponent))...........
d100 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 20 ...............{................
d120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 69 6e 64 65 ..............indexInPath.=.inde
d140 78 41 66 74 65 72 57 69 6c 64 63 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 xAfterWildcard;.................
d160 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 .............return.true;.......
d180 20 20 20 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 ...................}............
d1a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 43 6f 6d 70 6f ................if.(indexInCompo
d1c0 6e 65 6e 74 20 3c 20 63 6f 6d 70 6f 6e 65 6e 74 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 nent.<.componentLength).........
d1e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 43 6f .....................++indexInCo
d200 6d 70 6f 6e 65 6e 74 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 mponent;........................
d220 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 20 ..else..........................
d240 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ....return.true;................
d260 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 ............continue;...........
d280 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 20 20 7d 0d ...........}..................}.
d2a0 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 65 27 76 65 20 72 ...................//.If.we've.r
d2c0 65 61 63 68 65 64 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 63 6f 6d 70 6f 6e 65 6e 74 20 eached.the.end.of.the.component.
d2e0 6e 61 6d 65 2c 20 77 65 20 64 69 64 20 73 6f 20 62 65 66 6f 72 65 0d 0a 20 20 20 20 20 20 20 20 name,.we.did.so.before..........
d300 20 20 20 20 20 20 20 20 2f 2f 20 77 65 27 76 65 20 72 65 61 63 68 65 64 20 61 20 74 65 72 6d 69 ........//.we've.reached.a.termi
d320 6e 61 74 6f 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 nator..................if.(index
d340 49 6e 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 63 6f 6d 70 6f 6e 65 6e 74 4c 65 6e 67 74 68 29 0d InComponent.==.componentLength).
d360 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 .................{..............
d380 20 20 20 20 20 20 20 20 69 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 73 74 61 72 74 49 6e 64 65 78 ........indexInPath.=.startIndex
d3a0 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 20 66 61 ;......................return.fa
d3c0 6c 73 65 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 20 lse;..................}.........
d3e0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 72 2e 54 6f 4c 6f 77 65 72 28 63 6f 6d 70 ...........if.(char.ToLower(comp
d400 6f 6e 65 6e 74 5b 69 6e 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 5d 29 20 3d 3d 20 63 68 61 72 onent[indexInComponent]).==.char
d420 2e 54 6f 4c 6f 77 65 72 28 6e 65 78 74 43 68 61 72 49 6e 50 61 74 68 29 29 0d 0a 20 20 20 20 20 .ToLower(nextCharInPath)).......
d440 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 ...........{....................
d460 20 20 2b 2b 69 6e 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 ..++indexInComponent;...........
d480 20 20 20 20 20 20 20 20 20 20 20 2b 2b 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 ...........++indexInPath;.......
d4a0 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 20 20 65 6c ...........}..................el
d4c0 73 65 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 se..................{...........
d4e0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 61 6d 65 20 69 73 6e 27 74 20 61 20 6d 61 74 63 68 ...........//.Name.isn't.a.match
d500 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 64 65 78 49 6e 50 61 .......................indexInPa
d520 74 68 20 3d 20 73 74 61 72 74 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 th.=.startIndex;................
d540 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ......return.false;.............
d560 20 20 20 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 .....}..............}...........
d580 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 49 6e 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 63 6f 6d .....if.(indexInComponent.==.com
d5a0 70 6f 6e 65 6e 74 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 ponentLength)..................r
d5c0 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 64 65 78 eturn.true;................index
d5e0 49 6e 50 61 74 68 20 3d 20 73 74 61 72 74 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 InPath.=.startIndex;............
d600 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ..return.false;..........}......
d620 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 50 61 74 68 43 6f ......private.static.bool.PathCo
d640 6d 70 6f 6e 65 6e 74 43 61 6e 59 69 65 6c 64 4d 75 6c 74 69 70 6c 65 4d 61 74 63 68 65 73 28 73 mponentCanYieldMultipleMatches(s
d660 74 72 69 6e 67 20 70 61 74 68 2c 20 69 6e 74 20 69 6e 64 65 78 49 6e 50 61 74 68 29 0d 0a 20 20 tring.path,.int.indexInPath)....
d680 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 69 6e 64 65 78 4f 66 ......{..............var.indexOf
d6a0 4e 65 78 74 53 6c 61 73 68 20 3d 20 70 61 74 68 2e 49 6e 64 65 78 4f 66 28 27 2f 27 2c 20 69 6e NextSlash.=.path.IndexOf('/',.in
d6c0 64 65 78 49 6e 50 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 dexInPath);..............if.(ind
d6e0 65 78 4f 66 4e 65 78 74 53 6c 61 73 68 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 exOfNextSlash.==.-1)............
d700 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 74 68 2e 49 6e 64 65 78 4f 66 28 27 2a 27 2c 20 69 ......return.path.IndexOf('*',.i
d720 6e 64 65 78 49 6e 50 61 74 68 29 20 21 3d 20 2d 31 20 7c 7c 20 70 61 74 68 2e 49 6e 64 65 78 4f ndexInPath).!=.-1.||.path.IndexO
d740 66 28 27 3c 27 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 29 20 21 3d 20 2d 31 3b 0d 0a 0d 0a 20 20 f('<',.indexInPath).!=.-1;......
d760 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 65 6e 67 74 68 20 3d 20 69 6e 64 65 78 4f 66 4e 65 ..........var.length.=.indexOfNe
d780 78 74 53 6c 61 73 68 20 2d 20 69 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 xtSlash.-.indexInPath;..........
d7a0 20 20 20 20 72 65 74 75 72 6e 20 70 61 74 68 2e 49 6e 64 65 78 4f 66 28 27 2a 27 2c 20 69 6e 64 ....return.path.IndexOf('*',.ind
d7c0 65 78 49 6e 50 61 74 68 2c 20 6c 65 6e 67 74 68 29 20 21 3d 20 2d 31 20 7c 7c 20 70 61 74 68 2e exInPath,.length).!=.-1.||.path.
d7e0 49 6e 64 65 78 4f 66 28 27 3c 27 2c 20 69 6e 64 65 78 49 6e 50 61 74 68 2c 20 6c 65 6e 67 74 68 IndexOf('<',.indexInPath,.length
d800 29 20 21 3d 20 2d 31 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 ).!=.-1;..........}............/
d820 2f 20 50 61 72 73 65 64 20 65 6c 65 6d 65 6e 74 20 62 65 74 77 65 65 6e 20 74 77 6f 20 27 2f 2e /.Parsed.element.between.two.'/.
d840 2e 2f 27 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 50 61 ./'...........internal.struct.Pa
d860 72 73 65 64 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 rsedPathComponent..........{....
d880 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 75 62 73 74 72 69 6e 67 20 6c 61 79 6f 75 ..........public.Substring.layou
d8a0 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 75 62 73 74 72 69 6e 67 t;..............public.Substring
d8c0 5b 5d 20 75 73 61 67 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 [].usages;..............public.S
d8e0 75 62 73 74 72 69 6e 67 20 6e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c ubstring.name;..............publ
d900 69 63 20 53 75 62 73 74 72 69 6e 67 20 64 69 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 ic.Substring.displayName;.......
d920 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 57 69 6c 64 63 61 72 64 20 .........public.bool.isWildcard.
d940 3d 3e 20 6e 61 6d 65 20 3d 3d 20 57 69 6c 64 63 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 =>.name.==.Wildcard;............
d960 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 44 6f 75 62 6c 65 57 69 6c 64 63 61 72 64 20 3d ..public.bool.isDoubleWildcard.=
d980 3e 20 6e 61 6d 65 20 3d 3d 20 44 6f 75 62 6c 65 57 69 6c 64 63 61 72 64 3b 0d 0a 0d 0a 20 20 20 >.name.==.DoubleWildcard;.......
d9a0 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 20 54 6f 48 75 6d 61 6e 52 65 .........public.string.ToHumanRe
d9c0 61 64 61 62 6c 65 53 74 72 69 6e 67 28 73 74 72 69 6e 67 20 70 61 72 65 6e 74 4c 61 79 6f 75 74 adableString(string.parentLayout
d9e0 4e 61 6d 65 2c 20 73 74 72 69 6e 67 20 70 61 72 65 6e 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2c 20 Name,.string.parentControlPath,.
da00 6f 75 74 20 73 74 72 69 6e 67 20 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 74 4e 61 6d 65 2c out.string.referencedLayoutName,
da20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 75 74 20 73 74 72 69 6e 67 20 63 6f 6e ..................out.string.con
da40 74 72 6f 6c 50 61 74 68 2c 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 trolPath,.HumanReadableStringOpt
da60 69 6f 6e 73 20 6f 70 74 69 6f 6e 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ions.options)..............{....
da80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 74 4e 61 ..............referencedLayoutNa
daa0 6d 65 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 63 6f 6e 74 me.=.null;..................cont
dac0 72 6f 6c 50 61 74 68 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rolPath.=.null;.................
dae0 20 20 20 76 61 72 20 72 65 73 75 6c 74 20 3d 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 3b 0d 0a 20 ...var.result.=.string.Empty;...
db00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 57 69 6c 64 63 61 72 64 29 0d 0a ...............if.(isWildcard)..
db20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 73 75 6c 74 20 2b 3d 20 22 41 ....................result.+=."A
db40 6e 79 22 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 75 73 61 67 ny";....................if.(usag
db60 65 73 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 7b 0d 0a es.!=.null)..................{..
db80 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 6d 62 69 6e 65 64 ....................var.combined
dba0 55 73 61 67 65 73 20 3d 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 Usages.=.string.Empty;..........
dbc0 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 69 20 ..............for.(var.i.=.0;.i.
dbe0 3c 20 75 73 61 67 65 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 <.usages.Length;.++i)...........
dc00 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 ...........{....................
dc20 20 20 20 20 20 20 69 66 20 28 75 73 61 67 65 73 5b 69 5d 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 ......if.(usages[i].isEmpty)....
dc40 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 69 6e ..........................contin
dc60 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 20 20 20 20 69 ue;............................i
dc80 66 20 28 63 6f 6d 62 69 6e 65 64 55 73 61 67 65 73 20 21 3d 20 73 74 72 69 6e 67 2e 45 6d 70 74 f.(combinedUsages.!=.string.Empt
dca0 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 20 20 20 20 20 20 y)..............................
dcc0 63 6f 6d 62 69 6e 65 64 55 73 61 67 65 73 20 2b 3d 20 22 20 26 20 22 20 2b 20 54 6f 48 75 6d 61 combinedUsages.+=.".&.".+.ToHuma
dce0 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 75 73 61 67 65 73 5b 69 5d 29 3b 0d 0a 20 20 20 nReadableString(usages[i]);.....
dd00 20 20 20 20 20 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.......
dd20 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 6d 62 69 6e 65 64 55 .......................combinedU
dd40 73 61 67 65 73 20 3d 20 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 75 73 sages.=.ToHumanReadableString(us
dd60 61 67 65 73 5b 69 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ages[i]);......................}
dd80 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 63 6f 6d 62 69 6e ......................if.(combin
dda0 65 64 55 73 61 67 65 73 20 21 3d 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 edUsages.!=.string.Empty).......
ddc0 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 20 ...............{................
dde0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 73 75 6c 74 20 21 3d 20 73 74 72 69 6e 67 2e 45 ..........if.(result.!=.string.E
de00 6d 70 74 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 20 20 20 mpty)...........................
de20 20 20 20 72 65 73 75 6c 74 20 2b 3d 20 27 20 27 20 2b 20 63 6f 6d 62 69 6e 65 64 55 73 61 67 65 ...result.+=.'.'.+.combinedUsage
de40 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 65 6c 73 65 s;..........................else
de60 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 72 65 ..............................re
de80 73 75 6c 74 20 2b 3d 20 63 6f 6d 62 69 6e 65 64 55 73 61 67 65 73 3b 0d 0a 20 20 20 20 20 20 20 sult.+=.combinedUsages;.........
dea0 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 20 20 .............}..................
dec0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6c 61 79 6f 75 74 }....................if.(!layout
dee0 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 7b 0d 0a 20 20 .isEmpty)..................{....
df00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f ..................referencedLayo
df20 75 74 4e 61 6d 65 20 3d 20 6c 61 79 6f 75 74 2e 54 6f 53 74 72 69 6e 67 28 29 3b 0d 0a 0d 0a 20 utName.=.layout.ToString();.....
df40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 68 65 72 65 20 70 6f 73 73 ...................//.Where.poss
df60 69 62 6c 65 2c 20 75 73 65 20 74 68 65 20 64 69 73 70 6c 61 79 4e 61 6d 65 20 6f 66 20 74 68 65 ible,.use.the.displayName.of.the
df80 20 67 69 76 65 6e 20 6c 61 79 6f 75 74 20 72 61 74 68 65 72 20 74 68 61 6e 0d 0a 20 20 20 20 20 .given.layout.rather.than.......
dfa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6a 75 73 74 20 74 68 65 20 69 6e 74 65 72 ...............//.just.the.inter
dfc0 6e 61 6c 20 6c 61 79 6f 75 74 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nal.layout.name.................
dfe0 20 20 20 20 20 20 73 74 72 69 6e 67 20 6c 61 79 6f 75 74 53 74 72 69 6e 67 3b 0d 0a 20 20 20 20 ......string.layoutString;......
e000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 66 65 72 65 6e 63 65 64 4c 61 ................var.referencedLa
e020 79 6f 75 74 20 3d 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 63 61 63 68 65 2e yout.=.InputControlLayout.cache.
e040 46 69 6e 64 4f 72 4c 6f 61 64 4c 61 79 6f 75 74 28 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 FindOrLoadLayout(referencedLayou
e060 74 4e 61 6d 65 2c 20 74 68 72 6f 77 49 66 4e 6f 74 46 6f 75 6e 64 3a 20 66 61 6c 73 65 29 3b 0d tName,.throwIfNotFound:.false);.
e080 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 72 65 66 65 72 65 6e .....................if.(referen
e0a0 63 65 64 4c 61 79 6f 75 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 21 73 74 72 69 6e 67 2e 49 73 4e cedLayout.!=.null.&&.!string.IsN
e0c0 75 6c 6c 4f 72 45 6d 70 74 79 28 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 74 2e 6d 5f 44 69 ullOrEmpty(referencedLayout.m_Di
e0e0 73 70 6c 61 79 4e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 splayName)).....................
e100 20 20 20 20 20 6c 61 79 6f 75 74 53 74 72 69 6e 67 20 3d 20 72 65 66 65 72 65 6e 63 65 64 4c 61 .....layoutString.=.referencedLa
e120 79 6f 75 74 2e 6d 5f 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 yout.m_DisplayName;.............
e140 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...................
e160 20 20 20 20 20 20 20 6c 61 79 6f 75 74 53 74 72 69 6e 67 20 3d 20 54 6f 48 75 6d 61 6e 52 65 61 .......layoutString.=.ToHumanRea
e180 64 61 62 6c 65 53 74 72 69 6e 67 28 6c 61 79 6f 75 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 dableString(layout);............
e1a0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 ............if.(!string.IsNullOr
e1c0 45 6d 70 74 79 28 72 65 73 75 6c 74 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Empty(result))..................
e1e0 20 20 20 20 20 20 20 20 72 65 73 75 6c 74 20 2b 3d 20 27 20 27 20 2b 20 6c 61 79 6f 75 74 53 74 ........result.+=.'.'.+.layoutSt
e200 72 69 6e 67 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d ring;......................else.
e220 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 65 73 75 6c 74 20 .........................result.
e240 2b 3d 20 6c 61 79 6f 75 74 53 74 72 69 6e 67 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 +=.layoutString;................
e260 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6e 61 6d 65 ..}....................if.(!name
e280 2e 69 73 45 6d 70 74 79 20 26 26 20 21 69 73 57 69 6c 64 63 61 72 64 29 0d 0a 20 20 20 20 20 20 .isEmpty.&&.!isWildcard)........
e2a0 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 20 ..........{.....................
e2c0 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 6c 61 79 6f 75 74 20 66 72 6f 6d 20 61 20 70 .//.If.we.have.a.layout.from.a.p
e2e0 72 65 63 65 64 69 6e 67 20 70 61 74 68 20 63 6f 6d 70 6f 6e 65 6e 74 2c 20 74 72 79 20 74 6f 20 receding.path.component,.try.to.
e300 66 69 6e 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 find......................//.the
e320 20 63 6f 6e 74 72 6f 6c 20 62 79 20 6e 61 6d 65 20 6f 6e 20 74 68 65 20 6c 61 79 6f 75 74 2e 20 .control.by.name.on.the.layout..
e340 49 66 20 77 65 20 66 69 6e 64 20 69 74 2c 20 75 73 65 20 69 74 73 20 64 69 73 70 6c 61 79 0d 0a If.we.find.it,.use.its.display..
e360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6e 61 6d 65 20 72 61 74 68 ....................//.name.rath
e380 65 72 20 74 68 61 6e 20 74 68 65 20 6e 61 6d 65 20 72 65 66 65 72 65 6e 63 65 64 20 69 6e 20 74 er.than.the.name.referenced.in.t
e3a0 68 65 20 62 69 6e 64 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 he.binding......................
e3c0 20 73 74 72 69 6e 67 20 6e 61 6d 65 53 74 72 69 6e 67 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 .string.nameString.=.null;......
e3e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 ................if.(!string.IsNu
e400 6c 6c 4f 72 45 6d 70 74 79 28 70 61 72 65 6e 74 4c 61 79 6f 75 74 4e 61 6d 65 29 29 0d 0a 20 20 llOrEmpty(parentLayoutName))....
e420 20 20 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 ..................{.............
e440 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 54 68 69 73 20 70 72 6f 64 75 .............//.NOTE:.This.produ
e460 63 65 73 20 61 20 66 75 6c 6c 79 20 6d 65 72 67 65 64 20 6c 61 79 6f 75 74 2e 20 57 65 20 73 68 ces.a.fully.merged.layout..We.sh
e480 6f 75 6c 64 20 74 68 75 73 20 70 69 63 6b 20 75 70 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 0d ould.thus.pick.up.display.names.
e4a0 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 20 20 20 20 .........................//.....
e4c0 20 20 66 72 6f 6d 20 62 61 73 65 20 6c 61 79 6f 75 74 73 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ..from.base.layouts.automaticall
e4e0 79 20 77 68 65 72 65 76 65 72 20 61 70 70 6c 69 63 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 y.wherever.applicable...........
e500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 61 72 65 6e 74 4c 61 79 6f 75 74 ................var.parentLayout
e520 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 20 20 20 20 .=..............................
e540 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 63 61 63 68 65 2e 46 69 6e 64 4f 72 4c InputControlLayout.cache.FindOrL
e560 6f 61 64 4c 61 79 6f 75 74 28 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 70 61 72 oadLayout(new.InternedString(par
e580 65 6e 74 4c 61 79 6f 75 74 4e 61 6d 65 29 2c 20 74 68 72 6f 77 49 66 4e 6f 74 46 6f 75 6e 64 3a entLayoutName),.throwIfNotFound:
e5a0 20 66 61 6c 73 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 .false);........................
e5c0 20 20 69 66 20 28 70 61 72 65 6e 74 4c 61 79 6f 75 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 ..if.(parentLayout.!=.null).....
e5e0 20 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 20 20 20 20 20 .....................{..........
e600 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 6c 4e ....................var.controlN
e620 61 6d 65 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 2e 54 6f ame.=.new.InternedString(name.To
e640 53 74 72 69 6e 67 28 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 String());......................
e660 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 70 61 72 65 6e 74 4c 61 79 6f ........var.control.=.parentLayo
e680 75 74 2e 46 69 6e 64 43 6f 6e 74 72 6f 6c 49 6e 63 6c 75 64 69 6e 67 41 72 72 61 79 45 6c 65 6d ut.FindControlIncludingArrayElem
e6a0 65 6e 74 73 28 63 6f 6e 74 72 6f 6c 4e 61 6d 65 2c 20 6f 75 74 20 76 61 72 20 61 72 72 61 79 49 ents(controlName,.out.var.arrayI
e6c0 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 20 20 20 20 ndex);..........................
e6e0 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 ....if.(control.!=.null)........
e700 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 20 20 20 20 20 20 20 ......................{.........
e720 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 2f 2f 20 53 79 6e 74 .........................//.Synt
e740 68 65 73 69 7a 65 20 70 61 74 68 20 6f 66 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 hesize.path.of.control..........
e760 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 69 66 20 28 73 74 72 .........................if.(str
e780 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 70 61 72 65 6e 74 43 6f 6e 74 72 6f 6c 50 ing.IsNullOrEmpty(parentControlP
e7a0 61 74 68 29 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 20 ath))...........................
e7c0 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 20 20 20 20 .......{........................
e7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 72 72 61 79 49 6e 64 65 78 20 21 3d 20 ..............if.(arrayIndex.!=.
e800 2d 31 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 20 20 20 -1).............................
e820 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 50 61 74 68 20 3d 20 24 22 7b 63 6f .............controlPath.=.$"{co
e840 6e 74 72 6f 6c 2e 56 61 6c 75 65 2e 6e 61 6d 65 7d 7b 61 72 72 61 79 49 6e 64 65 78 7d 22 3b 0d ntrol.Value.name}{arrayIndex}";.
e860 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 20 20 20 ................................
e880 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 20 20 20 20 .....else.......................
e8a0 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 50 61 74 68 20 3d ...................controlPath.=
e8c0 20 63 6f 6e 74 72 6f 6c 2e 56 61 6c 75 65 2e 6e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .control.Value.name;............
e8e0 20 20 20 20 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 ......................}.........
e900 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 65 6c 73 65 0d 0a 20 .........................else...
e920 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 20 20 20 7b ...............................{
e940 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 20 20 ................................
e960 20 20 20 20 20 20 69 66 20 28 61 72 72 61 79 49 6e 64 65 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 ......if.(arrayIndex.!=.-1).....
e980 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 20 20 20 20 ................................
e9a0 20 20 20 20 20 63 6f 6e 74 72 6f 6c 50 61 74 68 20 3d 20 24 22 7b 70 61 72 65 6e 74 43 6f 6e 74 .....controlPath.=.$"{parentCont
e9c0 72 6f 6c 50 61 74 68 7d 2f 7b 63 6f 6e 74 72 6f 6c 2e 56 61 6c 75 65 2e 6e 61 6d 65 7d 7b 61 72 rolPath}/{control.Value.name}{ar
e9e0 72 61 79 49 6e 64 65 78 7d 22 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rayIndex}";.....................
ea00 20 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 20 20 20 .................else...........
ea20 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 20 20 20 63 ...............................c
ea40 6f 6e 74 72 6f 6c 50 61 74 68 20 3d 20 24 22 7b 70 61 72 65 6e 74 43 6f 6e 74 72 6f 6c 50 61 74 ontrolPath.=.$"{parentControlPat
ea60 68 7d 2f 7b 63 6f 6e 74 72 6f 6c 2e 56 61 6c 75 65 2e 6e 61 6d 65 7d 22 3b 0d 0a 20 20 20 20 20 h}/{control.Value.name}";.......
ea80 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 7d 0d 0a 0d 0a ...........................}....
eaa0 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 20 20 20 20 ................................
eac0 76 61 72 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 20 3d 20 28 6f 70 74 69 6f 6e 73 20 var.shortDisplayName.=.(options.
eae0 26 20 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 55 73 65 &.HumanReadableStringOptions.Use
eb00 53 68 6f 72 74 4e 61 6d 65 73 29 20 21 3d 20 30 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ShortNames).!=.0................
eb20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 63 6f 6e 74 72 6f 6c 2e ......................?.control.
eb40 56 61 6c 75 65 2e 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 Value.shortDisplayName..........
eb60 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 3a 20 6e 75 ............................:.nu
eb80 6c 6c 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 20 20 20 20 20 ll;.............................
eba0 20 20 20 20 20 20 20 76 61 72 20 64 69 73 70 6c 61 79 4e 61 6d 65 20 3d 20 21 73 74 72 69 6e 67 .......var.displayName.=.!string
ebc0 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 29 .IsNullOrEmpty(shortDisplayName)
ebe0 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 20 20 ................................
ec00 20 20 20 20 20 20 3f 20 73 68 6f 72 74 44 69 73 70 6c 61 79 4e 61 6d 65 0d 0a 20 20 20 20 20 20 ......?.shortDisplayName........
ec20 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 20 20 3a 20 ..............................:.
ec40 63 6f 6e 74 72 6f 6c 2e 56 61 6c 75 65 2e 64 69 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 control.Value.displayName;......
ec60 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 20 20 69 66 ..............................if
ec80 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 64 69 73 70 6c 61 79 4e .(!string.IsNullOrEmpty(displayN
eca0 61 6d 65 29 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 20 ame))...........................
ecc0 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 20 20 20 20 .......{........................
ece0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 72 72 61 79 49 6e 64 65 78 20 21 3d 20 ..............if.(arrayIndex.!=.
ed00 2d 31 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 20 20 20 -1).............................
ed20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 53 74 72 69 6e 67 20 3d 20 24 22 7b 64 69 73 .............nameString.=.$"{dis
ed40 70 6c 61 79 4e 61 6d 65 7d 20 23 7b 61 72 72 61 79 49 6e 64 65 78 7d 22 3b 0d 0a 20 20 20 20 20 playName}.#{arrayIndex}";.......
ed60 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 20 20 20 65 ...............................e
ed80 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 20 20 20 20 lse.............................
eda0 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 53 74 72 69 6e 67 20 3d 20 64 69 73 70 6c 61 .............nameString.=.displa
edc0 79 4e 61 6d 65 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 yName;..........................
ede0 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 20 20 20 20 20 20 20 ........}.......................
ee00 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 64 6f 6e 27 74 20 68 61 76 65 .............//.If.we.don't.have
ee20 20 61 6e 20 65 78 70 6c 69 63 69 74 20 3c 6c 61 79 6f 75 74 3e 20 70 61 72 74 20 69 6e 20 74 68 .an.explicit.<layout>.part.in.th
ee40 65 20 63 6f 6d 70 6f 6e 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e.component,....................
ee60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 72 65 6d 65 6d 62 65 72 20 74 68 65 20 6e 61 ..............//.remember.the.na
ee80 6d 65 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 74 me.of.the.layout.referenced.by.t
eea0 68 65 20 63 6f 6e 74 72 6f 6c 20 6e 61 6d 65 20 73 6f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 he.control.name.so..............
eec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 61 74 20 70 61 74 68 ....................//.that.path
eee0 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 66 75 72 74 68 65 72 20 64 6f 77 6e 20 74 68 65 20 6c 69 6e .components.further.down.the.lin
ef00 65 20 63 61 6e 20 6b 65 65 70 20 6c 6f 6f 6b 69 6e 67 20 75 70 20 74 68 65 69 72 0d 0a 20 20 20 e.can.keep.looking.up.their.....
ef20 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 20 2f 2f 20 .............................//.
ef40 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 display.names...................
ef60 20 20 20 20 20 20 20 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 ................if.(string.IsNul
ef80 6c 4f 72 45 6d 70 74 79 28 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 74 4e 61 6d 65 29 29 0d lOrEmpty(referencedLayoutName)).
efa0 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 20 20 20 ................................
efc0 20 20 20 20 20 72 65 66 65 72 65 6e 63 65 64 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 63 6f 6e 74 .....referencedLayoutName.=.cont
efe0 72 6f 6c 2e 56 61 6c 75 65 2e 6c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rol.Value.layout;...............
f000 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 ...............}................
f020 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 20 20 20 20 20 ..........}.....................
f040 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 69 66 20 28 6e 61 .}........................if.(na
f060 6d 65 53 74 72 69 6e 67 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 meString.==.null)...............
f080 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 53 74 72 69 6e 67 20 3d 20 54 6f 48 75 6d 61 6e 52 ...........nameString.=.ToHumanR
f0a0 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 6e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 eadableString(name);............
f0c0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 ............if.(!string.IsNullOr
f0e0 45 6d 70 74 79 28 72 65 73 75 6c 74 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Empty(result))..................
f100 20 20 20 20 20 20 20 20 72 65 73 75 6c 74 20 2b 3d 20 27 20 27 20 2b 20 6e 61 6d 65 53 74 72 69 ........result.+=.'.'.+.nameStri
f120 6e 67 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 ng;......................else...
f140 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 73 75 6c 74 20 2b 3d .......................result.+=
f160 20 6e 61 6d 65 53 74 72 69 6e 67 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d .nameString;..................}.
f180 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 64 69 73 70 6c 61 79 4e ...................if.(!displayN
f1a0 61 6d 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 7b 0d ame.isEmpty)..................{.
f1c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 72 20 3d 20 24 .....................var.str.=.$
f1e0 22 5c 22 7b 54 6f 48 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 64 69 73 70 6c 61 "\"{ToHumanReadableString(displa
f200 79 4e 61 6d 65 29 7d 5c 22 22 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yName)}\"";.....................
f220 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 72 65 73 75 6c .if.(!string.IsNullOrEmpty(resul
f240 74 29 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 72 65 73 t))..........................res
f260 75 6c 74 20 2b 3d 20 27 20 27 20 2b 20 73 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ult.+=.'.'.+.str;...............
f280 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 20 20 .......else.....................
f2a0 20 20 20 20 20 72 65 73 75 6c 74 20 2b 3d 20 73 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .....result.+=.str;.............
f2c0 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 72 65 74 75 72 6e .....}....................return
f2e0 20 72 65 73 75 6c 74 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 .result;..............}.........
f300 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 54 6f 48 .......private.static.string.ToH
f320 75 6d 61 6e 52 65 61 64 61 62 6c 65 53 74 72 69 6e 67 28 53 75 62 73 74 72 69 6e 67 20 73 75 62 umanReadableString(Substring.sub
f340 73 74 72 69 6e 67 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 string)..............{..........
f360 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 75 62 73 74 72 69 6e 67 2e 54 6f 53 74 72 69 6e ........return.substring.ToStrin
f380 67 28 29 2e 55 6e 65 73 63 61 70 65 28 22 2f 2a 7b 3c 22 2c 20 22 2f 2a 7b 3c 22 29 3b 0d 0a 20 g().Unescape("/*{<",."/*{<");...
f3a0 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 2f 20 ...........}................///.
f3c0 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 74 68 <summary>..............///.Wheth
f3e0 65 72 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 6d 61 74 63 68 65 73 20 74 68 65 er.the.given.control.matches.the
f400 20 63 6f 6e 73 74 72 61 69 6e 74 73 20 6f 66 20 74 68 69 73 20 70 61 74 68 20 63 6f 6d 70 6f 6e .constraints.of.this.path.compon
f420 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e ent...............///.</summary>
f440 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 ..............///.<param.name="c
f460 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 6d 61 74 63 68 20 61 67 61 69 6e 73 74 ontrol">Control.to.match.against
f480 20 74 68 65 20 70 61 74 68 20 73 70 65 63 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 .the.path.spec.</param>.........
f4a0 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 .....///.<returns></returns>....
f4c0 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 4d 61 74 63 68 65 73 28 49 6e ..........public.bool.Matches(In
f4e0 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 20 20 20 20 20 20 20 putControl.control).............
f500 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 74 63 68 20 6c 61 79 .{..................//.Match.lay
f520 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6c 61 79 6f 75 out...................if.(!layou
f540 74 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 7b 0d 0a 20 t.isEmpty)..................{...
f560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 ...................//.Check.for.
f580 64 69 72 65 63 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 20 direct.match....................
f5a0 20 20 20 76 61 72 20 6c 61 79 6f 75 74 4d 61 74 63 68 65 73 20 3d 20 53 75 62 73 74 72 69 6e 67 ...var.layoutMatches.=.Substring
f5c0 2e 43 6f 6d 70 61 72 65 28 6c 61 79 6f 75 74 2c 20 63 6f 6e 74 72 6f 6c 2e 6c 61 79 6f 75 74 2c .Compare(layout,.control.layout,
f5e0 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 53 74 72 69 6e 67 ..........................String
f600 43 6f 6d 70 61 72 69 73 6f 6e 2e 49 6e 76 61 72 69 61 6e 74 43 75 6c 74 75 72 65 49 67 6e 6f 72 Comparison.InvariantCultureIgnor
f620 65 43 61 73 65 29 20 3d 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eCase).==.0;....................
f640 20 20 69 66 20 28 21 6c 61 79 6f 75 74 4d 61 74 63 68 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 ..if.(!layoutMatches)...........
f660 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 ...........{....................
f680 20 20 20 20 20 20 2f 2f 20 4e 6f 20 64 69 72 65 63 74 20 6d 61 74 63 68 20 62 75 74 20 62 61 73 ......//.No.direct.match.but.bas
f6a0 65 20 6c 61 79 6f 75 74 20 6d 61 79 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e.layout.may.match..............
f6c0 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 62 61 73 65 4c 61 79 6f 75 74 20 3d 20 63 6f .............var.baseLayout.=.co
f6e0 6e 74 72 6f 6c 2e 6d 5f 4c 61 79 6f 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntrol.m_Layout;.................
f700 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f .........while.(InputControlLayo
f720 75 74 2e 73 5f 4c 61 79 6f 75 74 73 2e 62 61 73 65 4c 61 79 6f 75 74 54 61 62 6c 65 2e 54 72 79 ut.s_Layouts.baseLayoutTable.Try
f740 47 65 74 56 61 6c 75 65 28 62 61 73 65 4c 61 79 6f 75 74 2c 20 6f 75 74 20 62 61 73 65 4c 61 79 GetValue(baseLayout,.out.baseLay
f760 6f 75 74 29 20 26 26 20 21 6c 61 79 6f 75 74 4d 61 74 63 68 65 73 29 0d 0a 20 20 20 20 20 20 20 out).&&.!layoutMatches).........
f780 20 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 .................{..............
f7a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 79 6f 75 74 4d 61 74 63 68 65 73 20 3d 20 ................layoutMatches.=.
f7c0 53 75 62 73 74 72 69 6e 67 2e 43 6f 6d 70 61 72 65 28 6c 61 79 6f 75 74 2c 20 62 61 73 65 4c 61 Substring.Compare(layout,.baseLa
f7e0 79 6f 75 74 2e 54 6f 53 74 72 69 6e 67 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yout.ToString(),................
f800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 74 72 69 6e 67 43 6f 6d 70 61 72 69 73 ..................StringComparis
f820 6f 6e 2e 49 6e 76 61 72 69 61 6e 74 43 75 6c 74 75 72 65 49 67 6e 6f 72 65 43 61 73 65 29 20 3d on.InvariantCultureIgnoreCase).=
f840 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 20 20 20 20 7d 0d =.0;..........................}.
f860 0a 20 20 20 20 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 .....................}..........
f880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6c 61 79 6f 75 74 4d 61 74 63 68 65 73 ..............if.(!layoutMatches
f8a0 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 72 65 74 75 72 )..........................retur
f8c0 6e 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 7d 0d 0a 0d 0a 20 n.false;..................}.....
f8e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 75 73 61 67 65 2e 0d 0a ...............//.Match.usage...
f900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 61 67 65 73 20 21 3d 20 6e 75 ................if.(usages.!=.nu
f920 6c 6c 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 ll)..................{..........
f940 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 ............for.(int.i.=.0;.i.<.
f960 75 73 61 67 65 73 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 usages.Length;.++i).............
f980 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 20 20 .........{......................
f9a0 20 20 20 20 69 66 20 28 21 75 73 61 67 65 73 5b 69 5d 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 ....if.(!usages[i].isEmpty).....
f9c0 20 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 20 20 20 20 20 .....................{..........
f9e0 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 6c 55 ....................var.controlU
fa00 73 61 67 65 73 20 3d 20 63 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 3b 0d 0a 20 20 20 20 20 20 20 sages.=.control.usages;.........
fa20 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 68 61 76 65 55 73 61 .....................var.haveUsa
fa40 67 65 4d 61 74 63 68 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 geMatch.=.false;................
fa60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 63 69 20 3d 20 30 3b 20 63 ..............for.(var.ci.=.0;.c
fa80 69 20 3c 20 63 6f 6e 74 72 6f 6c 55 73 61 67 65 73 2e 43 6f 75 6e 74 3b 20 2b 2b 63 69 29 0d 0a i.<.controlUsages.Count;.++ci)..
faa0 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 20 20 20 20 ................................
fac0 69 66 20 28 53 75 62 73 74 72 69 6e 67 2e 43 6f 6d 70 61 72 65 28 63 6f 6e 74 72 6f 6c 55 73 61 if.(Substring.Compare(controlUsa
fae0 67 65 73 5b 63 69 5d 2e 54 6f 53 74 72 69 6e 67 28 29 2c 20 75 73 61 67 65 73 5b 69 5d 2c 20 53 ges[ci].ToString(),.usages[i],.S
fb00 74 72 69 6e 67 43 6f 6d 70 61 72 69 73 6f 6e 2e 49 6e 76 61 72 69 61 6e 74 43 75 6c 74 75 72 65 tringComparison.InvariantCulture
fb20 49 67 6e 6f 72 65 43 61 73 65 29 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 IgnoreCase).==.0)...............
fb40 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 20 20 20 20 20 20 20 ...................{............
fb60 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 68 61 76 65 55 73 ..........................haveUs
fb80 61 67 65 4d 61 74 63 68 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ageMatch.=.true;................
fba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 ......................break;....
fbc0 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 20 20 7d 0d ..............................}.
fbe0 0a 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 69 ...............................i
fc00 66 20 28 21 68 61 76 65 55 73 61 67 65 4d 61 74 63 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 f.(!haveUsageMatch).............
fc20 20 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 20 66 61 6c 73 .....................return.fals
fc40 65 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 7d 0d 0a 20 e;..........................}...
fc60 20 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 ...................}............
fc80 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 2f 2f 20 4d 61 ......}....................//.Ma
fca0 74 63 68 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 tch.name...................if.(!
fcc0 6e 61 6d 65 2e 69 73 45 6d 70 74 79 20 26 26 20 21 69 73 57 69 6c 64 63 61 72 64 29 0d 0a 20 20 name.isEmpty.&&.!isWildcard)....
fce0 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 ..............{.................
fd00 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 75 6e 6c 69 6b 65 20 74 68 65 20 6d 61 74 63 68 .....////FIXME:.unlike.the.match
fd20 69 6e 67 20 70 61 74 68 20 77 65 20 68 61 76 65 20 69 6e 20 4d 61 74 63 68 43 6f 6e 74 72 6f 6c ing.path.we.have.in.MatchControl
fd40 73 52 65 63 75 72 73 69 76 65 2c 20 74 68 69 73 20 64 6f 65 73 20 6e 6f 74 20 74 61 6b 65 20 61 sRecursive,.this.does.not.take.a
fd60 6c 69 61 73 65 73 20 69 6e 74 6f 20 61 63 63 6f 75 6e 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 liases.into.account.............
fd80 20 20 20 20 20 20 20 20 20 69 66 20 28 53 75 62 73 74 72 69 6e 67 2e 43 6f 6d 70 61 72 65 28 63 .........if.(Substring.Compare(c
fda0 6f 6e 74 72 6f 6c 2e 6e 61 6d 65 2c 20 6e 61 6d 65 2c 20 53 74 72 69 6e 67 43 6f 6d 70 61 72 69 ontrol.name,.name,.StringCompari
fdc0 73 6f 6e 2e 49 6e 76 61 72 69 61 6e 74 43 75 6c 74 75 72 65 49 67 6e 6f 72 65 43 61 73 65 29 20 son.InvariantCultureIgnoreCase).
fde0 21 3d 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 72 !=.0)..........................r
fe00 65 74 75 72 6e 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 7d 0d eturn.false;..................}.
fe20 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 74 63 68 20 64 69 73 70 ...................//.Match.disp
fe40 6c 61 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 lay.name...................if.(!
fe60 64 69 73 70 6c 61 79 4e 61 6d 65 2e 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 displayName.isEmpty)............
fe80 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 20 20 69 66 20 ......{......................if.
fea0 28 53 75 62 73 74 72 69 6e 67 2e 43 6f 6d 70 61 72 65 28 63 6f 6e 74 72 6f 6c 2e 64 69 73 70 6c (Substring.Compare(control.displ
fec0 61 79 4e 61 6d 65 2c 20 64 69 73 70 6c 61 79 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ayName,.displayName,............
fee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 74 72 69 6e 67 43 6f 6d 70 61 72 69 73 6f 6e 2e 49 ..............StringComparison.I
ff00 6e 76 61 72 69 61 6e 74 43 75 6c 74 75 72 65 49 67 6e 6f 72 65 43 61 73 65 29 20 21 3d 20 30 29 nvariantCultureIgnoreCase).!=.0)
ff20 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 65 74 75 72 6e ..........................return
ff40 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 7d 0d 0a 0d 0a 20 20 .false;..................}......
ff60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 ..............return.true;......
ff80 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 20 20 20 ........}..........}............
ffa0 2f 2f 2f 2f 54 4f 44 4f 3a 20 65 78 70 6f 73 65 20 50 61 74 68 50 61 72 73 65 72 0d 0a 0d 0a 20 ////TODO:.expose.PathParser.....
ffc0 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 4d 75 73 74 20 6e 6f 74 20 61 6c 6c 6f 63 61 74 .......//.NOTE:.Must.not.allocat
ffe0 65 21 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 50 61 74 68 e!..........internal.struct.Path
10000 50 61 72 73 65 72 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 70 Parser..........{..............p
10020 75 62 6c 69 63 20 73 74 72 69 6e 67 20 70 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ublic.string.path;..............
10040 70 75 62 6c 69 63 20 69 6e 74 20 6c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 public.int.length;..............
10060 70 75 62 6c 69 63 20 69 6e 74 20 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 public.int.leftIndexInPath;.....
10080 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 72 69 67 68 74 49 6e 64 65 78 49 6e .........public.int.rightIndexIn
100a0 50 61 74 68 3b 20 2f 2f 20 50 6f 69 6e 74 73 20 65 69 74 68 65 72 20 74 6f 20 61 20 27 2f 27 20 Path;.//.Points.either.to.a.'/'.
100c0 63 68 61 72 61 63 74 65 72 20 6f 72 20 6f 6e 65 20 70 61 73 74 20 74 68 65 20 65 6e 64 20 6f 66 character.or.one.past.the.end.of
100e0 20 74 68 65 20 70 61 74 68 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 .the.path.string...............p
10100 75 62 6c 69 63 20 50 61 72 73 65 64 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 20 63 75 72 72 65 6e ublic.ParsedPathComponent.curren
10120 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 t;................public.bool.is
10140 41 74 45 6e 64 20 3d 3e 20 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3d 3d 20 6c 65 6e AtEnd.=>.rightIndexInPath.==.len
10160 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 50 61 74 68 50 gth;................public.PathP
10180 61 72 73 65 72 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 arser(string.path)..............
101a0 7b 0d 0a 20 20 20 20 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 {..................Debug.Assert(
101c0 70 61 74 68 20 21 3d 20 6e 75 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 path.!=.null);..................
101e0 20 20 74 68 69 73 2e 70 61 74 68 20 3d 20 70 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..this.path.=.path;.............
10200 20 20 20 20 20 6c 65 6e 67 74 68 20 3d 20 70 61 74 68 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 .....length.=.path.Length;......
10220 20 20 20 20 20 20 20 20 20 20 20 20 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 30 3b ............leftIndexInPath.=.0;
10240 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 ..................rightIndexInPa
10260 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 63 75 72 72 65 6e 74 th.=.0;..................current
10280 20 3d 20 6e 65 77 20 50 61 72 73 65 64 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 28 29 3b 0d 0a 20 .=.new.ParsedPathComponent();...
102a0 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 55 ...........}................//.U
102c0 70 64 61 74 65 20 70 61 72 73 69 6e 67 20 73 74 61 74 65 20 61 6e 64 20 27 63 75 72 72 65 6e 74 pdate.parsing.state.and.'current
102e0 27 20 74 6f 20 6e 65 78 74 20 63 6f 6d 70 6f 6e 65 6e 74 20 69 6e 20 70 61 74 68 2e 0d 0a 20 20 '.to.next.component.in.path.....
10300 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 74 75 72 6e 73 20 74 72 75 65 20 69 66 20 74 68 65 ..........//.Returns.true.if.the
10320 20 77 61 73 20 61 6e 6f 74 68 65 72 20 63 6f 6d 70 6f 6e 65 6e 74 20 6f 72 20 66 61 6c 73 65 20 .was.another.component.or.false.
10340 69 66 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 70 61 74 68 20 77 61 73 20 72 65 61 63 68 if.the.end.of.the.path.was.reach
10360 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 4d 6f 76 ed...............public.bool.Mov
10380 65 54 6f 4e 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 eToNextComponent()..............
103a0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 77 65 27 {..................//.See.if.we'
103c0 76 65 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 70 61 74 68 20 73 74 72 69 6e 67 2e 0d 0a ve.the.end.of.the.path.string...
103e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 69 67 68 74 49 6e 64 65 78 49 6e ................if.(rightIndexIn
10400 50 61 74 68 20 3d 3d 20 6c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Path.==.length).................
10420 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .....return.false;..............
10440 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 6f 75 72 20 63 75 72 72 65 6e 74 20 72 69 67 68 74 20 ......//.Make.our.current.right.
10460 69 6e 64 65 78 20 6f 75 72 20 6e 65 77 20 6c 65 66 74 20 69 6e 64 65 78 20 61 6e 64 20 66 69 6e index.our.new.left.index.and.fin
10480 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 20 6e 65 77 20 72 69 67 68 d..................//.a.new.righ
104a0 74 20 69 6e 64 65 78 20 66 72 6f 6d 20 74 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 t.index.from.there..............
104c0 20 20 20 20 20 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 72 69 67 68 74 49 6e 64 65 .....leftIndexInPath.=.rightInde
104e0 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 xInPath;..................if.(pa
10500 74 68 5b 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 2f 27 29 0d 0a 20 20 20 th[leftIndexInPath].==.'/').....
10520 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 20 .............{..................
10540 20 20 20 20 2b 2b 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 ....++leftIndexInPath;..........
10560 20 20 20 20 20 20 20 20 20 20 20 20 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3d 20 6c ............rightIndexInPath.=.l
10580 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eftIndexInPath;.................
105a0 20 20 20 20 20 69 66 20 28 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3d 3d 20 6c 65 6e 67 .....if.(leftIndexInPath.==.leng
105c0 74 68 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 72 65 74 th)..........................ret
105e0 75 72 6e 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 7d 0d 0a 0d urn.false;..................}...
10600 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 50 61 72 73 65 20 3c 2e 2e 2e 3e 20 .................//.Parse.<...>.
10620 6c 61 79 6f 75 74 20 70 61 72 74 2c 20 69 66 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 layout.part,.if.present.........
10640 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 79 6f 75 74 20 3d 20 6e 65 77 20 53 75 62 73 74 ..........var.layout.=.new.Subst
10660 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 69 67 ring();..................if.(rig
10680 68 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 6c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 72 htIndexInPath.<.length.&&.path[r
106a0 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 3c 27 29 0d 0a 20 20 20 20 20 20 ightIndexInPath].==.'<')........
106c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 79 6f 75 74 20 3d 20 50 61 72 73 65 43 6f 6d 70 ..............layout.=.ParseComp
106e0 6f 6e 65 6e 74 50 61 72 74 28 27 3e 27 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 onentPart('>');.................
10700 20 20 20 2f 2f 20 50 61 72 73 65 20 7b 2e 2e 2e 7d 20 75 73 61 67 65 20 70 61 72 74 2c 20 69 66 ...//.Parse.{...}.usage.part,.if
10720 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 .present...................var.u
10740 73 61 67 65 73 20 3d 20 6e 65 77 20 4c 69 73 74 3c 53 75 62 73 74 72 69 6e 67 3e 28 29 3b 0d 0a sages.=.new.List<Substring>();..
10760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 72 69 67 68 74 49 6e 64 65 ................while.(rightInde
10780 78 49 6e 50 61 74 68 20 3c 20 6c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 72 69 67 68 74 49 6e xInPath.<.length.&&.path[rightIn
107a0 64 65 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 7b 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 dexInPath].==.'{')..............
107c0 20 20 20 20 20 20 20 20 75 73 61 67 65 73 2e 41 64 64 28 50 61 72 73 65 43 6f 6d 70 6f 6e 65 6e ........usages.Add(ParseComponen
107e0 74 50 61 72 74 28 27 7d 27 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tPart('}'));....................
10800 2f 2f 20 50 61 72 73 65 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 20 70 61 72 74 2c 20 69 66 20 70 //.Parse.display.name.part,.if.p
10820 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 69 73 resent...................var.dis
10840 70 6c 61 79 4e 61 6d 65 20 3d 20 6e 65 77 20 53 75 62 73 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 playName.=.new.Substring();.....
10860 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 .............if.(rightIndexInPat
10880 68 20 3c 20 6c 65 6e 67 74 68 20 2d 20 31 20 26 26 20 70 61 74 68 5b 72 69 67 68 74 49 6e 64 65 h.<.length.-.1.&&.path[rightInde
108a0 78 49 6e 50 61 74 68 5d 20 3d 3d 20 27 23 27 20 26 26 20 70 61 74 68 5b 72 69 67 68 74 49 6e 64 xInPath].==.'#'.&&.path[rightInd
108c0 65 78 49 6e 50 61 74 68 20 2b 20 31 5d 20 3d 3d 20 27 28 27 29 0d 0a 20 20 20 20 20 20 20 20 20 exInPath.+.1].==.'(')...........
108e0 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 20 20 2b 2b .......{......................++
10900 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rightIndexInPath;...............
10920 20 20 20 20 20 20 20 64 69 73 70 6c 61 79 4e 61 6d 65 20 3d 20 50 61 72 73 65 43 6f 6d 70 6f 6e .......displayName.=.ParseCompon
10940 65 6e 74 50 61 72 74 28 27 29 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d entPart(')');..................}
10960 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 50 61 72 73 65 20 6e 61 6d ....................//.Parse.nam
10980 65 20 70 61 72 74 2c 20 69 66 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e.part,.if.present..............
109a0 20 20 20 20 20 76 61 72 20 6e 61 6d 65 20 3d 20 6e 65 77 20 53 75 62 73 74 72 69 6e 67 28 29 3b .....var.name.=.new.Substring();
109c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 69 67 68 74 49 6e 64 65 78 ..................if.(rightIndex
109e0 49 6e 50 61 74 68 20 3c 20 6c 65 6e 67 74 68 20 26 26 20 70 61 74 68 5b 72 69 67 68 74 49 6e 64 InPath.<.length.&&.path[rightInd
10a00 65 78 49 6e 50 61 74 68 5d 20 21 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 exInPath].!=.'/')...............
10a20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d 20 50 61 72 73 65 43 6f 6d 70 6f 6e 65 6e 74 50 61 72 74 .......name.=.ParseComponentPart
10a40 28 27 2f 27 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e ('/');....................curren
10a60 74 20 3d 20 6e 65 77 20 50 61 72 73 65 64 50 61 74 68 43 6f 6d 70 6f 6e 65 6e 74 0d 0a 20 20 20 t.=.new.ParsedPathComponent.....
10a80 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 20 .............{..................
10aa0 20 20 20 20 6c 61 79 6f 75 74 20 3d 20 6c 61 79 6f 75 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ....layout.=.layout,............
10ac0 20 20 20 20 20 20 20 20 20 20 75 73 61 67 65 73 20 3d 20 75 73 61 67 65 73 2e 54 6f 41 72 72 61 ..........usages.=.usages.ToArra
10ae0 79 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d y(),......................name.=
10b00 20 6e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 70 .name,......................disp
10b20 6c 61 79 4e 61 6d 65 20 3d 20 64 69 73 70 6c 61 79 4e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 layName.=.displayName...........
10b40 20 20 20 20 20 20 20 7d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 .......};....................ret
10b60 75 72 6e 20 6c 65 66 74 49 6e 64 65 78 49 6e 50 61 74 68 20 21 3d 20 72 69 67 68 74 49 6e 64 65 urn.leftIndexInPath.!=.rightInde
10b80 78 49 6e 50 61 74 68 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 xInPath;..............}.........
10ba0 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 53 75 62 73 74 72 69 6e 67 20 50 61 72 73 65 43 6f .......private.Substring.ParseCo
10bc0 6d 70 6f 6e 65 6e 74 50 61 72 74 28 63 68 61 72 20 74 65 72 6d 69 6e 61 74 6f 72 29 0d 0a 20 20 mponentPart(char.terminator)....
10be0 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 69 66 20 ..........{..................if.
10c00 28 74 65 72 6d 69 6e 61 74 6f 72 20 21 3d 20 27 2f 27 29 20 2f 2f 20 4e 61 6d 65 20 68 61 73 20 (terminator.!=.'/').//.Name.has.
10c20 6e 6f 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 6c 65 66 74 20 73 69 64 65 20 74 65 72 6d 69 no.corresponding.left.side.termi
10c40 6e 61 74 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 72 69 nator.......................++ri
10c60 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ghtIndexInPath;.................
10c80 20 20 20 76 61 72 20 70 61 72 74 53 74 61 72 74 49 6e 64 65 78 20 3d 20 72 69 67 68 74 49 6e 64 ...var.partStartIndex.=.rightInd
10ca0 65 78 49 6e 50 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 exInPath;..................while
10cc0 20 28 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 6c 65 6e 67 74 68 20 26 26 20 70 .(rightIndexInPath.<.length.&&.p
10ce0 61 74 68 5b 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 5d 20 21 3d 20 74 65 72 6d 69 6e 61 ath[rightIndexInPath].!=.termina
10d00 74 6f 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 72 69 67 68 tor)......................++righ
10d20 74 49 6e 64 65 78 49 6e 50 61 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tIndexInPath;...................
10d40 20 76 61 72 20 70 61 72 74 4c 65 6e 67 74 68 20 3d 20 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 .var.partLength.=.rightIndexInPa
10d60 74 68 20 2d 20 70 61 72 74 53 74 61 72 74 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 th.-.partStartIndex;............
10d80 20 20 20 20 20 20 69 66 20 28 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 68 20 3c 20 6c 65 6e ......if.(rightIndexInPath.<.len
10da0 67 74 68 20 26 26 20 74 65 72 6d 69 6e 61 74 6f 72 20 21 3d 20 27 2f 27 29 0d 0a 20 20 20 20 20 gth.&&.terminator.!=.'/').......
10dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 72 69 67 68 74 49 6e 64 65 78 49 6e 50 61 74 ...............++rightIndexInPat
10de0 68 3b 20 2f 2f 20 53 6b 69 70 20 70 61 73 74 20 74 65 72 6d 69 6e 61 74 6f 72 2e 0d 0a 0d 0a 20 h;.//.Skip.past.terminator......
10e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 53 75 62 73 74 72 ...............return.new.Substr
10e20 69 6e 67 28 70 61 74 68 2c 20 70 61 72 74 53 74 61 72 74 49 6e 64 65 78 2c 20 70 61 72 74 4c 65 ing(path,.partStartIndex,.partLe
10e40 6e 67 74 68 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 7d ngth);..............}..........}
10e60 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 00 00 ......}..}......................
10e80 10 00 00 00 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 17 00 00 00 55 6e 69 74 79 45 6e 67 ....InputControlPath....UnityEng
10ea0 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 00 ine.InputSystem.