summaryrefslogtreecommitdiff
path: root/Library/Artifacts/6a/6a18ca892f98febe31c601b64b14fadf
blob: 44653fbd1fb50e17df070f07996e697486707266 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 01 8b 34 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe .......4............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 d4 7a 01 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 .z..............................
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 09 00 00 00 49 6e 70 75 74 55 73 65 72 00 00 00 6d 7a 01 00 75 73 69 6e ............InputUser...mz..usin
10a0 67 20 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 g.System;..using.System.Collecti
10c0 6f 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 ons.Generic;..using.Unity.Collec
10e0 74 69 6f 6e 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 tions;..using.UnityEngine.InputS
1100 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 ystem.LowLevel;..using.UnityEngi
1120 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 55 74 69 6c 69 74 69 65 73 3b 0d 0a 75 73 69 6e 67 ne.InputSystem.Utilities;..using
1140 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 50 72 6f 66 69 6c 69 6e 67 3b 0d 0a 0d 0a 2f 2f 2f 2f 52 .UnityEngine.Profiling;....////R
1160 45 56 49 45 57 3a 20 64 6f 20 77 65 20 6e 65 65 64 20 74 6f 20 68 61 6e 64 6c 65 20 74 68 65 20 EVIEW:.do.we.need.to.handle.the.
1180 63 61 73 65 20 77 68 65 72 65 20 64 65 76 69 63 65 73 20 61 72 65 20 61 64 64 65 64 20 74 6f 20 case.where.devices.are.added.to.
11a0 61 20 75 73 65 72 20 74 68 61 74 20 61 72 65 20 65 61 63 68 20 61 73 73 6f 63 69 61 74 65 64 20 a.user.that.are.each.associated.
11c0 77 69 74 68 20 61 20 64 69 66 66 65 72 65 6e 74 20 75 73 65 72 20 61 63 63 6f 75 6e 74 0d 0a 0d with.a.different.user.account...
11e0 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 68 6f 77 20 73 68 6f 75 6c 64 20 77 65 20 68 61 6e 64 6c .////REVIEW:.how.should.we.handl
1200 65 20 70 61 69 72 69 6e 67 73 20 6f 66 20 64 65 76 69 63 65 73 20 2a 6e 6f 74 2a 20 63 61 6c 6c e.pairings.of.devices.*not*.call
1220 65 64 20 66 6f 72 20 62 79 20 61 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 3f 20 73 68 6f 75 ed.for.by.a.control.scheme?.shou
1240 6c 64 20 74 68 61 74 20 72 65 73 75 6c 74 20 69 6e 20 61 20 66 61 69 6c 65 64 20 6d 61 74 63 68 ld.that.result.in.a.failed.match
1260 3f 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 6f 70 74 69 6f 6e 20 74 6f 20 62 69 6e 64 20 74 6f ?....////TODO:.option.to.bind.to
1280 20 2a 61 6c 6c 2a 20 64 65 76 69 63 65 73 20 69 6e 73 74 65 61 64 20 6f 66 20 6a 75 73 74 20 74 .*all*.devices.instead.of.just.t
12a0 68 65 20 70 61 69 72 65 64 20 6f 6e 65 73 20 28 62 69 6e 64 54 6f 41 6c 6c 44 65 76 69 63 65 73 he.paired.ones.(bindToAllDevices
12c0 29 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 74 68 65 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 )....////TODO:.the.account.selec
12e0 74 69 6f 6e 20 73 74 75 66 66 20 6e 65 65 64 73 20 63 6c 65 61 6e 75 70 3b 20 74 68 65 20 63 75 tion.stuff.needs.cleanup;.the.cu
1300 72 72 65 6e 74 20 66 6c 6f 77 20 69 73 20 74 6f 6f 20 63 6f 6e 76 6f 6c 75 74 65 64 0d 0a 0d 0a rrent.flow.is.too.convoluted....
1320 6e 61 6d 65 73 70 61 63 65 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 namespace.UnityEngine.InputSyste
1340 6d 2e 55 73 65 72 73 0d 0a 7b 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 m.Users..{......///.<summary>...
1360 20 20 20 2f 2f 2f 20 52 65 70 72 65 73 65 6e 74 73 20 61 20 73 70 65 63 69 66 69 63 20 75 73 65 ...///.Represents.a.specific.use
1380 72 2f 70 6c 61 79 65 72 20 69 6e 74 65 72 61 63 74 69 6e 67 20 77 69 74 68 20 6f 6e 65 20 6f 72 r/player.interacting.with.one.or
13a0 20 6d 6f 72 65 20 64 65 76 69 63 65 73 20 61 6e 64 20 69 6e 70 75 74 20 61 63 74 69 6f 6e 73 2e .more.devices.and.input.actions.
13c0 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 72 ......///.</summary>......///.<r
13e0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 50 72 69 6e 63 69 70 61 6c 6c 79 2c 20 61 6e emarks>......///.Principally,.an
1400 20 49 6e 70 75 74 55 73 65 72 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 68 75 6d 61 6e 20 69 6e .InputUser.represents.a.human.in
1420 74 65 72 61 63 74 69 6e 67 20 77 69 74 68 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e 20 teracting.with.the.application..
1440 4d 6f 72 65 6f 76 65 72 2c 20 61 74 20 61 6e 79 20 70 6f 69 6e 74 0d 0a 20 20 20 20 2f 2f 2f 20 Moreover,.at.any.point......///.
1460 65 61 63 68 20 49 6e 70 75 74 55 73 65 72 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 68 75 6d 61 each.InputUser.represents.a.huma
1480 6e 20 61 63 74 6f 72 20 64 69 73 74 69 6e 63 74 20 66 72 6f 6d 20 61 6c 6c 20 6f 74 68 65 72 20 n.actor.distinct.from.all.other.
14a0 49 6e 70 75 74 55 73 65 72 73 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 2f InputUsers.in.the.system......./
14c0 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 45 61 63 68 20 75 73 65 72 20 68 61 73 20 6f 6e 65 20 6f 72 //......///.Each.user.has.one.or
14e0 20 6d 6f 72 65 20 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2e 20 49 6e 20 67 65 6e 65 72 61 6c .more.paired.devices..In.general
1500 2c 20 74 68 65 73 65 20 64 65 76 69 63 65 73 20 61 72 65 20 75 6e 69 71 75 65 20 74 6f 20 65 61 ,.these.devices.are.unique.to.ea
1520 63 68 20 75 73 65 72 2e 20 48 6f 77 65 76 65 72 2c 0d 0a 20 20 20 20 2f 2f 2f 20 69 74 20 69 73 ch.user..However,......///.it.is
1540 20 70 65 72 6d 69 74 74 65 64 20 74 6f 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 50 65 72 .permitted.to.use.<see.cref="Per
1560 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 20 74 6f 20 70 61 69 72 formPairingWithDevice"/>.to.pair
1580 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 .the.same.device.to.multiple.use
15a0 72 73 2e 0d 0a 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 66 75 6c 20 rs.......///.This.can.be.useful.
15c0 69 6e 20 73 65 74 75 70 73 20 73 75 63 68 20 61 73 20 73 70 6c 69 74 2d 6b 65 79 62 6f 61 72 64 in.setups.such.as.split-keyboard
15e0 20 28 65 2e 67 2e 20 6f 6e 65 20 75 73 65 72 20 75 73 69 6e 67 20 6c 65 66 74 20 73 69 64 65 20 .(e.g..one.user.using.left.side.
1600 6f 66 20 6b 65 79 62 6f 61 72 64 20 61 6e 64 20 74 68 65 0d 0a 20 20 20 20 2f 2f 2f 20 6f 74 68 of.keyboard.and.the......///.oth
1620 65 72 20 74 68 65 20 72 69 67 68 74 20 6f 6e 65 29 20 75 73 65 20 6f 72 20 68 6f 74 73 65 61 74 er.the.right.one).use.or.hotseat
1640 2d 73 74 79 6c 65 20 67 61 6d 65 70 6c 61 79 20 28 65 2e 67 2e 20 74 77 6f 20 70 6c 61 79 65 72 -style.gameplay.(e.g..two.player
1660 73 20 74 61 6b 69 6e 67 20 74 75 72 6e 73 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 67 61 6d 65 20 s.taking.turns.on.the.same.game.
1680 63 6f 6e 74 72 6f 6c 6c 65 72 29 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 41 controller).......///......///.A
16a0 20 75 73 65 72 20 6d 61 79 20 62 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 20 70 .user.may.be.associated.with.a.p
16c0 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 28 3c 73 65 65 20 63 72 65 66 3d latform.user.account.(<see.cref=
16e0 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e 29 2c 20 "platformUserAccountHandle"/>),.
1700 69 66 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 74 68 65 0d 0a 20 20 20 20 2f 2f 2f 20 70 6c 61 if.supported.by.the......///.pla
1720 74 66 6f 72 6d 20 61 6e 64 20 74 68 65 20 64 65 76 69 63 65 73 20 75 73 65 64 2e 20 53 75 70 70 tform.and.the.devices.used..Supp
1740 6f 72 74 20 66 6f 72 20 74 68 69 73 20 69 73 20 63 6f 6d 6d 6f 6e 6c 79 20 66 6f 75 6e 64 20 6f ort.for.this.is.commonly.found.o
1760 6e 20 63 6f 6e 73 6f 6c 65 73 2e 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20 61 63 63 6f 75 6e n.consoles..Note.that.the.accoun
1780 74 0d 0a 20 20 20 20 2f 2f 2f 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 6e 20 49 6e t......///.associated.with.an.In
17a0 70 75 74 55 73 65 72 20 6d 61 79 20 63 68 61 6e 67 65 20 69 66 20 74 68 65 20 70 6c 61 79 65 72 putUser.may.change.if.the.player
17c0 20 75 73 65 73 20 74 68 65 20 73 79 73 74 65 6d 27 73 20 66 61 63 69 6c 69 74 69 65 73 20 74 6f .uses.the.system's.facilities.to
17e0 20 73 77 69 74 63 68 20 74 6f 20 61 20 64 69 66 66 65 72 65 6e 74 0d 0a 20 20 20 20 2f 2f 2f 20 .switch.to.a.different......///.
1800 61 63 63 6f 75 6e 74 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 account.(<see.cref="InputUserCha
1820 6e 67 65 2e 41 63 63 6f 75 6e 74 43 68 61 6e 67 65 64 22 2f 3e 29 2e 20 4f 6e 20 58 62 6f 78 20 nge.AccountChanged"/>)..On.Xbox.
1840 61 6e 64 20 53 77 69 74 63 68 2c 20 74 68 69 73 20 6d 61 79 20 61 6c 73 6f 20 62 65 20 69 6e 69 and.Switch,.this.may.also.be.ini
1860 74 69 61 74 65 64 20 66 72 6f 6d 0d 0a 20 20 20 20 2f 2f 2f 20 74 68 65 20 61 70 70 6c 69 63 61 tiated.from......///.the.applica
1880 74 69 6f 6e 20 62 79 20 70 61 73 73 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 tion.by.passing.<see.cref="Input
18a0 55 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 50 6c 61 74 66 6f 72 6d UserPairingOptions.ForcePlatform
18c0 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 22 2f 3e 20 74 6f 0d 0a 20 20 20 20 UserAccountSelection"/>.to......
18e0 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 ///.<see.cref="PerformPairingWit
1900 68 44 65 76 69 63 65 22 2f 3e 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 50 6c hDevice"/>.......///......///.Pl
1920 61 74 66 6f 72 6d 73 20 74 68 61 74 20 73 75 70 70 6f 72 74 20 75 73 65 72 20 61 63 63 6f 75 6e atforms.that.support.user.accoun
1940 74 20 61 73 73 6f 63 69 61 74 69 6f 6e 20 61 72 65 20 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e t.association.are.<see.cref="Run
1960 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 58 62 6f 78 4f 6e 65 22 2f 3e 2c 0d 0a 20 20 20 20 2f 2f timePlatform.XboxOne"/>,......//
1980 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 50 53 34 /.<see.cref="RuntimePlatform.PS4
19a0 22 2f 3e 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e "/>,.<see.cref="RuntimePlatform.
19c0 53 77 69 74 63 68 22 2f 3e 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e 74 69 6d 65 50 6c 61 Switch"/>,.<see.cref="RuntimePla
19e0 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 58 38 36 22 2f 3e 2c 0d 0a 20 20 20 20 2f 2f 2f 20 tform.WSAPlayerX86"/>,......///.
1a00 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c <see.cref="RuntimePlatform.WSAPl
1a20 61 79 65 72 58 36 34 22 2f 3e 2c 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 52 75 6e 74 69 ayerX64"/>,.and.<see.cref="Runti
1a40 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 41 52 4d 22 2f 3e 2e 20 4e 6f 74 65 mePlatform.WSAPlayerARM"/>..Note
1a60 20 74 68 61 74 0d 0a 20 20 20 20 2f 2f 2f 20 66 6f 72 20 57 53 41 2f 55 57 50 20 61 70 70 73 2c .that......///.for.WSA/UWP.apps,
1a80 20 74 68 65 20 22 55 73 65 72 20 41 63 63 6f 75 6e 74 20 49 6e 66 6f 72 6d 61 74 69 6f 6e 22 20 .the."User.Account.Information".
1aa0 63 61 70 61 62 69 6c 69 74 79 20 6d 75 73 74 20 62 65 20 65 6e 61 62 6c 65 64 20 66 6f 72 20 74 capability.must.be.enabled.for.t
1ac0 68 65 20 61 70 70 20 69 6e 20 6f 72 64 65 72 20 66 6f 72 0d 0a 20 20 20 20 2f 2f 2f 20 75 73 65 he.app.in.order.for......///.use
1ae0 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 74 6f 20 63 6f 6d 65 20 74 68 72 6f 75 67 68 20 6f 6e r.information.to.come.through.on
1b00 20 69 6e 70 75 74 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 .input.devices.......///.</remar
1b20 6b 73 3e 0d 0a 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 ks>......///.<seealso.cref="Inpu
1b40 74 55 73 65 72 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 75 63 tUserChange"/>......public.struc
1b60 74 20 49 6e 70 75 74 55 73 65 72 20 3a 20 49 45 71 75 61 74 61 62 6c 65 3c 49 6e 70 75 74 55 73 t.InputUser.:.IEquatable<InputUs
1b80 65 72 3e 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 er>......{..........public.const
1ba0 20 75 69 6e 74 20 49 6e 76 61 6c 69 64 49 64 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .uint.InvalidId.=.0;............
1bc0 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 57 68 65 74 68 ///.<summary>..........///.Wheth
1be0 65 72 20 74 68 69 73 20 69 73 20 61 20 63 75 72 72 65 6e 74 6c 79 20 61 63 74 69 76 65 20 75 73 er.this.is.a.currently.active.us
1c00 65 72 20 72 65 63 6f 72 64 20 69 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 61 6c 6c 22 2f 3e 2e 0d er.record.in.<see.cref="all"/>..
1c20 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 20 .........///.</summary>.........
1c40 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 65 72 .///.<remarks>..........///.User
1c60 73 20 74 68 61 74 20 61 72 65 20 72 65 6d 6f 76 65 64 20 28 3c 73 65 65 20 63 72 65 66 3d 22 55 s.that.are.removed.(<see.cref="U
1c80 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 72 22 2f 3e 29 20 77 69 npairDevicesAndRemoveUser"/>).wi
1ca0 6c 6c 20 62 65 63 6f 6d 65 20 69 6e 76 61 6c 69 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ll.become.invalid...........///.
1cc0 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 6c 73 6f </remarks>..........///.<seealso
1ce0 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 .cref="UnpairDevicesAndRemoveUse
1d00 72 22 2f 3e 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 r"/>..........///.<seealso.cref=
1d20 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 64 22 2f 3e 0d 0a 20 20 20 "InputUserChange.Removed"/>.....
1d40 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 76 61 6c 69 64 0d 0a 20 20 20 20 20 20 20 20 .....public.bool.valid..........
1d60 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {..............get..............
1d80 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 64 20 3d 3d 20 49 {..................if.(m_Id.==.I
1da0 6e 76 61 6c 69 64 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 nvalidId)......................r
1dc0 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 20 20 20 20 20 20 eturn.false;....................
1de0 2f 2f 20 53 65 65 20 69 66 20 74 68 65 72 65 27 73 20 61 20 63 75 72 72 65 6e 74 6c 79 20 61 63 //.See.if.there's.a.currently.ac
1e00 74 69 76 65 20 75 73 65 72 20 77 69 74 68 20 74 68 65 20 67 69 76 65 6e 20 49 44 2e 0d 0a 20 20 tive.user.with.the.given.ID.....
1e20 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.
1e40 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 <.s_AllUserCount;.++i)..........
1e60 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 73 5b 69 5d 2e 6d 5f ............if.(s_AllUsers[i].m_
1e80 49 64 20 3d 3d 20 6d 5f 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Id.==.m_Id).....................
1ea0 20 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 .....return.true;...............
1ec0 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 20 .....return.false;..............
1ee0 7d 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 20 3c 73 75 6d }..........}............///.<sum
1f00 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 65 71 75 65 6e 63 65 20 mary>..........///.The.sequence.
1f20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f number.of.the.user...........///
1f40 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b .</summary>..........///.<remark
1f60 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 63 61 6e 20 62 65 20 75 73 65 66 75 6c s>..........///.It.can.be.useful
1f80 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 61 20 73 6f 72 74 69 6e 67 20 6f 66 20 70 6c 61 79 65 .to.establish.a.sorting.of.playe
1fa0 72 73 20 6c 6f 63 61 6c 6c 79 20 73 75 63 68 20 74 68 61 74 20 69 74 20 69 73 0d 0a 20 20 20 20 rs.locally.such.that.it.is......
1fc0 20 20 20 20 2f 2f 2f 20 6b 6e 6f 77 6e 20 77 68 6f 20 69 73 20 74 68 65 20 66 69 72 73 74 20 70 ....///.known.who.is.the.first.p
1fe0 6c 61 79 65 72 2c 20 77 68 6f 20 69 73 20 74 68 65 20 73 65 63 6f 6e 64 2c 20 61 6e 64 20 73 6f layer,.who.is.the.second,.and.so
2000 20 6f 6e 2e 20 54 68 69 73 20 70 72 6f 70 65 72 74 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .on..This.property..........///.
2020 67 69 76 65 73 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 69 6e 67 20 6f 66 20 74 68 65 20 75 73 65 gives.the.positioning.of.the.use
2040 72 20 77 69 74 68 69 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 61 6c 6c 22 2f 3e 2e 0d 0a 20 20 20 r.within.<see.cref="all"/>......
2060 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 68 61 74 20 .....///..........///.Note.that.
2080 74 68 65 20 69 6e 64 65 78 20 6f 66 20 61 20 75 73 65 72 20 6d 61 79 20 63 68 61 6e 67 65 20 61 the.index.of.a.user.may.change.a
20a0 73 20 75 73 65 72 73 20 61 72 65 20 61 64 64 65 64 20 61 6e 64 20 72 65 6d 6f 76 65 64 2e 0d 0a s.users.are.added.and.removed...
20c0 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 20 20 20 ........///.</remarks>..........
20e0 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 61 6c 6c 22 2f 3e 0d 0a 20 20 20 20 20 ///.<seealso.cref="all"/>.......
2100 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 69 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a ...public.int.index..........{..
2120 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ............get..............{..
2140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 64 20 3d 3d 20 49 6e 76 61 ................if.(m_Id.==.Inva
2160 6c 69 64 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f lidId)......................thro
2180 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 w.new.InvalidOperationException(
21a0 22 49 6e 76 61 6c 69 64 20 75 73 65 72 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 "Invalid.user");................
21c0 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 54 72 79 46 69 6e 64 55 73 65 72 49 ....var.userIndex.=.TryFindUserI
21e0 6e 64 65 78 28 6d 5f 49 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 ndex(m_Id);..................if.
2200 28 75 73 65 72 49 6e 64 65 78 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 (userIndex.==.-1)...............
2220 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f .......throw.new.InvalidOperatio
2240 6e 45 78 63 65 70 74 69 6f 6e 28 24 22 55 73 65 72 20 77 69 74 68 20 49 44 20 7b 6d 5f 49 64 7d nException($"User.with.ID.{m_Id}
2260 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 76 61 6c 69 64 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 .is.no.longer.valid");..........
2280 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 75 73 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 ..........return.userIndex;.....
22a0 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 .........}..........}...........
22c0 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 54 68 65 20 .///.<summary>..........///.The.
22e0 75 6e 69 71 75 65 20 6e 75 6d 65 72 69 63 20 49 44 20 6f 66 20 74 68 65 20 75 73 65 72 2e 0d 0a unique.numeric.ID.of.the.user...
2300 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 20 ........///.</summary>..........
2320 2f 2f 2f 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 65 20 49 ///.<remarks>..........///.The.I
2340 44 20 6f 66 20 61 20 75 73 65 72 20 69 73 20 69 6e 74 65 72 6e 61 6c 6c 79 20 61 73 73 69 67 6e D.of.a.user.is.internally.assign
2360 65 64 20 61 6e 64 20 63 61 6e 6e 6f 74 20 62 65 20 63 68 61 6e 67 65 64 20 6f 76 65 72 20 69 74 ed.and.cannot.be.changed.over.it
2380 73 20 6c 69 66 65 74 69 6d 65 2e 20 4e 6f 20 74 77 6f 20 75 73 65 72 73 2c 20 65 76 65 6e 0d 0a s.lifetime..No.two.users,.even..
23a0 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 66 20 6e 6f 74 20 63 6f 6e 63 75 72 72 65 6e 74 6c 79 20 ........///.if.not.concurrently.
23c0 61 63 74 69 76 65 2c 20 77 69 6c 6c 20 72 65 63 65 69 76 65 20 74 68 65 20 73 61 6d 65 20 49 44 active,.will.receive.the.same.ID
23e0 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
2400 20 74 68 61 74 20 74 68 69 73 20 69 73 20 6e 6f 74 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 .that.this.is.not.the.same.as.th
2420 65 20 70 6c 61 74 66 6f 72 6d 27 73 20 69 6e 74 65 72 6e 61 6c 20 75 73 65 72 20 49 44 20 28 69 e.platform's.internal.user.ID.(i
2440 66 20 72 65 6c 65 76 61 6e 74 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 0d 0a 20 20 20 20 20 f.relevant.on.the.current.......
2460 20 20 20 2f 2f 2f 20 70 6c 61 74 66 6f 72 6d 29 2e 20 54 6f 20 67 65 74 20 74 68 65 20 49 44 20 ...///.platform)..To.get.the.ID.
2480 74 68 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 73 20 74 6f 20 69 64 65 6e 74 69 that.the.platform.uses.to.identi
24a0 66 79 20 74 68 65 20 75 73 65 72 2c 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 70 6c 61 74 fy.the.user,.use.<see.cref="plat
24c0 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 formUserAccountHandle"/>........
24e0 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 49 44 20 73 74 61 79 73 ...///..........///.The.ID.stays
2500 20 76 61 6c 69 64 20 61 6e 64 20 75 6e 69 71 75 65 20 65 76 65 6e 20 69 66 20 74 68 65 20 75 73 .valid.and.unique.even.if.the.us
2520 65 72 20 69 73 20 72 65 6d 6f 76 65 64 20 61 6e 64 20 6e 6f 20 6c 6f 6e 67 65 72 20 3c 73 65 65 er.is.removed.and.no.longer.<see
2540 20 63 72 65 66 3d 22 76 61 6c 69 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f .cref="valid"/>...........///.</
2560 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 6c 73 6f 20 63 remarks>..........///.<seealso.c
2580 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f ref="platformUserAccountHandle"/
25a0 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 69 6e 74 20 69 64 20 3d 3e 20 6d 5f 49 >..........public.uint.id.=>.m_I
25c0 64 3b 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 d;............///.<summary>.....
25e0 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 75 73 65 72 20 69 73 20 69 73 20 61 73 73 6f 63 .....///.If.the.user.is.is.assoc
2600 69 61 74 65 64 20 77 69 74 68 20 61 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 61 74 20 74 68 65 iated.with.a.user.account.at.the
2620 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 2c 20 74 68 69 73 20 69 73 20 74 68 65 20 68 61 6e .platform.level,.this.is.the.han
2640 64 6c 65 20 75 73 65 64 20 62 79 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 6e 64 dle.used.by.the..........///.und
2660 65 72 6c 79 69 6e 67 20 70 6c 61 74 66 6f 72 6d 20 41 50 49 20 66 6f 72 20 74 68 65 20 61 63 63 erlying.platform.API.for.the.acc
2680 6f 75 6e 74 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 0a 20 ount...........///.</summary>...
26a0 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 20 2f 2f .......///.<remarks>..........//
26c0 2f 20 55 73 65 72 73 20 6d 61 79 20 62 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 75 /.Users.may.be.associated.with.u
26e0 73 65 72 20 61 63 63 6f 75 6e 74 73 20 64 65 66 69 6e 65 64 20 62 79 20 74 68 65 20 70 6c 61 74 ser.accounts.defined.by.the.plat
2700 66 6f 72 6d 20 77 65 20 61 72 65 20 72 75 6e 6e 69 6e 67 20 6f 6e 2e 20 43 6f 6e 73 6f 6c 65 73 form.we.are.running.on..Consoles
2720 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 68 61 76 65 ,.for.example,..........///.have
2740 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 6d 61 6e 61 67 65 6d 65 6e 74 20 62 75 69 6c 74 20 69 .user.account.management.built.i
2760 6e 74 6f 20 74 68 65 20 4f 53 20 61 6e 64 20 6d 61 72 6b 65 74 70 6c 61 63 65 73 20 6c 69 6b 65 nto.the.OS.and.marketplaces.like
2780 20 53 74 65 61 6d 20 61 6c 73 6f 20 68 61 76 65 20 41 50 49 73 20 66 6f 72 20 75 73 65 72 20 6d .Steam.also.have.APIs.for.user.m
27a0 61 6e 61 67 65 6d 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 anagement...........///.........
27c0 20 2f 2f 2f 20 49 66 20 74 68 69 73 20 70 72 6f 70 65 72 74 79 20 69 73 20 6e 6f 74 20 3c 63 3e .///.If.this.property.is.not.<c>
27e0 6e 75 6c 6c 3c 2f 63 3e 2c 20 69 74 20 69 73 20 74 68 65 20 68 61 6e 64 6c 65 20 61 73 73 6f 63 null</c>,.it.is.the.handle.assoc
2800 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 75 73 65 72 20 61 74 20 74 68 65 20 70 6c 61 74 66 iated.with.the.user.at.the.platf
2820 6f 72 6d 20 6c 65 76 65 6c 2e 20 54 68 69 73 20 63 61 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f orm.level..This.can..........///
2840 20 62 65 20 75 73 65 64 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 6f 20 63 61 6c 6c 20 70 .be.used,.for.example,.to.call.p
2860 6c 61 74 66 6f 72 6d 2d 73 70 65 63 69 66 69 63 20 41 50 49 73 20 74 6f 20 66 65 74 63 68 20 61 latform-specific.APIs.to.fetch.a
2880 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 74 68 65 20 dditional.information.about.the.
28a0 75 73 65 72 20 28 73 75 63 68 20 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 65 72 20 user.(such.as..........///.user.
28c0 70 72 6f 66 69 6c 65 20 69 6d 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 profile.images)...........///...
28e0 20 20 20 20 20 20 20 2f 2f 2f 20 42 65 20 61 77 61 72 65 20 74 68 61 74 20 74 68 65 72 65 20 6d .......///.Be.aware.that.there.m
2900 61 79 20 62 65 20 6d 75 6c 74 69 70 6c 65 20 49 6e 70 75 74 55 73 65 72 73 20 74 68 61 74 20 68 ay.be.multiple.InputUsers.that.h
2920 61 76 65 20 74 68 65 20 73 61 6d 65 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 ave.the.same.platformUserAccount
2940 48 61 6e 64 6c 65 20 69 6e 20 63 61 73 65 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 0d 0a 20 20 20 Handle.in.case.the.platform.....
2960 20 20 20 20 20 2f 2f 2f 20 61 6c 6c 6f 77 73 20 64 69 66 66 65 72 65 6e 74 20 70 6c 61 79 65 72 .....///.allows.different.player
2980 73 20 74 6f 20 6c 6f 67 20 69 6e 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 75 73 65 72 20 61 63 63 s.to.log.in.on.the.same.user.acc
29a0 6f 75 6e 74 2e 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 ount...........///.</remarks>...
29c0 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 70 6c 61 74 66 6f .......///.<seealso.cref="platfo
29e0 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f rmUserAccountName"/>..........//
2a00 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 /.<seealso.cref="platformUserAcc
2a20 6f 75 6e 74 49 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 ountId"/>..........///.<seealso.
2a40 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 43 68 61 cref="InputUserChange.AccountCha
2a60 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 55 73 65 nged"/>..........public.InputUse
2a80 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3f 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f rAccountHandle?.platformUserAcco
2aa0 75 6e 74 48 61 6e 64 6c 65 20 3d 3e 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 6e 64 65 78 untHandle.=>.s_AllUserData[index
2ac0 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3b 0d 0a 0d 0a ].platformUserAccountHandle;....
2ae0 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 20 20 20 20 20 2f ........///.<summary>........../
2b00 2f 2f 20 48 75 6d 61 6e 2d 72 65 61 64 61 62 6c 65 20 6e 61 6d 65 20 61 73 73 69 67 6e 65 64 20 //.Human-readable.name.assigned.
2b20 74 6f 20 74 68 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 to.the.user.account.at.the.platf
2b40 6f 72 6d 20 6c 65 76 65 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 orm.level...........///.</summar
2b60 79 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 y>..........///.<remarks>.......
2b80 20 20 20 2f 2f 2f 20 54 68 69 73 20 70 72 6f 70 65 72 74 79 20 77 69 6c 6c 20 62 65 20 3c 63 3e ...///.This.property.will.be.<c>
2ba0 6e 75 6c 6c 3c 2f 63 3e 20 6f 6e 20 70 6c 61 74 66 6f 72 6d 73 20 74 68 61 74 20 64 6f 20 6e 6f null</c>.on.platforms.that.do.no
2bc0 74 20 68 61 76 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 6d 61 6e 61 67 65 6d 65 6e 74 2e 20 t.have.user.account.management..
2be0 49 6e 20 74 68 61 74 20 63 61 73 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 In.that.case,..........///.<see.
2c00 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 cref="platformUserAccountHandle"
2c20 2f 3e 20 77 69 6c 6c 20 62 65 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 61 73 20 77 65 6c 6c 2e 0d />.will.be.<c>null</c>.as.well..
2c40 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 4f 6e 20 70 6c 61 .........///..........///.On.pla
2c60 74 66 6f 72 6d 73 20 73 75 63 68 20 61 73 20 58 62 6f 78 2c 20 50 53 34 2c 20 61 6e 64 20 53 77 tforms.such.as.Xbox,.PS4,.and.Sw
2c80 69 74 63 68 2c 20 74 68 65 20 75 73 65 72 20 6e 61 6d 65 20 77 69 6c 6c 20 62 65 20 74 68 65 20 itch,.the.user.name.will.be.the.
2ca0 6e 61 6d 65 20 6f 66 20 74 68 65 20 75 73 65 72 20 61 73 20 6c 6f 67 67 65 64 20 69 6e 20 6f 6e name.of.the.user.as.logged.in.on
2cc0 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 .the.platform...........///.</re
2ce0 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 6c 73 6f 20 63 72 65 marks>..........///.<seealso.cre
2d00 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e 0d f="platformUserAccountHandle"/>.
2d20 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 70 6c 61 74 .........///.<seealso.cref="plat
2d40 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f formUserAccountId"/>..........//
2d60 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 /.<seealso.cref="InputUserChange
2d80 2e 41 63 63 6f 75 6e 74 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .AccountChanged"/>..........///.
2da0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 <seealso.cref="InputUserChange.A
2dc0 63 63 6f 75 6e 74 4e 61 6d 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 ccountNameChanged"/>..........pu
2de0 62 6c 69 63 20 73 74 72 69 6e 67 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e blic.string.platformUserAccountN
2e00 61 6d 65 20 3d 3e 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 6e 64 65 78 5d 2e 70 6c 61 74 ame.=>.s_AllUserData[index].plat
2e20 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 formUserAccountName;............
2e40 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 50 6c 61 74 66 ///.<summary>..........///.Platf
2e60 6f 72 6d 2d 73 70 65 63 69 66 69 63 20 75 73 65 72 20 49 44 20 74 68 61 74 20 69 73 20 76 61 6c orm-specific.user.ID.that.is.val
2e80 69 64 20 61 63 72 6f 73 73 20 73 65 73 73 69 6f 6e 73 20 65 76 65 6e 20 69 66 20 74 68 65 20 3c id.across.sessions.even.if.the.<
2ea0 73 65 65 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d see.cref="platformUserAccountNam
2ec0 65 22 2f 3e 20 6f 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 75 73 65 72 20 63 68 e"/>.of..........///.the.user.ch
2ee0 61 6e 67 65 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 0a anges...........///.</summary>..
2f00 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 20 2f ........///.<remarks>........../
2f20 2f 2f 20 54 68 69 73 20 69 73 20 6f 6e 6c 79 20 76 61 6c 69 64 20 69 66 20 3c 73 65 65 20 63 72 //.This.is.only.valid.if.<see.cr
2f40 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e ef="platformUserAccountHandle"/>
2f60 20 69 73 20 6e 6f 74 20 6e 75 6c 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 .is.not.null...........///......
2f80 20 20 20 20 2f 2f 2f 20 55 73 65 20 74 68 69 73 20 74 6f 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 ....///.Use.this.to,.for.example
2fa0 2c 20 61 73 73 6f 63 69 61 74 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 73 65 74 74 69 6e 67 73 ,.associate.application.settings
2fc0 20 77 69 74 68 20 74 68 65 20 75 73 65 72 2e 20 46 6f 72 20 64 69 73 70 6c 61 79 20 69 6e 20 55 .with.the.user..For.display.in.U
2fe0 49 73 2c 20 75 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 Is,.use..........///.<see.cref="
3000 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 22 2f 3e 20 69 6e 73 74 65 platformUserAccountName"/>.inste
3020 61 64 2e 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 ad...........///.</remarks>.....
3040 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d .....///.<seealso.cref="platform
3060 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f UserAccountHandle"/>..........//
3080 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 /.<seealso.cref="platformUserAcc
30a0 6f 75 6e 74 4e 61 6d 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 ountName"/>..........///.<seeals
30c0 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 43 o.cref="InputUserChange.AccountC
30e0 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 hanged"/>..........public.string
3100 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 20 3d 3e 20 73 5f 41 6c 6c 55 .platformUserAccountId.=>.s_AllU
3120 73 65 72 44 61 74 61 5b 69 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 serData[index].platformUserAccou
3140 6e 74 49 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 44 6f 65 ntId;............////REVIEW:.Doe
3160 73 20 69 74 20 6d 61 6b 65 20 73 65 6e 73 65 20 74 6f 20 74 72 61 63 6b 20 75 73 65 64 20 64 65 s.it.make.sense.to.track.used.de
3180 76 69 63 65 73 20 73 65 70 61 72 61 74 65 6c 79 20 66 72 6f 6d 20 70 61 69 72 65 64 20 64 65 76 vices.separately.from.paired.dev
31a0 69 63 65 73 3f 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 ices?..........///.<summary>....
31c0 20 20 20 20 20 20 2f 2f 2f 20 44 65 76 69 63 65 73 20 61 73 73 69 67 6e 65 64 2f 70 61 69 72 65 ......///.Devices.assigned/paire
31e0 64 2f 6c 69 6e 6b 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f d/linked.to.the.user.........../
3200 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 20 3c 72 65 6d 61 //.</summary>..........///.<rema
3220 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 69 73 20 67 65 6e 65 72 61 6c 6c rks>..........///.It.is.generall
3240 79 20 76 61 6c 69 64 20 66 6f 72 20 61 20 64 65 76 69 63 65 20 74 6f 20 62 65 20 61 73 73 69 67 y.valid.for.a.device.to.be.assig
3260 6e 65 64 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 2e 20 46 6f 72 20 65 78 61 6d 70 ned.to.multiple.users..For.examp
3280 6c 65 2c 20 74 77 6f 20 75 73 65 72 73 20 63 6f 75 6c 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f le,.two.users.could..........///
32a0 20 62 6f 74 68 20 75 73 65 20 74 68 65 20 6c 6f 63 61 6c 20 6b 65 79 62 6f 61 72 64 20 69 6e 20 .both.use.the.local.keyboard.in.
32c0 61 20 73 70 6c 69 74 2d 6b 65 79 62 6f 61 72 64 20 6f 72 20 68 6f 74 20 73 65 61 74 20 73 65 74 a.split-keyboard.or.hot.seat.set
32e0 75 70 2e 20 48 6f 77 65 76 65 72 2c 20 61 20 70 6c 61 74 66 6f 72 6d 20 6d 61 79 20 72 65 73 74 up..However,.a.platform.may.rest
3300 72 69 63 74 20 74 68 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 6d 61 6e 64 61 rict.this..........///.and.manda
3320 74 65 20 74 68 61 74 20 61 20 64 65 76 69 63 65 20 6e 65 76 65 72 20 62 65 6c 6f 6e 67 20 74 6f te.that.a.device.never.belong.to
3340 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 75 73 65 72 2e 20 54 68 69 73 20 69 73 20 74 68 65 .more.than.one.user..This.is.the
3360 20 63 61 73 65 20 6f 6e 20 58 62 6f 78 20 61 6e 64 20 50 53 34 2c 20 66 6f 72 0d 0a 20 20 20 20 .case.on.Xbox.and.PS4,.for......
3380 20 20 20 20 2f 2f 2f 20 65 78 61 6d 70 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 ....///.example...........///...
33a0 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f 20 61 73 73 6f 63 69 61 74 65 20 64 65 76 69 63 65 73 20 .......///.To.associate.devices.
33c0 77 69 74 68 20 75 73 65 72 73 2c 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 50 65 72 66 6f with.users,.use.<see.cref="Perfo
33e0 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 2e 20 54 6f 20 72 65 6d 6f 76 rmPairingWithDevice"/>..To.remov
3400 65 20 64 65 76 69 63 65 73 2c 20 75 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 e.devices,.use..........///.<see
3420 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 .cref="UnpairDevice"/>.or.<see.c
3440 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 72 22 ref="UnpairDevicesAndRemoveUser"
3460 2f 3e 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 54 68 />...........///..........///.Th
3480 65 20 61 72 72 61 79 20 77 69 6c 6c 20 62 65 20 65 6d 70 74 79 20 66 6f 72 20 61 20 75 73 65 72 e.array.will.be.empty.for.a.user
34a0 20 77 68 6f 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 6e 6f 74 20 70 61 69 72 65 64 20 74 6f 20 .who.is.currently.not.paired.to.
34c0 61 6e 79 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 any.devices...........///.......
34e0 20 20 20 2f 2f 2f 20 49 66 20 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 20 ...///.If.<see.cref="actions"/>.
3500 69 73 20 73 65 74 20 28 3c 73 65 65 20 63 72 65 66 3d 22 41 73 73 6f 63 69 61 74 65 41 63 74 69 is.set.(<see.cref="AssociateActi
3520 6f 6e 73 57 69 74 68 55 73 65 72 28 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 onsWithUser(IInputActionCollecti
3540 6f 6e 29 22 2f 3e 29 2c 20 74 68 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 on)"/>),.then..........///.<see.
3560 63 72 65 66 3d 22 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 cref="IInputActionCollection.dev
3580 69 63 65 73 22 2f 3e 20 77 69 6c 6c 20 62 65 20 6b 65 70 74 20 73 79 6e 63 68 72 6f 6e 69 7a 65 ices"/>.will.be.kept.synchronize
35a0 64 20 77 69 74 68 20 74 68 65 20 64 65 76 69 63 65 73 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 d.with.the.devices.paired.to.the
35c0 20 75 73 65 72 2e 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 .user...........///.</remarks>..
35e0 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 50 65 72 66 6f ........///.<seealso.cref="Perfo
3600 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 rmPairingWithDevice"/>..........
3620 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 22 ///.<seealso.cref="UnpairDevice"
3640 2f 3e 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 55 />..........///.<seealso.cref="U
3660 6e 70 61 69 72 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 npairDevices"/>..........///.<se
3680 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f ealso.cref="UnpairDevicesAndRemo
36a0 76 65 55 73 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 veUser"/>..........///.<seealso.
36c0 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 50 61 69 72 cref="InputUserChange.DevicePair
36e0 65 64 22 2f 3e 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 ed"/>..........///.<seealso.cref
3700 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 ="InputUserChange.DeviceUnpaired
3720 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 "/>..........public.ReadOnlyArra
3740 79 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 70 61 69 72 65 64 44 65 76 69 63 65 73 0d 0a 20 20 y<InputDevice>.pairedDevices....
3760 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 ......{..............get........
3780 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 75 73 65 ......{..................var.use
37a0 72 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rIndex.=.index;.................
37c0 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 44 .return.new.ReadOnlyArray<InputD
37e0 65 76 69 63 65 3e 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 73 5f 41 6c 6c evice>(s_AllPairedDevices,.s_All
3800 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 UserData[userIndex].deviceStartI
3820 6e 64 65 78 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c ndex,......................s_All
3840 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 29 UserData[userIndex].deviceCount)
3860 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 ;..............}..........}.....
3880 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>..........//
38a0 2f 20 44 65 76 69 63 65 73 20 74 68 61 74 20 77 65 72 65 20 72 65 6d 6f 76 65 64 20 77 68 69 6c /.Devices.that.were.removed.whil
38c0 65 20 74 68 65 79 20 77 65 72 65 20 73 74 69 6c 6c 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 e.they.were.still.paired.to.the.
38e0 75 73 65 72 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 0a 20 user...........///.</summary>...
3900 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 20 2f 2f .......///.<remarks>..........//
3920 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6c 69 73 74 20 69 73 20 63 6c 65 61 /..........///.This.list.is.clea
3940 72 65 64 20 6f 6e 63 65 20 74 68 65 20 75 73 65 72 20 68 61 73 20 65 69 74 68 65 72 20 72 65 67 red.once.the.user.has.either.reg
3960 61 69 6e 65 64 20 6c 6f 73 74 20 64 65 76 69 63 65 73 20 6f 72 20 68 61 73 20 72 65 67 61 69 6e ained.lost.devices.or.has.regain
3980 65 64 20 6f 74 68 65 72 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 75 ed.other.devices..........///.su
39a0 63 68 20 74 68 61 74 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 ch.that.the.<see.cref="controlSc
39c0 68 65 6d 65 22 2f 3e 20 69 73 20 73 61 74 69 73 66 69 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f heme"/>.is.satisfied.........../
39e0 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
3a00 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 lso.cref="InputUserChange.Device
3a20 52 65 67 61 69 6e 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 Regained"/>..........///.<seeals
3a40 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 4c 6f o.cref="InputUserChange.DeviceLo
3a60 73 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 61 64 4f 6e 6c 79 41 72 st"/>..........public.ReadOnlyAr
3a80 72 61 79 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 6c 6f 73 74 44 65 76 69 63 65 73 0d 0a 20 20 ray<InputDevice>.lostDevices....
3aa0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 ......{..............get........
3ac0 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 75 73 65 ......{..................var.use
3ae0 72 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rIndex.=.index;.................
3b00 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 44 .return.new.ReadOnlyArray<InputD
3b20 65 76 69 63 65 3e 28 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 73 5f 41 6c 6c 55 73 evice>(s_AllLostDevices,.s_AllUs
3b40 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 erData[userIndex].lostDeviceStar
3b60 74 49 6e 64 65 78 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 tIndex,......................s_A
3b80 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 llUserData[userIndex].lostDevice
3ba0 43 6f 75 6e 74 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 Count);..............}..........
3bc0 7d 0d 0a 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>....
3be0 20 20 20 20 20 20 2f 2f 2f 20 41 63 74 69 6f 6e 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 ......///.Actions.associated.wit
3c00 68 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 h.the.user...........///.</summa
3c20 72 79 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 ry>..........///.<remarks>......
3c40 20 20 20 20 2f 2f 2f 20 41 73 73 6f 63 69 61 74 69 6e 67 20 61 63 74 69 6f 6e 73 20 77 69 74 68 ....///.Associating.actions.with
3c60 20 61 20 75 73 65 72 20 77 69 6c 6c 20 73 79 6e 63 68 72 6f 6e 69 7a 65 20 74 68 65 20 61 63 74 .a.user.will.synchronize.the.act
3c80 69 6f 6e 73 20 77 69 74 68 20 74 68 65 20 64 65 76 69 63 65 73 20 70 61 69 72 65 64 20 74 6f 20 ions.with.the.devices.paired.to.
3ca0 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 65 72 2e 20 41 6c 73 6f 2c 20 69 74 20 the..........///.user..Also,.it.
3cc0 6d 61 6b 65 73 20 69 74 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 75 73 65 20 73 75 70 70 6f 72 74 makes.it.possible.to.use.support
3ce0 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 61 63 74 69 76 61 74 69 6f 6e 20 28 .for.control.scheme.activation.(
3d00 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 41 63 74 69 76 61 74 65 <see..........///.cref="Activate
3d20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 ControlScheme(InputControlScheme
3d40 29 22 2f 3e 20 61 6e 64 20 72 65 6c 61 74 65 64 20 41 50 49 73 20 6c 69 6b 65 20 3c 73 65 65 20 )"/>.and.related.APIs.like.<see.
3d60 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 cref="controlScheme"/>..........
3d80 2f 2f 2f 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 ///.and.<see.cref="controlScheme
3da0 4d 61 74 63 68 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 Match"/>)...........///.........
3dc0 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 69 73 20 67 65 6e 65 72 61 6c 6c 79 20 64 6f 65 73 .///.Note.that.is.generally.does
3de0 20 6e 6f 74 20 6d 61 6b 65 20 73 65 6e 73 65 20 66 6f 72 20 75 73 65 72 73 20 74 6f 20 73 68 61 .not.make.sense.for.users.to.sha
3e00 72 65 20 61 63 74 69 6f 6e 73 2e 20 49 6e 73 74 65 61 64 2c 20 65 61 63 68 20 75 73 65 72 20 73 re.actions..Instead,.each.user.s
3e20 68 6f 75 6c 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 63 65 69 76 65 20 61 20 73 65 74 hould..........///.receive.a.set
3e40 20 6f 66 20 61 63 74 69 6f 6e 73 20 70 72 69 76 61 74 65 20 74 6f 20 74 68 65 20 75 73 65 72 2e .of.actions.private.to.the.user.
3e60 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 20 ..........///.</remarks>........
3e80 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 73 73 6f 63 69 61 74 65 41 63 ..///.<seealso.cref="AssociateAc
3ea0 74 69 6f 6e 73 57 69 74 68 55 73 65 72 28 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 tionsWithUser(IInputActionCollec
3ec0 74 69 6f 6e 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 6f 20 63 tion)"/>..........///.<seealso.c
3ee0 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 ref="InputActionMap"/>..........
3f00 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 63 74 69 6f 6e 41 73 ///.<seealso.cref="InputActionAs
3f20 73 65 74 22 2f 3e 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 set"/>..........///.<seealso.cre
3f40 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 42 69 6e 64 69 6e 67 73 43 68 61 6e 67 f="InputUserChange.BindingsChang
3f60 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 49 6e 70 75 74 41 63 74 69 ed"/>..........public.IInputActi
3f80 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 20 61 63 74 69 6f 6e 73 20 3d 3e 20 73 5f 41 6c 6c 55 73 65 onCollection.actions.=>.s_AllUse
3fa0 72 44 61 74 61 5b 69 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 rData[index].actions;...........
3fc0 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 54 68 65 20 .///.<summary>..........///.The.
3fe0 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 63 75 72 72 65 6e 74 6c 79 20 65 6d 70 6c 6f 79 65 control.scheme.currently.employe
4000 64 20 62 79 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 d.by.the.user...........///.</su
4020 6d 6d 61 72 79 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 mmary>..........///.<remarks>...
4040 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 69 73 20 6e 75 6c 6c 20 62 79 20 64 65 66 61 75 .......///.This.is.null.by.defau
4060 6c 74 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 41 6e lt...........///..........///.An
4080 79 20 74 69 6d 65 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 69 73 20 70 72 6f 70 65 72 74 y.time.the.value.of.this.propert
40a0 79 20 63 68 61 6e 67 65 73 20 28 77 68 65 74 68 65 72 20 62 79 20 3c 73 65 65 20 63 72 65 66 3d y.changes.(whether.by.<see.cref=
40c0 22 53 65 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f "SetControlScheme"/>..........//
40e0 2f 20 6f 72 20 62 79 20 61 75 74 6f 6d 61 74 69 63 20 73 77 69 74 63 68 69 6e 67 29 2c 20 61 20 /.or.by.automatic.switching),.a.
4100 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 69 73 20 73 65 6e 74 20 6f 6e 20 3c 73 65 65 20 63 72 65 notification.is.sent.on.<see.cre
4120 66 3d 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f f="onChange"/>.with..........///
4140 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 43 6f 6e 74 .<see.cref="InputUserChange.Cont
4160 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f rolSchemeChanged"/>...........//
4180 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 65 20 61 77 61 72 65 20 74 68 61 74 20 75 73 69 /..........///.Be.aware.that.usi
41a0 6e 67 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 73 20 77 69 74 68 20 49 6e 70 75 74 55 73 65 ng.control.schemes.with.InputUse
41c0 72 73 20 72 65 71 75 69 72 65 73 20 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f rs.requires.<see.cref="actions"/
41e0 3e 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 73 65 74 2c 20 69 2e 65 2e 20 69 >.to..........///.be.set,.i.e..i
4200 6e 70 75 74 20 61 63 74 69 6f 6e 73 20 74 6f 20 62 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 nput.actions.to.be.associated.wi
4220 74 68 20 74 68 65 20 75 73 65 72 20 28 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 th.the.user.(<see..........///.c
4240 72 65 66 3d 22 41 73 73 6f 63 69 61 74 65 41 63 74 69 6f 6e 73 57 69 74 68 55 73 65 72 28 49 49 ref="AssociateActionsWithUser(II
4260 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 29 22 2f 3e 29 2e 0d 0a 20 20 20 20 nputActionCollection)"/>).......
4280 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 20 20 20 2f 2f 2f 20 ....///.</remarks>..........///.
42a0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 <seealso.cref="ActivateControlSc
42c0 68 65 6d 65 28 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 heme(string)"/>..........///.<se
42e0 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d ealso.cref="ActivateControlSchem
4300 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 29 22 2f 3e 0d 0a 20 20 20 20 20 20 e(InputControlScheme)"/>........
4320 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 55 73 65 72 43 68 ..///.<seealso.cref="InputUserCh
4340 61 6e 67 65 2e 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 ange.ControlSchemeChanged"/>....
4360 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 3f ......public.InputControlScheme?
4380 20 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 3d 3e 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b .controlScheme.=>.s_AllUserData[
43a0 69 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 index].controlScheme;...........
43c0 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 54 68 65 20 .///.<summary>..........///.The.
43e0 72 65 73 75 6c 74 20 6f 66 20 6d 61 74 63 68 69 6e 67 20 74 68 65 20 64 65 76 69 63 65 20 72 65 result.of.matching.the.device.re
4400 71 75 69 72 65 6d 65 6e 74 73 20 67 69 76 65 6e 20 62 79 20 3c 73 65 65 20 63 72 65 66 3d 22 63 quirements.given.by.<see.cref="c
4420 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 20 61 67 61 69 6e 73 74 0d 0a 20 20 20 20 20 20 20 ontrolScheme"/>.against.........
4440 20 2f 2f 2f 20 74 68 65 20 64 65 76 69 63 65 73 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 75 .///.the.devices.paired.to.the.u
4460 73 65 72 20 28 3c 73 65 65 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e ser.(<see.cref="pairedDevices"/>
4480 29 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 0a 20 20 20 20 )...........///.</summary>......
44a0 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 20 2f 2f 2f 20 57 ....///.<remarks>..........///.W
44c0 68 65 6e 20 64 65 76 69 63 65 73 20 61 72 65 20 70 61 69 72 65 64 20 74 6f 20 6f 72 20 75 6e 70 hen.devices.are.paired.to.or.unp
44e0 61 69 72 65 64 20 66 72 6f 6d 20 61 20 75 73 65 72 2c 20 61 73 20 77 65 6c 6c 20 61 73 20 77 68 aired.from.a.user,.as.well.as.wh
4500 65 6e 20 61 20 6e 65 77 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 69 73 0d 0a 20 20 20 20 en.a.new.control.scheme.is......
4520 20 20 20 20 2f 2f 2f 20 61 63 74 69 76 61 74 65 64 20 6f 6e 20 61 20 75 73 65 72 2c 20 74 68 69 ....///.activated.on.a.user,.thi
4540 73 20 70 72 6f 70 65 72 74 79 20 69 73 20 75 70 64 61 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 s.property.is.updated.automatica
4560 6c 6c 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 3e 0d 0a 20 20 lly...........///.</remarks>....
4580 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 43 6f ......///.<seealso.cref="InputCo
45a0 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 64 65 76 69 63 65 52 65 71 75 69 72 65 6d 65 6e 74 73 22 2f ntrolScheme.deviceRequirements"/
45c0 3e 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 >..........///.<seealso.cref="In
45e0 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 50 69 63 6b 44 65 76 69 63 65 73 46 72 6f 6d putControlScheme.PickDevicesFrom
4600 7b 54 44 65 76 69 63 65 73 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e {TDevices}"/>..........public.In
4620 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 4d 61 74 63 68 52 65 73 75 6c 74 20 63 6f 6e putControlScheme.MatchResult.con
4640 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 20 3d 3e 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 trolSchemeMatch.=>.s_AllUserData
4660 5b 69 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 3b 0d 0a 0d 0a 20 [index].controlSchemeMatch;.....
4680 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>..........//
46a0 2f 20 57 68 65 74 68 65 72 20 74 68 65 20 75 73 65 72 20 69 73 20 6d 69 73 73 69 6e 67 20 64 65 /.Whether.the.user.is.missing.de
46c0 76 69 63 65 73 20 72 65 71 75 69 72 65 64 20 62 79 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d vices.required.by.the.<see.cref=
46e0 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 20 61 63 74 69 76 61 74 65 64 0d 0a 20 20 20 "controlScheme"/>.activated.....
4700 20 20 20 20 20 2f 2f 2f 20 6f 6e 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f .....///.on.the.user.........../
4720 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 20 3c 72 65 6d 61 //.</summary>..........///.<rema
4740 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 77 69 6c 6c 20 6f 6e 6c 79 rks>..........///.This.will.only
4760 20 74 61 6b 65 20 72 65 71 75 69 72 65 64 20 64 65 76 69 63 65 73 20 69 6e 74 6f 20 61 63 63 6f .take.required.devices.into.acco
4780 75 6e 74 2e 20 44 65 76 69 63 65 20 72 65 71 75 69 72 65 6d 65 6e 74 73 20 6d 61 72 6b 65 64 20 unt..Device.requirements.marked.
47a0 6f 70 74 69 6f 6e 61 6c 20 28 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 optional.(<see..........///.cref
47c0 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 44 65 76 69 63 65 52 65 71 75 69 ="InputControlScheme.DeviceRequi
47e0 72 65 6d 65 6e 74 2e 69 73 4f 70 74 69 6f 6e 61 6c 22 2f 3e 29 20 77 69 6c 6c 20 6e 6f 74 20 62 rement.isOptional"/>).will.not.b
4800 65 20 63 6f 6e 73 69 64 65 72 65 64 20 6d 69 73 73 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f e.considered.missing..........//
4820 2f 20 64 65 76 69 63 65 73 20 69 66 20 74 68 65 79 20 63 61 6e 6e 6f 74 20 62 65 20 73 61 74 69 /.devices.if.they.cannot.be.sati
4840 73 66 69 65 64 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 73 20 70 61 69 72 65 sfied.based.on.the.devices.paire
4860 64 20 74 6f 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 d.to.the.user...........///.</re
4880 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 6c 73 6f 20 63 72 65 marks>..........///.<seealso.cre
48a0 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 64 65 76 69 63 65 52 65 71 75 f="InputControlScheme.deviceRequ
48c0 69 72 65 6d 65 6e 74 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c irements"/>..........public.bool
48e0 20 68 61 73 4d 69 73 73 69 6e 67 52 65 71 75 69 72 65 64 44 65 76 69 63 65 73 20 3d 3e 20 73 5f .hasMissingRequiredDevices.=>.s_
4900 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 AllUserData[index].controlScheme
4920 4d 61 74 63 68 2e 68 61 73 4d 69 73 73 69 6e 67 52 65 71 75 69 72 65 64 44 65 76 69 63 65 73 3b Match.hasMissingRequiredDevices;
4940 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 20 20 ............///.<summary>.......
4960 20 20 20 2f 2f 2f 20 4c 69 73 74 20 6f 66 20 61 6c 6c 20 63 75 72 72 65 6e 74 20 75 73 65 72 73 ...///.List.of.all.current.users
4980 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 0a 20 20 20 20 20 ...........///.</summary>.......
49a0 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 20 2f 2f 2f 20 55 73 ...///.<remarks>..........///.Us
49c0 65 20 3c 73 65 65 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 e.<see.cref="PerformPairingWithD
49e0 65 76 69 63 65 22 2f 3e 20 74 6f 20 61 64 64 20 6e 65 77 20 75 73 65 72 73 20 61 6e 64 20 3c 73 evice"/>.to.add.new.users.and.<s
4a00 65 65 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 ee.cref="UnpairDevicesAndRemoveU
4a20 73 65 72 22 2f 3e 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 6d 6f 76 65 20 75 73 ser"/>.to..........///.remove.us
4a40 65 72 73 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 ers...........///..........///.N
4a60 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 61 72 72 61 79 20 64 6f 65 73 20 6e 6f 74 20 6e 65 63 ote.that.this.array.does.not.nec
4a80 65 73 73 61 72 69 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 74 68 65 20 6c 69 73 74 20 essarily.correspond.to.the.list.
4aa0 6f 66 20 75 73 65 72 73 20 70 72 65 73 65 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d of.users.present.at.the.platform
4ac0 20 6c 65 76 65 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 65 2e 67 2e 20 58 62 6f 78 20 61 .level..........///.(e.g..Xbox.a
4ae0 6e 64 20 50 53 34 29 2e 20 54 68 65 72 65 20 63 61 6e 20 62 65 20 75 73 65 72 73 20 70 72 65 73 nd.PS4)..There.can.be.users.pres
4b00 65 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 20 74 68 61 74 20 61 ent.at.the.platform.level.that.a
4b20 72 65 20 6e 6f 74 20 70 72 65 73 65 6e 74 20 69 6e 20 74 68 69 73 20 61 72 72 61 79 0d 0a 20 20 re.not.present.in.this.array....
4b40 20 20 20 20 20 20 2f 2f 2f 20 28 65 2e 67 2e 20 62 65 63 61 75 73 65 20 74 68 65 79 20 61 72 65 ......///.(e.g..because.they.are
4b60 20 6e 6f 74 20 6a 6f 69 6e 65 64 20 74 6f 20 74 68 65 20 67 61 6d 65 29 20 61 6e 64 20 75 73 65 .not.joined.to.the.game).and.use
4b80 72 73 20 63 61 6e 20 65 76 65 6e 20 62 65 20 70 72 65 73 65 6e 74 20 6d 6f 72 65 20 74 68 61 6e rs.can.even.be.present.more.than
4ba0 20 6f 6e 63 65 20 28 65 2e 67 2e 20 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 6c 61 79 .once.(e.g..if..........///.play
4bc0 69 6e 67 20 6f 6e 20 74 68 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 62 75 74 20 61 73 20 74 ing.on.the.user.account.but.as.t
4be0 77 6f 20 64 69 66 66 65 72 65 6e 74 20 70 6c 61 79 65 72 73 20 69 6e 20 74 68 65 20 67 61 6d 65 wo.different.players.in.the.game
4c00 29 2e 20 41 6c 73 6f 2c 20 74 68 65 72 65 20 63 61 6e 20 62 65 20 75 73 65 72 73 20 69 6e 20 74 )..Also,.there.can.be.users.in.t
4c20 68 65 20 61 72 72 61 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 61 72 65 20 6e he.array..........///.that.are.n
4c40 6f 74 20 70 72 65 73 65 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c ot.present.at.the.platform.level
4c60 2e 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>.......
4c80 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 ...///.<seealso.cref="PerformPai
4ca0 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ringWithDevice"/>..........///.<
4cc0 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 seealso.cref="UnpairDevicesAndRe
4ce0 6d 6f 76 65 55 73 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 moveUser"/>..........public.stat
4d00 69 63 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 55 73 65 72 3e 20 61 6c 6c 20 ic.ReadOnlyArray<InputUser>.all.
4d20 3d 3e 20 6e 65 77 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 55 73 65 72 3e 28 =>.new.ReadOnlyArray<InputUser>(
4d40 73 5f 41 6c 6c 55 73 65 72 73 2c 20 30 2c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 29 3b 0d s_AllUsers,.0,.s_AllUserCount);.
4d60 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 20 20 20 ...........///.<summary>........
4d80 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 74 72 69 67 67 65 72 65 64 20 77 68 ..///.Event.that.is.triggered.wh
4da0 65 6e 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 22 3e 75 73 65 en.the.<see.cref="InputUser">use
4dc0 72 3c 2f 73 65 65 3e 20 73 65 74 75 70 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 0d 0a 20 20 20 r</see>.setup.in.the.system.....
4de0 20 20 20 20 20 2f 2f 2f 20 63 68 61 6e 67 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c .....///.changes...........///.<
4e00 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e /summary>..........///.<remarks>
4e20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 61 63 68 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 ..........///.Each.notification.
4e40 72 65 63 65 69 76 65 73 20 74 68 65 20 75 73 65 72 20 74 68 61 74 20 77 61 73 20 61 66 66 65 63 receives.the.user.that.was.affec
4e60 74 65 64 20 62 79 20 74 68 65 20 63 68 61 6e 67 65 20 61 6e 64 2c 20 69 6e 20 74 68 65 20 66 6f ted.by.the.change.and,.in.the.fo
4e80 72 6d 20 6f 66 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 rm.of.<see.cref="InputUserChange
4ea0 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 20 64 65 73 63 72 69 70 74 69 6f 6e 20 "/>,..........///.a.description.
4ec0 6f 66 20 77 68 61 74 20 68 61 73 20 63 68 61 6e 67 65 64 20 61 62 6f 75 74 20 74 68 65 20 75 73 of.what.has.changed.about.the.us
4ee0 65 72 2e 20 54 68 65 20 74 68 69 72 64 20 70 61 72 61 6d 65 74 65 72 20 6d 61 79 20 62 65 20 6e er..The.third.parameter.may.be.n
4f00 75 6c 6c 20 62 75 74 20 69 66 20 74 68 65 20 63 68 61 6e 67 65 20 77 69 6c 6c 20 62 65 20 72 65 ull.but.if.the.change.will.be.re
4f20 6c 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 61 6e 20 69 6e 70 75 74 20 64 lated..........///.to.an.input.d
4f40 65 76 69 63 65 2c 20 77 69 6c 6c 20 72 65 66 65 72 65 6e 63 65 20 74 68 65 20 64 65 76 69 63 65 evice,.will.reference.the.device
4f60 20 69 6e 76 6f 6c 76 65 64 20 69 6e 20 74 68 65 20 63 68 61 6e 67 65 2e 0d 0a 20 20 20 20 20 20 .involved.in.the.change.........
4f80 20 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 70 75 62 6c 69 63 ..///.</remarks>..........public
4fa0 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 3c 49 6e 70 75 74 55 73 65 72 2c 20 .static.event.Action<InputUser,.
4fc0 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2c 20 49 6e 70 75 74 44 65 76 69 63 65 3e 20 6f 6e InputUserChange,.InputDevice>.on
4fe0 43 68 61 6e 67 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 61 Change..........{..............a
5000 64 64 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 dd..............{...............
5020 20 20 20 69 66 20 28 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 ...if.(value.==.null)...........
5040 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
5060 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 lException(nameof(value));......
5080 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 43 68 61 6e 67 65 2e 41 70 70 65 6e 64 57 69 74 ............s_OnChange.AppendWit
50a0 68 43 61 70 61 63 69 74 79 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d hCapacity(value);..............}
50c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 ..............remove............
50e0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3d ..{..................if.(value.=
5100 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 =.null)......................thr
5120 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
5140 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 eof(value));..................va
5160 72 20 69 6e 64 65 78 20 3d 20 73 5f 4f 6e 43 68 61 6e 67 65 2e 49 6e 64 65 78 4f 66 28 76 61 6c r.index.=.s_OnChange.IndexOf(val
5180 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 20 ue);..................if.(index.
51a0 21 3d 20 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 73 5f 4f 6e !=.-1)......................s_On
51c0 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 41 74 57 69 74 68 43 61 70 61 63 69 74 79 28 69 6e 64 65 Change.RemoveAtWithCapacity(inde
51e0 78 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 0d 0a 0d x);..............}..........}...
5200 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 20 20 20 20 20 .........///.<summary>..........
5220 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 74 72 69 67 67 65 72 65 64 20 77 68 65 6e ///.Event.that.is.triggered.when
5240 20 61 20 64 65 76 69 63 65 20 69 73 20 75 73 65 64 20 74 68 61 74 20 69 73 20 6e 6f 74 20 63 75 .a.device.is.used.that.is.not.cu
5260 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 61 6e 79 20 75 73 65 72 2e 0d 0a 20 20 20 rrently.paired.to.any.user......
5280 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>..........///
52a0 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 20 64 65 76 69 63 65 .<remarks>..........///.A.device
52c0 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 22 75 73 65 64 22 20 77 68 65 6e 20 69 74 20 68 61 .is.considered."used".when.it.ha
52e0 73 20 6d 61 67 6e 69 74 75 64 65 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e s.magnitude.(<see.cref="InputCon
5300 74 72 6f 6c 2e 45 76 61 6c 75 61 74 65 4d 61 67 6e 69 74 75 64 65 28 29 22 2f 3e 29 20 67 72 65 trol.EvaluateMagnitude()"/>).gre
5320 61 74 65 72 20 74 68 61 6e 20 7a 65 72 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 20 61 ater.than.zero..........///.on.a
5340 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 69 73 20 6e 6f 74 20 6e 6f 69 73 79 20 28 3c 73 65 65 .control.that.is.not.noisy.(<see
5360 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 6e 6f 69 73 79 22 2f 3e 29 20 61 6e .cref="InputControl.noisy"/>).an
5380 64 20 6e 6f 74 20 73 79 6e 74 68 65 74 69 63 20 28 69 2e 65 2e 20 6e 6f 74 20 61 20 63 6f 6e 74 d.not.synthetic.(i.e..not.a.cont
53a0 72 6f 6c 20 74 68 61 74 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 22 6d 61 64 65 20 75 rol.that.is..........///."made.u
53c0 70 22 20 6c 69 6b 65 20 3c 73 65 65 20 63 72 65 66 3d 22 4b 65 79 62 6f 61 72 64 2e 61 6e 79 4b p".like.<see.cref="Keyboard.anyK
53e0 65 79 22 2f 3e 3b 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 73 ey"/>;.<see.cref="InputControl.s
5400 79 6e 74 68 65 74 69 63 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 ynthetic"/>)...........///......
5420 20 20 20 20 2f 2f 2f 20 44 65 74 65 63 74 69 6e 67 20 74 68 65 20 75 73 65 20 6f 66 20 75 6e 70 ....///.Detecting.the.use.of.unp
5440 61 69 72 65 64 20 64 65 76 69 63 65 73 20 68 61 73 20 61 20 6e 6f 6e 2d 7a 65 72 6f 20 63 6f 73 aired.devices.has.a.non-zero.cos
5460 74 2e 20 57 68 69 6c 65 20 6d 75 6c 74 69 70 6c 65 20 6c 65 76 65 6c 73 20 6f 66 20 74 65 73 74 t..While.multiple.levels.of.test
5480 73 20 61 72 65 20 61 70 70 6c 69 65 64 20 74 6f 20 74 72 79 20 74 6f 0d 0a 20 20 20 20 20 20 20 s.are.applied.to.try.to.........
54a0 20 2f 2f 2f 20 63 68 65 61 70 6c 79 20 69 67 6e 6f 72 65 20 64 65 76 69 63 65 73 20 74 68 61 74 .///.cheaply.ignore.devices.that
54c0 20 68 61 76 65 20 65 76 65 6e 74 73 20 73 65 6e 74 20 74 6f 20 74 68 65 6d 20 74 68 61 74 20 64 .have.events.sent.to.them.that.d
54e0 6f 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 75 73 65 72 20 61 63 74 69 76 69 74 79 2c 20 66 69 6e o.not.contain.user.activity,.fin
5500 64 69 6e 67 20 6f 75 74 20 77 68 65 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 20 ding.out.whether..........///.a.
5520 64 65 76 69 63 65 20 68 61 64 20 72 65 61 6c 20 75 73 65 72 20 61 63 74 69 76 69 74 79 20 77 69 device.had.real.user.activity.wi
5540 6c 6c 20 65 76 65 6e 74 75 61 6c 6c 79 20 72 65 71 75 69 72 65 20 67 6f 69 6e 67 20 74 68 72 6f ll.eventually.require.going.thro
5560 75 67 68 20 74 68 65 20 64 65 76 69 63 65 20 63 6f 6e 74 72 6f 6c 20 62 79 20 63 6f 6e 74 72 6f ugh.the.device.control.by.contro
5580 6c 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 54 6f 20 l...........///..........///.To.
55a0 65 6e 61 62 6c 65 20 64 65 74 65 63 74 69 6f 6e 20 6f 66 20 74 68 65 20 75 73 65 20 6f 66 20 75 enable.detection.of.the.use.of.u
55c0 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2c 20 73 65 74 20 3c 73 65 65 20 63 72 65 66 3d 22 npaired.devices,.set.<see.cref="
55e0 6c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 22 listenForUnpairedDeviceActivity"
5600 2f 3e 20 74 6f 20 74 72 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 69 73 20 64 />.to.true...........///.It.is.d
5620 69 73 61 62 6c 65 64 20 62 79 20 64 65 66 61 75 6c 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f isabled.by.default...........///
5640 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e ..........///.The.callback.is.in
5660 76 6f 6b 65 64 20 66 6f 72 20 65 61 63 68 20 6e 6f 6e 2d 6c 65 61 66 2c 20 6e 6f 6e 2d 73 79 6e voked.for.each.non-leaf,.non-syn
5680 74 68 65 74 69 63 2c 20 6e 6f 6e 2d 6e 6f 69 73 79 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 68 thetic,.non-noisy.control.that.h
56a0 61 73 20 62 65 65 6e 20 61 63 74 75 61 74 65 64 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 2e 0d as.been.actuated.on.the.device..
56c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 62 65 69 6e 67 20 72 65 73 74 72 69 63 74 65 64 .........///.It.being.restricted
56e0 20 74 6f 20 6e 6f 6e 2d 6c 65 61 66 20 63 6f 6e 74 72 6f 6c 73 20 6d 65 61 6e 73 20 74 68 61 74 .to.non-leaf.controls.means.that
5700 20 69 66 2c 20 73 61 79 2c 20 74 68 65 20 73 74 69 63 6b 20 6f 6e 20 61 20 67 61 6d 65 70 61 64 .if,.say,.the.stick.on.a.gamepad
5720 20 69 73 20 61 63 74 75 61 74 65 64 20 69 6e 20 62 6f 74 68 20 58 20 61 6e 64 20 59 0d 0a 20 20 .is.actuated.in.both.X.and.Y....
5740 20 20 20 20 20 20 2f 2f 2f 20 64 69 72 65 63 74 69 6f 6e 2c 20 79 6f 75 20 77 69 6c 6c 20 73 65 ......///.direction,.you.will.se
5760 65 20 74 77 6f 20 63 61 6c 6c 73 3a 20 6f 6e 65 20 77 69 74 68 20 73 74 69 63 6b 2f 78 20 61 6e e.two.calls:.one.with.stick/x.an
5780 64 20 6f 6e 65 20 77 69 74 68 20 73 74 69 63 6b 2f 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f d.one.with.stick/y...........///
57a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 72 65 61 73 6f 6e 20 74 68 61 74 20 74 68 ..........///.The.reason.that.th
57c0 65 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 69 6e 76 6f 6b 65 64 20 66 6f 72 20 65 61 63 68 20 69 e.callback.is.invoked.for.each.i
57e0 6e 64 69 76 69 64 75 61 6c 20 63 6f 6e 74 72 6f 6c 20 69 73 20 74 68 61 74 20 70 61 69 72 69 6e ndividual.control.is.that.pairin
5800 67 20 6f 66 74 65 6e 20 72 65 6c 69 65 73 20 6f 6e 20 63 68 65 63 6b 69 6e 67 0d 0a 20 20 20 20 g.often.relies.on.checking......
5820 20 20 20 20 2f 2f 2f 20 66 6f 72 20 73 70 65 63 69 66 69 63 20 6b 69 6e 64 73 20 6f 66 20 69 6e ....///.for.specific.kinds.of.in
5840 74 65 72 61 63 74 69 6f 6e 73 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 61 20 70 61 69 72 69 teractions..For.example,.a.pairi
5860 6e 67 20 63 61 6c 6c 62 61 63 6b 20 6d 61 79 20 6c 69 73 74 65 6e 20 65 78 63 6c 75 73 69 76 65 ng.callback.may.listen.exclusive
5880 6c 79 20 66 6f 72 20 62 75 74 74 6f 6e 20 70 72 65 73 73 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 ly.for.button.presses...........
58a0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 77 68 65 74 68 ///..........///.Note.that.wheth
58c0 65 72 20 74 68 65 20 75 73 65 20 6f 66 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 6c er.the.use.of.unpaired.devices.l
58e0 65 61 64 73 20 74 6f 20 74 68 65 6d 20 67 65 74 74 69 6e 67 20 70 61 69 72 65 64 20 69 73 20 75 eads.to.them.getting.paired.is.u
5900 6e 64 65 72 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61 74 nder.the.control.of.the.applicat
5920 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 ion...........///.If.the.device.
5940 73 68 6f 75 6c 64 20 62 65 20 70 61 69 72 65 64 2c 20 69 6e 76 6f 6b 65 20 3c 73 65 65 20 63 72 should.be.paired,.invoke.<see.cr
5960 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 20 ef="PerformPairingWithDevice"/>.
5980 66 72 6f 6d 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 2e 20 49 66 20 79 6f 75 20 64 6f 20 73 6f 2c from.the.callback..If.you.do.so,
59a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 20 66 75 72 74 68 65 72 20 63 61 6c 6c 62 61 63 ..........///.no.further.callbac
59c0 6b 73 20 77 69 6c 6c 20 67 65 74 20 74 72 69 67 67 65 72 65 64 20 66 6f 72 20 6f 74 68 65 72 20 ks.will.get.triggered.for.other.
59e0 63 6f 6e 74 72 6f 6c 73 20 74 68 61 74 20 6d 61 79 20 68 61 76 65 20 62 65 65 6e 20 61 63 74 75 controls.that.may.have.been.actu
5a00 61 74 65 64 20 69 6e 20 74 68 65 20 73 61 6d 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 ated.in.the.same.event..........
5a20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 65 20 61 77 61 72 65 20 74 68 61 74 20 .///..........///.Be.aware.that.
5a40 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 66 69 72 65 64 20 3c 65 6d 3e 62 65 66 6f 72 65 the.callback.is.fired.<em>before
5a60 3c 2f 65 6d 3e 20 69 6e 70 75 74 20 69 73 20 61 63 74 75 61 6c 6c 79 20 69 6e 63 6f 72 70 6f 72 </em>.input.is.actually.incorpor
5a80 61 74 65 64 20 69 6e 74 6f 20 74 68 65 20 64 65 76 69 63 65 20 28 69 74 20 69 73 0d 0a 20 20 20 ated.into.the.device.(it.is.....
5aa0 20 20 20 20 20 2f 2f 2f 20 69 6e 64 69 72 65 63 74 6c 79 20 74 72 69 67 67 65 72 65 64 20 66 72 .....///.indirectly.triggered.fr
5ac0 6f 6d 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 45 76 65 6e om.<see.cref="InputSystem.onEven
5ae0 74 22 2f 3e 29 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 61 74 20 74 68 65 20 74 69 6d 65 20 74 68 t"/>)..This.means.at.the.time.th
5b00 65 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 72 75 6e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e.callback.is.run,..........///.
5b20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 64 6f the.state.of.the.given.device.do
5b40 65 73 20 6e 6f 74 20 79 65 74 20 68 61 76 65 20 74 68 65 20 69 6e 70 75 74 20 74 68 61 74 20 74 es.not.yet.have.the.input.that.t
5b60 72 69 67 67 65 72 65 64 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 2e 20 46 6f 72 20 74 68 69 73 20 riggered.the.callback..For.this.
5b80 72 65 61 73 6f 6e 2c 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 61 6c 6c 62 61 63 reason,.the..........///.callbac
5ba0 6b 20 72 65 63 65 69 76 65 73 20 61 20 73 65 63 6f 6e 64 20 61 72 67 75 6d 65 6e 74 20 74 68 61 k.receives.a.second.argument.tha
5bc0 74 20 72 65 66 65 72 65 6e 63 65 73 20 74 68 65 20 65 76 65 6e 74 20 66 72 6f 6d 20 77 68 69 63 t.references.the.event.from.whic
5be0 68 20 74 68 65 20 75 73 65 20 6f 66 20 61 6e 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 20 h.the.use.of.an.unpaired.device.
5c00 77 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 65 74 65 63 74 65 64 2e 0d 0a 20 20 20 20 was..........///.detected.......
5c20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 61 74 20 74 68 69 73 20 73 ....///..........///.What.this.s
5c40 65 71 75 65 6e 63 65 20 61 6c 6c 6f 77 73 20 69 73 20 74 6f 20 6d 61 6b 65 20 63 68 61 6e 67 65 equence.allows.is.to.make.change
5c60 73 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 20 62 65 66 6f 72 65 20 74 68 65 20 69 6e 70 75 74 s.to.the.system.before.the.input
5c80 20 69 73 20 70 72 6f 63 65 73 73 65 64 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 61 6e 0d 0a .is.processed..For.example,.an..
5ca0 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 20 74 68 61 74 20 69 73 20 65 6e 61 62 6c ........///.action.that.is.enabl
5cc0 65 64 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 77 69 6c 6c 20 ed.as.part.of.the.callback.will.
5ce0 73 75 62 73 65 71 75 65 6e 74 6c 79 20 72 65 73 70 6f 6e 64 20 74 6f 20 74 68 65 20 69 6e 70 75 subsequently.respond.to.the.inpu
5d00 74 20 74 68 61 74 20 74 72 69 67 67 65 72 65 64 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f t.that.triggered.the..........//
5d20 2f 20 63 61 6c 6c 62 61 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 /.callback...........///........
5d40 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 63 6f ..///.<example>..........///.<co
5d60 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 63 74 69 76 61 74 65 20 73 75 70 de>..........///.//.Activate.sup
5d80 70 6f 72 74 20 66 6f 72 20 6c 69 73 74 65 6e 69 6e 67 20 74 6f 20 64 65 76 69 63 65 20 61 63 74 port.for.listening.to.device.act
5da0 69 76 69 74 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2b 2b 49 6e 70 75 74 55 73 65 72 2e ivity...........///.++InputUser.
5dc0 6c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 3b listenForUnpairedDeviceActivity;
5de0 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 20 57 68 ..........///..........///.//.Wh
5e00 65 6e 20 61 20 62 75 74 74 6f 6e 20 6f 6e 20 61 6e 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 en.a.button.on.an.unpaired.devic
5e20 65 20 69 73 20 70 72 65 73 73 65 64 2c 20 70 61 69 72 20 74 68 65 20 64 65 76 69 63 65 20 74 6f e.is.pressed,.pair.the.device.to
5e40 20 61 20 6e 65 77 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 6f 72 20 65 78 69 73 74 69 .a.new..........///.//.or.existi
5e60 6e 67 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 55 73 65 72 2e ng.user...........///.InputUser.
5e80 6f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 20 2b 3d 0d 0a 20 20 20 20 20 20 20 onUnpairedDeviceUsed.+=.........
5ea0 20 2f 2f 2f 20 20 20 20 20 75 73 65 64 43 6f 6e 74 72 6f 6c 20 3d 3e 0d 0a 20 20 20 20 20 20 20 .///.....usedControl.=>.........
5ec0 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .///.....{..........///.........
5ee0 2f 2f 20 4f 6e 6c 79 20 72 65 61 63 74 20 74 6f 20 62 75 74 74 6f 6e 20 70 72 65 73 73 65 73 20 //.Only.react.to.button.presses.
5f00 6f 6e 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f on.unpaired.devices...........//
5f20 2f 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 75 73 65 64 43 6f 6e 74 72 6f 6c 20 69 73 20 42 /.........if.(!(usedControl.is.B
5f40 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 uttonControl))..........///.....
5f60 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 ........return;..........///....
5f80 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 50 61 69 72 20 74 68 65 20 64 65 ......///.........//.Pair.the.de
5fa0 76 69 63 65 20 74 6f 20 61 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 vice.to.a.user...........///....
5fc0 20 20 20 20 20 49 6e 70 75 74 55 73 65 72 2e 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 .....InputUser.PerformPairingWit
5fe0 68 44 65 76 69 63 65 28 75 73 65 64 43 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 29 3b 0d 0a 20 20 hDevice(usedControl.device);....
6000 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f ......///.....};..........///.</
6020 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 3e 0d 0a 20 code>..........///.</example>...
6040 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 6e 6f 74 68 65 72 20 .......///..........///.Another.
6060 70 6f 73 73 69 62 6c 65 20 75 73 65 20 6f 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 20 69 73 20 possible.use.of.the.callback.is.
6080 66 6f 72 20 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 20 61 75 74 6f 6d 61 74 69 63 20 63 6f 6e 74 72 for.implementing.automatic.contr
60a0 6f 6c 20 73 63 68 65 6d 65 20 73 77 69 74 63 68 69 6e 67 20 66 6f 72 20 61 20 75 73 65 72 20 73 ol.scheme.switching.for.a.user.s
60c0 75 63 68 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 75 73 65 72 20 63 uch.that..........///.the.user.c
60e0 61 6e 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 73 77 69 74 63 68 20 66 72 6f 6d 20 6b 65 79 an,.for.example,.switch.from.key
6100 62 6f 61 72 64 26 61 6d 70 3b 6d 6f 75 73 65 20 74 6f 20 67 61 6d 65 70 61 64 20 73 65 61 6d 6c board&amp;mouse.to.gamepad.seaml
6120 65 73 73 6c 79 20 62 79 20 73 69 6d 70 6c 79 20 70 69 63 6b 69 6e 67 20 75 70 20 74 68 65 20 67 essly.by.simply.picking.up.the.g
6140 61 6d 65 70 61 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 73 74 61 72 74 69 6e 67 amepad..........///.and.starting
6160 20 74 6f 20 70 6c 61 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 .to.play...........///.</remarks
6180 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 65 76 65 6e 74 20 41 >..........public.static.event.A
61a0 63 74 69 6f 6e 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 ction<InputControl,.InputEventPt
61c0 72 3e 20 6f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 0d 0a 20 20 20 20 20 20 20 r>.onUnpairedDeviceUsed.........
61e0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 64 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .{..............add.............
6200 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3d 3d .{..................if.(value.==
6220 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f .null)......................thro
6240 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 65 w.new.ArgumentNullException(name
6260 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f of(value));..................s_O
6280 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 2e 41 70 70 65 6e 64 57 69 74 68 43 61 nUnpairedDeviceUsed.AppendWithCa
62a0 70 61 63 69 74 79 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 pacity(value);..................
62c0 69 66 20 28 73 5f 4c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 if.(s_ListenForUnpairedDeviceAct
62e0 69 76 69 74 79 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ivity.>.0)......................
6300 48 6f 6f 6b 49 6e 74 6f 45 76 65 6e 74 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d HookIntoEvents();..............}
6320 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 ..............remove............
6340 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3d ..{..................if.(value.=
6360 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 =.null)......................thr
6380 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
63a0 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 eof(value));..................va
63c0 72 20 69 6e 64 65 78 20 3d 20 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 r.index.=.s_OnUnpairedDeviceUsed
63e0 2e 49 6e 64 65 78 4f 66 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .IndexOf(value);................
6400 20 20 69 66 20 28 69 6e 64 65 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..if.(index.!=.-1)..............
6420 20 20 20 20 20 20 20 20 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 2e 52 ........s_OnUnpairedDeviceUsed.R
6440 65 6d 6f 76 65 41 74 57 69 74 68 43 61 70 61 63 69 74 79 28 69 6e 64 65 78 29 3b 0d 0a 20 20 20 emoveAtWithCapacity(index);.....
6460 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 .............if.(s_OnUnpairedDev
6480 69 63 65 55 73 65 64 2e 6c 65 6e 67 74 68 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 iceUsed.length.==.0)............
64a0 20 20 20 20 20 20 20 20 20 20 55 6e 68 6f 6f 6b 46 72 6f 6d 44 65 76 69 63 65 53 74 61 74 65 43 ..........UnhookFromDeviceStateC
64c0 68 61 6e 67 65 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 hange();..............}.........
64e0 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>.....
6500 20 20 20 20 20 2f 2f 2f 20 57 68 65 74 68 65 72 20 74 6f 20 6c 69 73 74 65 6e 20 66 6f 72 20 75 .....///.Whether.to.listen.for.u
6520 73 65 72 20 61 63 74 69 76 69 74 79 20 6f 6e 20 63 75 72 72 65 6e 74 6c 79 20 75 6e 70 61 69 72 ser.activity.on.currently.unpair
6540 65 64 20 64 65 76 69 63 65 73 20 61 6e 64 20 69 6e 76 6f 6b 65 20 3c 73 65 65 20 63 72 65 66 3d ed.devices.and.invoke.<see.cref=
6560 22 6f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 "onUnpairedDeviceUsed"/>........
6580 20 20 2f 2f 2f 20 69 66 20 73 75 63 68 20 61 63 74 69 76 69 74 79 20 69 73 20 64 65 74 65 63 74 ..///.if.such.activity.is.detect
65a0 65 64 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 0a 20 20 20 ed...........///.</summary>.....
65c0 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 20 2f 2f 2f 20 .....///.<remarks>..........///.
65e0 54 68 69 73 20 69 73 20 6f 66 66 20 62 79 20 64 65 66 61 75 6c 74 2e 0d 0a 20 20 20 20 20 20 20 This.is.off.by.default..........
6600 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 65 6e 61 62 .///..........///.Note.that.enab
6620 6c 69 6e 67 20 74 68 69 73 20 68 61 73 20 61 20 6e 6f 6e 2d 7a 65 72 6f 20 63 6f 73 74 2e 20 57 ling.this.has.a.non-zero.cost..W
6640 68 65 6e 65 76 65 72 20 74 68 65 20 73 74 61 74 65 20 63 68 61 6e 67 65 73 20 6f 66 20 61 20 64 henever.the.state.changes.of.a.d
6660 65 76 69 63 65 20 74 68 61 74 20 69 73 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 evice.that.is.not.currently.pair
6680 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 61 20 75 73 65 72 2c 20 74 68 65 20 73 ed..........///.to.a.user,.the.s
66a0 79 73 74 65 6d 20 68 61 73 20 74 6f 20 73 70 65 6e 64 20 74 69 6d 65 20 66 69 67 75 72 69 6e 67 ystem.has.to.spend.time.figuring
66c0 20 6f 75 74 20 77 68 65 74 68 65 72 20 74 68 65 72 65 20 77 61 73 20 61 20 6d 65 61 6e 69 6e 67 .out.whether.there.was.a.meaning
66e0 66 75 6c 20 63 68 61 6e 67 65 20 6f 72 20 77 68 65 74 68 65 72 20 69 74 27 73 20 6a 75 73 74 0d ful.change.or.whether.it's.just.
6700 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 69 73 65 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 .........///.noise.on.the.device
6720 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 54 68 69 73 ...........///..........///.This
6740 20 69 73 20 61 6e 20 69 6e 74 65 67 65 72 20 72 61 74 68 65 72 20 74 68 61 6e 20 61 20 62 6f 6f .is.an.integer.rather.than.a.boo
6760 6c 20 74 6f 20 61 6c 6c 6f 77 20 6d 75 6c 74 69 70 6c 65 20 73 79 73 74 65 6d 73 20 74 6f 20 63 l.to.allow.multiple.systems.to.c
6780 6f 6e 63 75 72 72 65 6e 74 6c 79 20 75 73 65 20 74 6f 20 6c 69 73 74 65 6e 20 66 6f 72 20 75 6e oncurrently.use.to.listen.for.un
67a0 70 61 69 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 65 76 69 63 65 20 61 63 74 69 76 paired..........///.device.activ
67c0 69 74 79 20 77 69 74 68 6f 75 74 20 74 72 65 61 64 69 6e 67 20 6f 6e 20 65 61 63 68 20 6f 74 68 ity.without.treading.on.each.oth
67e0 65 72 20 77 68 65 6e 20 65 6e 61 62 6c 69 6e 67 2f 64 69 73 61 62 6c 69 6e 67 20 74 68 65 20 63 er.when.enabling/disabling.the.c
6800 6f 64 65 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 ode.path...........///.</remarks
6820 3e 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 6f 6e >..........///.<seealso.cref="on
6840 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f UnpairedDeviceUsed"/>........../
6860 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 //.<seealso.cref="pairedDevices"
6880 2f 3e 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 50 />..........///.<seealso.cref="P
68a0 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 erformPairingWithDevice"/>......
68c0 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 6c 69 73 74 65 6e 46 6f 72 55 ....public.static.int.listenForU
68e0 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 0d 0a 20 20 20 20 20 20 20 20 7b npairedDeviceActivity..........{
6900 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 73 5f 4c 69 73 74 65 6e 46 6f 72 ..............get.=>.s_ListenFor
6920 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 UnpairedDeviceActivity;.........
6940 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 .....set..............{.........
6960 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 .........if.(value.<.0).........
6980 20 20 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 4f .............throw.new.ArgumentO
69a0 75 74 4f 66 52 61 6e 67 65 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 utOfRangeException(nameof(value)
69c0 2c 20 22 43 61 6e 6e 6f 74 20 62 65 20 6e 65 67 61 74 69 76 65 22 29 3b 0d 0a 20 20 20 20 20 20 ,."Cannot.be.negative");........
69e0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3e 20 30 20 26 26 20 73 5f 4f 6e 55 ..........if.(value.>.0.&&.s_OnU
6a00 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 2e 6c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 npairedDeviceUsed.length.>.0)...
6a20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48 6f 6f 6b 49 6e 74 6f 45 76 65 6e 74 ...................HookIntoEvent
6a40 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 76 s();..................else.if.(v
6a60 61 6c 75 65 20 3d 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 alue.==.0)......................
6a80 55 6e 68 6f 6f 6b 46 72 6f 6d 44 65 76 69 63 65 53 74 61 74 65 43 68 61 6e 67 65 28 29 3b 0d 0a UnhookFromDeviceStateChange();..
6aa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 ................s_ListenForUnpai
6ac0 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 redDeviceActivity.=.value;......
6ae0 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 ........}..........}............
6b00 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 41 73 73 6f 63 ///.<summary>..........///.Assoc
6b20 69 61 74 65 20 61 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 6f 66 20 3c 73 65 65 20 63 72 65 66 3d 22 iate.a.collection.of.<see.cref="
6b40 49 6e 70 75 74 41 63 74 69 6f 6e 22 2f 3e 73 20 77 69 74 68 20 74 68 65 20 75 73 65 72 2e 0d 0a InputAction"/>s.with.the.user...
6b60 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 20 ........///.</summary>..........
6b80 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 61 63 74 69 6f 6e 73 22 3e 41 63 74 69 6f 6e ///.<param.name="actions">Action
6ba0 73 20 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77 69 74 68 20 74 68 65 20 75 73 65 72 2c 20 65 69 s.to.associate.with.the.user,.ei
6bc0 74 68 65 72 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 41 73 ther.an.<see.cref="InputActionAs
6be0 73 65 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 72 20 61 6e 20 3c 73 65 65 20 63 set"/>..........///.or.an.<see.c
6c00 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 22 2f 3e 2e 20 43 61 6e 20 62 65 20 3c ref="InputActionMap"/>..Can.be.<
6c20 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 74 6f 20 75 6e 73 65 74 20 74 68 65 20 63 75 72 72 65 6e 74 20 c>null</c>.to.unset.the.current.
6c40 61 73 73 6f 63 69 61 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f association.</param>..........//
6c60 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 /.<exception.cref="InvalidOperat
6c80 69 6f 6e 45 78 63 65 70 74 69 6f 6e 22 3e 54 68 65 20 75 73 65 72 20 69 6e 73 74 61 6e 63 65 20 ionException">The.user.instance.
6ca0 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 is.invalid.</exception>.........
6cc0 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 73 73 6f .///.<remarks>..........///.Asso
6ce0 63 69 61 74 69 6e 67 20 61 63 74 69 6f 6e 73 20 77 69 74 68 20 61 20 75 73 65 72 20 77 69 6c 6c ciating.actions.with.a.user.will
6d00 20 65 6e 73 75 72 65 20 74 68 61 74 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e 70 .ensure.that.the.<see.cref="IInp
6d20 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 69 63 65 73 22 2f 3e 20 61 6e utActionCollection.devices"/>.an
6d40 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e 70 75 74 d..........///.<see.cref="IInput
6d60 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 62 69 6e 64 69 6e 67 4d 61 73 6b 22 2f 3e 20 ActionCollection.bindingMask"/>.
6d80 70 72 6f 70 65 72 74 79 20 6f 66 20 74 68 65 20 61 63 74 69 6f 6e 20 63 6f 6c 6c 65 63 74 69 6f property.of.the.action.collectio
6da0 6e 20 61 72 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f n.are.automatically..........///
6dc0 20 6b 65 70 74 20 69 6e 20 73 79 6e 63 20 77 69 74 68 20 74 68 65 20 64 65 76 69 63 65 20 70 61 .kept.in.sync.with.the.device.pa
6de0 69 72 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d ired.to.the.user.(see.<see.cref=
6e00 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 29 20 61 6e 64 20 74 68 65 20 63 6f 6e 74 72 "pairedDevices"/>).and.the.contr
6e20 6f 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 63 68 65 6d 65 20 61 63 74 69 76 65 20 6f 6e ol..........///.scheme.active.on
6e40 20 74 68 65 20 75 73 65 72 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f .the.user.(see.<see.cref="contro
6e60 6c 53 63 68 65 6d 65 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 lScheme"/>)...........///.......
6e80 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 63 ...///.<example>..........///.<c
6ea0 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 67 61 6d 65 70 61 64 20 3d 20 ode>..........///.var.gamepad.=.
6ec0 47 61 6d 65 70 61 64 2e 61 6c 6c 5b 30 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 Gamepad.all[0];..........///....
6ee0 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 50 61 69 72 20 74 68 65 20 67 61 6d 65 70 61 64 20 74 6f ......///.//.Pair.the.gamepad.to
6f00 20 61 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 75 73 65 72 20 3d .a.user...........///.var.user.=
6f20 20 49 6e 70 75 74 55 73 65 72 2e 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 .InputUser.PerformPairingWithDev
6f40 69 63 65 28 67 61 6d 65 70 61 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 ice(gamepad);..........///......
6f60 20 20 20 20 2f 2f 2f 20 2f 2f 20 43 72 65 61 74 65 20 61 6e 20 61 63 74 69 6f 6e 20 6d 61 70 20 ....///.//.Create.an.action.map.
6f80 77 69 74 68 20 61 6e 20 61 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 with.an.action...........///.var
6fa0 20 61 63 74 69 6f 6e 4d 61 70 20 3d 20 6e 65 77 20 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 28 .actionMap.=.new.InputActionMap(
6fc0 29 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 4d 61 70 2e 41 64 64 41 63 74 ):..........///.actionMap.AddAct
6fe0 69 6f 6e 28 22 46 69 72 65 22 2c 20 62 69 6e 64 69 6e 67 3a 20 22 26 6c 74 3b 47 61 6d 65 70 61 ion("Fire",.binding:."&lt;Gamepa
7000 64 26 67 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f d&gt;/buttonSouth");..........//
7020 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 73 73 6f 63 69 61 74 65 20 74 68 65 20 /..........///.//.Associate.the.
7040 61 63 74 69 6f 6e 20 6d 61 70 20 77 69 74 68 20 74 68 65 20 75 73 65 72 20 28 74 68 65 20 73 61 action.map.with.the.user.(the.sa
7060 6d 65 20 77 6f 72 6b 73 20 66 6f 72 20 61 6e 20 61 73 73 65 74 29 2e 0d 0a 20 20 20 20 20 20 20 me.works.for.an.asset)..........
7080 20 2f 2f 2f 20 75 73 65 72 2e 41 73 73 6f 63 69 61 74 65 41 63 74 69 6f 6e 73 57 69 74 68 55 73 .///.user.AssociateActionsWithUs
70a0 65 72 28 61 63 74 69 6f 6e 4d 61 70 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 er(actionMap);..........///.....
70c0 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4e 6f 77 20 74 68 65 20 61 63 74 69 6f 6e 20 6d 61 70 20 69 .....///.//.Now.the.action.map.i
70e0 73 20 72 65 73 74 72 69 63 74 65 64 20 74 6f 20 6a 75 73 74 20 74 68 65 20 67 61 6d 65 70 61 64 s.restricted.to.just.the.gamepad
7100 20 74 68 61 74 20 69 73 20 70 61 69 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 .that.is.paired..........///.//.
7120 77 69 74 68 20 74 68 65 20 75 73 65 72 2c 20 65 76 65 6e 20 69 66 20 74 68 65 72 65 20 61 72 65 with.the.user,.even.if.there.are
7140 20 6d 6f 72 65 20 67 61 6d 65 70 61 64 73 20 63 75 72 72 65 6e 74 6c 79 20 63 6f 6e 6e 65 63 74 .more.gamepads.currently.connect
7160 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 ed...........///.</code>........
7180 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 2f 2f 20 3c 2f ..///.</example>..........///.</
71a0 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 6c 73 6f 20 63 remarks>..........///.<seealso.c
71c0 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 ref="actions"/>..........public.
71e0 76 6f 69 64 20 41 73 73 6f 63 69 61 74 65 41 63 74 69 6f 6e 73 57 69 74 68 55 73 65 72 28 49 49 void.AssociateActionsWithUser(II
7200 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 20 61 63 74 69 6f 6e 73 29 0d 0a 20 nputActionCollection.actions)...
7220 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 75 73 65 72 49 6e .......{..............var.userIn
7240 64 65 78 20 3d 20 69 6e 64 65 78 3b 20 2f 2f 20 54 68 72 6f 77 73 20 69 66 20 75 73 65 72 20 69 dex.=.index;.//.Throws.if.user.i
7260 73 20 69 6e 76 61 6c 69 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c s.invalid...............if.(s_Al
7280 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 20 3d 3d 20 lUserData[userIndex].actions.==.
72a0 61 63 74 69 6f 6e 73 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 actions)..................return
72c0 3b 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 61 6c 72 65 61 64 ;................//.If.we.alread
72e0 79 20 68 61 64 20 61 63 74 69 6f 6e 73 20 61 73 73 6f 63 69 61 74 65 64 2c 20 72 65 73 65 74 20 y.had.actions.associated,.reset.
7300 74 68 65 20 62 69 6e 64 69 6e 67 20 6d 61 73 6b 20 61 6e 64 20 64 65 76 69 63 65 20 6c 69 73 74 the.binding.mask.and.device.list
7320 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 41 63 74 69 6f 6e 73 20 3d 20 ...............var.oldActions.=.
7340 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 s_AllUserData[userIndex].actions
7360 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6c 64 41 63 74 69 6f 6e 73 20 21 3d ;..............if.(oldActions.!=
7380 20 6e 75 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 .null)..............{...........
73a0 20 20 20 20 20 20 20 6f 6c 64 41 63 74 69 6f 6e 73 2e 64 65 76 69 63 65 73 20 3d 20 6e 75 6c 6c .......oldActions.devices.=.null
73c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 6c 64 41 63 74 69 6f 6e 73 2e 62 69 ;..................oldActions.bi
73e0 6e 64 69 6e 67 4d 61 73 6b 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ndingMask.=.null;..............}
7400 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 ................s_AllUserData[us
7420 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 20 3d 20 61 63 74 69 6f 6e 73 3b 0d 0a 0d 0a 20 erIndex].actions.=.actions;.....
7440 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 27 76 65 20 73 77 69 74 63 68 65 64 20 ...........//.If.we've.switched.
7460 74 6f 20 61 20 64 69 66 66 65 72 65 6e 74 20 73 65 74 20 6f 66 20 61 63 74 69 6f 6e 73 2c 20 73 to.a.different.set.of.actions,.s
7480 79 6e 63 68 72 6f 6e 69 7a 65 20 6f 75 72 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 ynchronize.our.state............
74a0 20 20 20 69 66 20 28 61 63 74 69 6f 6e 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ...if.(actions.!=.null).........
74c0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48 6f 6f 6b 49 6e 74 6f .....{..................HookInto
74e0 41 63 74 69 6f 6e 43 68 61 6e 67 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ActionChange();.................
7500 20 20 20 61 63 74 69 6f 6e 73 2e 64 65 76 69 63 65 73 20 3d 20 70 61 69 72 65 64 44 65 76 69 63 ...actions.devices.=.pairedDevic
7520 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 es;..................if.(s_AllUs
7540 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 erData[userIndex].controlScheme.
7560 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 63 !=.null)......................Ac
7580 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 49 6e 74 65 72 6e 61 6c 28 75 73 65 72 tivateControlSchemeInternal(user
75a0 49 6e 64 65 78 2c 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e Index,.s_AllUserData[userIndex].
75c0 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 56 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 controlScheme.Value);...........
75e0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 ...}..........}............publi
7600 63 20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 53 79 6e 74 61 78 20 41 63 74 69 c.ControlSchemeChangeSyntax.Acti
7620 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 28 73 74 72 69 6e 67 20 73 63 68 65 6d 65 4e vateControlScheme(string.schemeN
7640 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 20 2f 2f 20 ame)..........{..............//.
7660 4c 6f 6f 6b 20 75 70 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 62 79 20 6e 61 6d 65 20 69 Look.up.control.scheme.by.name.i
7680 6e 20 61 63 74 69 6f 6e 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 63 68 65 n.actions...............var.sche
76a0 6d 65 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 28 29 3b 0d 0a me.=.new.InputControlScheme();..
76c0 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
76e0 45 6d 70 74 79 28 73 63 68 65 6d 65 4e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Empty(schemeName))..............
7700 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 {..................var.userIndex
7720 20 3d 20 69 6e 64 65 78 3b 20 2f 2f 20 54 68 72 6f 77 73 20 69 66 20 75 73 65 72 20 69 73 20 69 .=.index;.//.Throws.if.user.is.i
7740 6e 76 61 6c 69 64 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 65 nvalid.....................//.Ne
7760 65 64 20 61 63 74 69 6f 6e 73 20 74 6f 20 62 65 20 61 76 61 69 6c 61 62 6c 65 20 74 6f 20 62 65 ed.actions.to.be.available.to.be
7780 20 61 62 6c 65 20 74 6f 20 61 63 74 69 76 61 74 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 .able.to.activate.control.scheme
77a0 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 79 20 6e 61 6d 65 20 6f 6e s..................//.by.name.on
77c0 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 ly...................if.(s_AllUs
77e0 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 20 3d 3d 20 6e 75 6c erData[userIndex].actions.==.nul
7800 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 l)......................throw.ne
7820 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 w.InvalidOperationException(....
7840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 73 ......................$"Cannot.s
7860 65 74 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 27 7b 73 63 68 65 6d 65 4e 61 6d 65 7d 27 et.control.scheme.'{schemeName}'
7880 20 62 79 20 6e 61 6d 65 20 6f 6e 20 75 73 65 72 20 23 7b 75 73 65 72 49 6e 64 65 78 7d 20 61 73 .by.name.on.user.#{userIndex}.as
78a0 20 6e 6f 74 20 61 63 74 69 6f 6e 73 20 68 61 76 65 20 62 65 65 6e 20 61 73 73 6f 63 69 61 74 65 .not.actions.have.been.associate
78c0 64 20 77 69 74 68 20 74 68 65 20 75 73 65 72 20 79 65 74 20 28 41 73 73 6f 63 69 61 74 65 41 63 d.with.the.user.yet.(AssociateAc
78e0 74 69 6f 6e 73 57 69 74 68 55 73 65 72 29 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tionsWithUser)");...............
7900 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 73 20 3d 20 73 5f 41 6c 6c 55 .....var.controlSchemes.=.s_AllU
7920 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 2e 63 6f 6e 74 72 serData[userIndex].actions.contr
7940 6f 6c 53 63 68 65 6d 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 olSchemes;..................for.
7960 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 73 2e 43 (var.i.=.0;.i.<.controlSchemes.C
7980 6f 75 6e 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 20 20 20 20 ount;.++i)......................
79a0 69 66 20 28 73 74 72 69 6e 67 2e 43 6f 6d 70 61 72 65 28 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 if.(string.Compare(controlScheme
79c0 73 5b 69 5d 2e 6e 61 6d 65 2c 20 73 63 68 65 6d 65 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 s[i].name,.schemeName,..........
79e0 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 6f 6e ................StringComparison
7a00 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 3d 20 .InvariantCultureIgnoreCase).==.
7a20 30 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 0)......................{.......
7a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 63 68 65 6d 65 20 3d 20 63 6f 6e 74 ...................scheme.=.cont
7a60 72 6f 6c 53 63 68 65 6d 65 73 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rolSchemes[i];..................
7a80 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 20 ........break;..................
7aa0 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 54 68 72 6f ....}....................//.Thro
7ac0 77 20 69 66 20 77 65 20 63 61 6e 27 74 20 66 69 6e 64 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 w.if.we.can't.find.it...........
7ae0 20 20 20 20 20 20 20 20 69 66 20 28 73 63 68 65 6d 65 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a ........if.(scheme.==.default)..
7b00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 ....................throw.new.Ar
7b20 67 75 6d 65 6e 74 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 gumentException(................
7b40 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 66 69 6e 64 20 63 6f 6e 74 72 6f 6c 20 ..........$"Cannot.find.control.
7b60 73 63 68 65 6d 65 20 27 7b 73 63 68 65 6d 65 4e 61 6d 65 7d 27 20 69 6e 20 61 63 74 69 6f 6e 73 scheme.'{schemeName}'.in.actions
7b80 20 27 7b 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 .'{s_AllUserData[userIndex].acti
7ba0 6f 6e 73 7d 27 22 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 ons}'");..............}.........
7bc0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 .......return.ActivateControlSch
7be0 65 6d 65 28 73 63 68 65 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 eme(scheme);..........}.........
7c00 20 20 20 70 75 62 6c 69 63 20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 53 79 6e ...public.ControlSchemeChangeSyn
7c20 74 61 78 20 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 28 49 6e 70 75 74 43 tax.ActivateControlScheme(InputC
7c40 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 73 63 68 65 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d ontrolScheme.scheme)..........{.
7c60 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 6e 64 .............var.userIndex.=.ind
7c80 65 78 3b 20 2f 2f 20 54 68 72 6f 77 73 20 69 66 20 75 73 65 72 20 69 73 20 69 6e 76 61 6c 69 64 ex;.//.Throws.if.user.is.invalid
7ca0 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 .................if.(s_AllUserDa
7cc0 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 73 ta[userIndex].controlScheme.!=.s
7ce0 63 68 65 6d 65 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 73 63 68 65 6d cheme.||..................(schem
7d00 65 20 3d 3d 20 64 65 66 61 75 6c 74 20 26 26 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 e.==.default.&&.s_AllUserData[us
7d20 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 6e 75 6c 6c 29 29 erIndex].controlScheme.!=.null))
7d40 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 ..............{.................
7d60 20 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 49 6e 74 65 72 6e 61 6c 28 75 .ActivateControlSchemeInternal(u
7d80 73 65 72 49 6e 64 65 78 2c 20 73 63 68 65 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 serIndex,.scheme);..............
7da0 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 ....Notify(userIndex,.InputUserC
7dc0 68 61 6e 67 65 2e 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 64 2c 20 6e 75 6c 6c hange.ControlSchemeChanged,.null
7de0 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 20 20 );..............}...............
7e00 20 72 65 74 75 72 6e 20 6e 65 77 20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 53 .return.new.ControlSchemeChangeS
7e20 79 6e 74 61 78 20 7b 6d 5f 55 73 65 72 49 6e 64 65 78 20 3d 20 75 73 65 72 49 6e 64 65 78 7d 3b yntax.{m_UserIndex.=.userIndex};
7e40 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 ..........}............private.v
7e60 6f 69 64 20 41 63 74 69 76 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 49 6e 74 65 72 6e 61 oid.ActivateControlSchemeInterna
7e80 6c 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 l(int.userIndex,.InputControlSch
7ea0 65 6d 65 20 73 63 68 65 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 eme.scheme)..........{..........
7ec0 20 20 20 20 76 61 72 20 69 73 45 6d 70 74 79 20 3d 20 73 63 68 65 6d 65 20 3d 3d 20 64 65 66 61 ....var.isEmpty.=.scheme.==.defa
7ee0 75 6c 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 45 6d 70 74 79 29 ult;................if.(isEmpty)
7f00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b ..................s_AllUserData[
7f20 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 3d 20 6e 75 6c 6c 3b userIndex].controlScheme.=.null;
7f40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..............else..............
7f60 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e ....s_AllUserData[userIndex].con
7f80 74 72 6f 6c 53 63 68 65 6d 65 20 3d 20 73 63 68 65 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 trolScheme.=.scheme;............
7fa0 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d ....if.(s_AllUserData[userIndex]
7fc0 2e 61 63 74 69 6f 6e 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b .actions.!=.null)..............{
7fe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 45 6d 70 74 79 29 0d 0a ..................if.(isEmpty)..
8000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
8020 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e .......s_AllUserData[userIndex].
8040 61 63 74 69 6f 6e 73 2e 62 69 6e 64 69 6e 67 4d 61 73 6b 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 actions.bindingMask.=.null;.....
8060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 .................s_AllUserData[u
8080 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 2e 44 69 73 serIndex].controlSchemeMatch.Dis
80a0 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 pose();......................s_A
80c0 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 llUserData[userIndex].controlSch
80e0 65 6d 65 4d 61 74 63 68 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d emeMatch.=.new.InputControlSchem
8100 65 2e 4d 61 74 63 68 52 65 73 75 6c 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e.MatchResult();................
8120 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 ..}..................else.......
8140 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 ...........{....................
8160 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f ..s_AllUserData[userIndex].actio
8180 6e 73 2e 62 69 6e 64 69 6e 67 4d 61 73 6b 20 3d 20 6e 65 77 20 49 6e 70 75 74 42 69 6e 64 69 6e ns.bindingMask.=.new.InputBindin
81a0 67 20 7b 67 72 6f 75 70 73 20 3d 20 73 63 68 65 6d 65 2e 62 69 6e 64 69 6e 67 47 72 6f 75 70 7d g.{groups.=.scheme.bindingGroup}
81c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 43 6f 6e ;......................UpdateCon
81e0 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 28 75 73 65 72 49 6e 64 65 78 29 3b 0d 0a 20 20 20 trolSchemeMatch(userIndex);.....
8200 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 7d 0d 0a 20 .............}..............}...
8220 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 79 .......}............///.<summary
8240 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 6e 70 61 69 72 20 61 20 73 69 6e 67 6c 65 20 64 >..........///.Unpair.a.single.d
8260 65 76 69 63 65 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f evice.from.the.user...........//
8280 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 20 3c 70 61 72 61 6d /.</summary>..........///.<param
82a0 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 75 6e 70 61 69 72 20 .name="device">Device.to.unpair.
82c0 66 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 from.the.user..If.the.device.is.
82e0 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 not.currently.paired.to.the.user
8300 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e ,..........///.the.method.does.n
8320 6f 74 68 69 6e 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 othing.</param>..........///.<ex
8340 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 70 74 ception.cref="ArgumentNullExcept
8360 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 ion"><paramref.name="device"/>.i
8380 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 0d 0a 20 20 20 20 s.<c>null</c>.</exception>......
83a0 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 20 2f 2f 2f 20 49 ....///.<remarks>..........///.I
83c0 66 20 61 63 74 69 6f 6e 73 20 61 72 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 f.actions.are.associated.with.th
83e0 65 20 75 73 65 72 20 28 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 29 2c 20 e.user.(<see.cref="actions"/>),.
8400 74 68 65 20 6c 69 73 74 20 6f 66 20 64 65 76 69 63 65 73 20 75 73 65 64 20 62 79 20 74 68 65 0d the.list.of.devices.used.by.the.
8420 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 63 72 65 66 3d .........///.actions.(<see.cref=
8440 22 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 69 63 65 73 22 "IInputActionCollection.devices"
8460 2f 3e 29 20 69 73 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 70 64 61 74 65 64 2e 0d 0a 20 />).is.automatically.updated....
8480 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 61 20 63 6f 6e .......///..........///.If.a.con
84a0 74 72 6f 6c 20 73 63 68 65 6d 65 20 69 73 20 61 63 74 69 76 61 74 65 64 20 6f 6e 20 74 68 65 20 trol.scheme.is.activated.on.the.
84c0 75 73 65 72 20 28 3c 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f user.(<see.cref="controlScheme"/
84e0 3e 29 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 >),.<see.cref="controlSchemeMatc
8500 68 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 75 74 6f 6d 61 74 69 63 61 6c h"/>..........///.is.automatical
8520 6c 79 20 75 70 64 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 ly.updated...........///........
8540 20 20 2f 2f 2f 20 53 65 6e 64 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 ..///.Sends.<see.cref="InputUser
8560 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 22 2f 3e 20 74 68 72 6f 75 67 68 Change.DeviceUnpaired"/>.through
8580 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 .<see.cref="onChange"/>.........
85a0 20 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 73 ..///.</remarks>..........///.<s
85c0 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 eealso.cref="PerformPairingWithD
85e0 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 evice"/>..........///.<seealso.c
8600 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f ref="pairedDevices"/>........../
8620 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 22 //.<seealso.cref="UnpairDevices"
8640 2f 3e 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 55 />..........///.<seealso.cref="U
8660 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 72 22 2f 3e 0d 0a 20 20 npairDevicesAndRemoveUser"/>....
8680 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 55 73 ......///.<seealso.cref="InputUs
86a0 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 22 2f 3e 0d 0a 20 20 20 20 erChange.DeviceUnpaired"/>......
86c0 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 55 6e 70 61 69 72 44 65 76 69 63 65 28 49 6e 70 ....public.void.UnpairDevice(Inp
86e0 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 utDevice.device)..........{.....
8700 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 .........if.(device.==.null)....
8720 20 20 20 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 ..............throw.new.Argument
8740 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a NullException(nameof(device));..
8760 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 6e ..............var.userIndex.=.in
8780 64 65 78 3b 20 2f 2f 20 54 68 72 6f 77 73 20 69 66 20 75 73 65 72 20 69 73 20 69 6e 76 61 6c 69 dex;.//.Throws.if.user.is.invali
87a0 64 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 69 66 20 6e d.................//.Ignore.if.n
87c0 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 75 73 65 72 2e 0d 0a 20 20 ot.currently.paired.to.user.....
87e0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 70 61 69 72 65 64 44 65 76 69 63 65 73 2e 43 6f 6e ..........if.(!pairedDevices.Con
8800 74 61 69 6e 73 52 65 66 65 72 65 6e 63 65 28 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 tainsReference(device)).........
8820 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .........return;................
8840 52 65 6d 6f 76 65 44 65 76 69 63 65 46 72 6f 6d 55 73 65 72 28 75 73 65 72 49 6e 64 65 78 2c 20 RemoveDeviceFromUser(userIndex,.
8860 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f device);..........}............/
8880 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 55 6e 70 61 69 72 //.<summary>..........///.Unpair
88a0 20 61 6c 6c 20 64 65 76 69 63 65 73 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 .all.devices.from.the.user......
88c0 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>..........///
88e0 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 61 63 74 69 6f .<remarks>..........///.If.actio
8900 6e 73 20 61 72 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 75 73 65 72 20 ns.are.associated.with.the.user.
8920 28 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 29 2c 20 74 68 65 20 6c 69 73 (<see.cref="actions"/>),.the.lis
8940 74 20 6f 66 20 64 65 76 69 63 65 73 20 75 73 65 64 20 62 79 20 74 68 65 0d 0a 20 20 20 20 20 20 t.of.devices.used.by.the........
8960 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e 70 75 74 ..///.actions.(<see.cref="IInput
8980 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 69 63 65 73 22 2f 3e 29 20 69 73 20 ActionCollection.devices"/>).is.
89a0 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 70 64 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 automatically.updated...........
89c0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 61 20 63 6f 6e 74 72 6f 6c 20 73 63 ///..........///.If.a.control.sc
89e0 68 65 6d 65 20 69 73 20 61 63 74 69 76 61 74 65 64 20 6f 6e 20 74 68 65 20 75 73 65 72 20 28 3c heme.is.activated.on.the.user.(<
8a00 73 65 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 29 2c 20 3c 73 65 see.cref="controlScheme"/>),.<se
8a20 65 20 63 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 22 2f 3e 0d 0a 20 e.cref="controlSchemeMatch"/>...
8a40 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 70 64 61 .......///.is.automatically.upda
8a60 74 65 64 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 53 ted...........///..........///.S
8a80 65 6e 64 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e ends.<see.cref="InputUserChange.
8aa0 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 22 2f 3e 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 DeviceUnpaired"/>.through.<see.c
8ac0 72 65 66 3d 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 20 66 6f 72 20 65 76 65 72 79 20 64 65 76 69 63 ref="onChange"/>.for.every.devic
8ae0 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 6e 70 61 69 72 65 64 20 66 72 6f 6d 20 74 68 65 e..........///.unpaired.from.the
8b00 20 75 73 65 72 2e 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 .user...........///.</remarks>..
8b20 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 50 65 72 66 6f ........///.<seealso.cref="Perfo
8b40 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 rmPairingWithDevice"/>..........
8b60 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 ///.<seealso.cref="pairedDevices
8b80 22 2f 3e 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 "/>..........///.<seealso.cref="
8ba0 55 6e 70 61 69 72 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 UnpairDevice"/>..........///.<se
8bc0 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f ealso.cref="UnpairDevicesAndRemo
8be0 76 65 55 73 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 veUser"/>..........///.<seealso.
8c00 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 cref="InputUserChange.DeviceUnpa
8c20 69 72 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 55 6e 70 ired"/>..........public.void.Unp
8c40 61 69 72 44 65 76 69 63 65 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 airDevices()..........{.........
8c60 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 20 2f 2f 20 54 .....var.userIndex.=.index;.//.T
8c80 68 72 6f 77 73 20 69 66 20 75 73 65 72 20 69 73 20 69 6e 76 61 6c 69 64 2e 0d 0a 0d 0a 20 20 20 hrows.if.user.is.invalid........
8ca0 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 65 74 20 64 65 76 69 63 65 20 63 6f 75 6e 74 20 73 .........//.Reset.device.count.s
8cc0 6f 20 69 74 20 61 70 70 65 61 72 73 20 61 6c 6c 20 64 65 76 69 63 65 73 20 61 72 65 20 67 6f 6e o.it.appears.all.devices.are.gon
8ce0 65 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 20 57 65 20 73 74 69 6c 6c 20 77 61 6e 74 20 74 e.from.the.user..We.still.want.t
8d00 6f 20 73 65 6e 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6e 6f 74 69 66 69 63 61 74 o.send..............//.notificat
8d20 69 6f 6e 73 20 6f 6e 65 20 62 79 20 6f 6e 65 2c 20 73 6f 20 77 65 20 63 61 6e 27 74 20 79 65 74 ions.one.by.one,.so.we.can't.yet
8d40 20 72 65 6d 6f 76 65 20 74 68 65 20 64 65 76 69 63 65 73 20 66 72 6f 6d 20 73 5f 41 6c 6c 50 61 .remove.the.devices.from.s_AllPa
8d60 69 72 65 64 44 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 iredDevices...............var.de
8d80 76 69 63 65 43 6f 75 6e 74 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e viceCount.=.s_AllUserData[userIn
8da0 64 65 78 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 dex].deviceCount;..............v
8dc0 61 72 20 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 ar.deviceStartIndex.=.s_AllUserD
8de0 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b ata[userIndex].deviceStartIndex;
8e00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 ..............s_AllUserData[user
8e20 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 Index].deviceCount.=.0;.........
8e40 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 .....s_AllUserData[userIndex].de
8e60 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 viceStartIndex.=.0;.............
8e80 20 20 20 2f 2f 20 55 70 64 61 74 65 20 61 63 74 69 6f 6e 73 2c 20 69 66 20 6e 65 63 65 73 73 61 ...//.Update.actions,.if.necessa
8ea0 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 63 74 69 6f 6e 73 20 3d 20 73 ry...............var.actions.=.s
8ec0 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 3b _AllUserData[userIndex].actions;
8ee0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 63 74 69 6f 6e 73 20 21 3d 20 6e 75 6c ..............if.(actions.!=.nul
8f00 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 63 74 69 6f 6e 73 2e 64 65 76 69 l)..................actions.devi
8f20 63 65 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 ces.=.null;................//.Up
8f40 64 61 74 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 2c 20 69 66 20 6e 65 63 65 73 73 61 72 date.control.scheme,.if.necessar
8f60 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 y...............if.(s_AllUserDat
8f80 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 6e 75 a[userIndex].controlScheme.!=.nu
8fa0 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 43 6f 6e 74 72 ll)..................UpdateContr
8fc0 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 28 75 73 65 72 49 6e 64 65 78 29 3b 0d 0a 0d 0a 20 20 20 olSchemeMatch(userIndex);.......
8fe0 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 69 66 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .........//.Notify..............
9000 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 65 76 69 63 65 43 6f 75 6e 74 .for.(var.i.=.0;.i.<.deviceCount
9020 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 ;.++i)..................Notify(u
9040 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 serIndex,.InputUserChange.Device
9060 55 6e 70 61 69 72 65 64 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 5b 64 65 76 Unpaired,.s_AllPairedDevices[dev
9080 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 2b 20 69 5d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 iceStartIndex.+.i]);............
90a0 20 20 20 20 2f 2f 20 52 65 6d 6f 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 ....//.Remove...............Arra
90c0 79 48 65 6c 70 65 72 73 2e 45 72 61 73 65 53 6c 69 63 65 57 69 74 68 43 61 70 61 63 69 74 79 28 yHelpers.EraseSliceWithCapacity(
90e0 72 65 66 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c ref.s_AllPairedDevices,.ref.s_Al
9100 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 53 74 61 72 74 49 lPairedDeviceCount,.deviceStartI
9120 6e 64 65 78 2c 20 64 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ndex,.deviceCount);.............
9140 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f .if.(s_AllUserData[userIndex].lo
9160 73 74 44 65 76 69 63 65 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 stDeviceCount.>.0)..............
9180 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e {..................ArrayHelpers.
91a0 45 72 61 73 65 53 6c 69 63 65 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 5f 41 6c 6c EraseSliceWithCapacity(ref.s_All
91c0 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 LostDevices,.ref.s_AllLostDevice
91e0 43 6f 75 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c Count,......................s_Al
9200 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 lUserData[userIndex].lostDeviceS
9220 74 61 72 74 49 6e 64 65 78 2c 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 tartIndex,.s_AllUserData[userInd
9240 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ex].lostDeviceCount);...........
9260 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 .........s_AllUserData[userIndex
9280 5d 2e 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 ].lostDeviceCount.=.0;..........
92a0 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d ........s_AllUserData[userIndex]
92c0 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3d 20 30 3b 0d 0a 20 20 20 20 .lostDeviceStartIndex.=.0;......
92e0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 ........}................//.Adju
9300 73 74 20 69 6e 64 69 63 65 73 20 6f 66 20 6f 74 68 65 72 20 75 73 65 72 73 2e 0d 0a 20 20 20 20 st.indices.of.other.users.......
9320 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 73 5f 41 6c ........for.(var.i.=.0;.i.<.s_Al
9340 6c 55 73 65 72 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 lUserCount;.++i)..............{.
9360 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 .................if.(s_AllUserDa
9380 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3c 3d 20 64 65 76 69 63 65 ta[i].deviceStartIndex.<=.device
93a0 53 74 61 72 74 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 StartIndex).....................
93c0 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c .continue;..................s_Al
93e0 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 2d 3d lUserData[i].deviceStartIndex.-=
9400 20 64 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 .deviceCount;..............}....
9420 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 79 3e ......}............///.<summary>
9440 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 6e 70 61 69 72 20 61 6c 6c 20 64 65 76 69 63 65 73 ..........///.Unpair.all.devices
9460 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 74 68 65 20 75 73 .from.the.user.and.remove.the.us
9480 65 72 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 0a 20 20 20 er...........///.</summary>.....
94a0 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 20 2f 2f 2f 20 .....///.<remarks>..........///.
94c0 49 66 20 61 63 74 69 6f 6e 73 20 61 72 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 If.actions.are.associated.with.t
94e0 68 65 20 75 73 65 72 20 28 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 29 2c he.user.(<see.cref="actions"/>),
9500 20 74 68 65 20 6c 69 73 74 20 6f 66 20 64 65 76 69 63 65 73 20 75 73 65 64 20 62 79 20 74 68 65 .the.list.of.devices.used.by.the
9520 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 63 72 65 66 ..........///.actions.(<see.cref
9540 3d 22 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 69 63 65 73 ="IInputActionCollection.devices
9560 22 2f 3e 29 20 69 73 20 72 65 73 65 74 20 61 73 20 69 73 20 74 68 65 20 62 69 6e 64 69 6e 67 20 "/>).is.reset.as.is.the.binding.
9580 6d 61 73 6b 20 28 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 49 mask.(<see..........///.cref="II
95a0 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 62 69 6e 64 69 6e 67 4d 61 73 6b nputActionCollection.bindingMask
95c0 22 2f 3e 29 20 69 6e 20 63 61 73 65 20 61 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 69 73 "/>).in.case.a.control.scheme.is
95e0 20 61 63 74 69 76 61 74 65 64 20 6f 6e 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 .activated.on.the.user..........
9600 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 6e 64 73 20 3c 73 65 65 20 63 72 65 .///..........///.Sends.<see.cre
9620 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 f="InputUserChange.DeviceUnpaire
9640 64 22 2f 3e 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 43 68 61 6e 67 65 d"/>.through.<see.cref="onChange
9660 22 2f 3e 20 66 6f 72 20 65 76 65 72 79 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f "/>.for.every.device..........//
9680 2f 20 75 6e 70 61 69 72 65 64 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 /.unpaired.from.the.user........
96a0 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 6e 64 73 20 3c 73 65 65 20 63 ...///..........///.Sends.<see.c
96c0 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 64 22 2f 3e 2e ref="InputUserChange.Removed"/>.
96e0 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 20 ..........///.</remarks>........
9700 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 ..///.<seealso.cref="PerformPair
9720 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ingWithDevice"/>..........///.<s
9740 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 eealso.cref="pairedDevices"/>...
9760 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 55 6e 70 61 69 72 .......///.<seealso.cref="Unpair
9780 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 Device"/>..........///.<seealso.
97a0 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 72 cref="UnpairDevicesAndRemoveUser
97c0 22 2f 3e 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 "/>..........///.<seealso.cref="
97e0 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 22 2f InputUserChange.DeviceUnpaired"/
9800 3e 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 >..........///.<seealso.cref="In
9820 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 putUserChange.Removed"/>........
9840 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 55 6e 70 61 69 72 44 65 76 69 63 65 73 41 6e 64 52 65 ..public.void.UnpairDevicesAndRe
9860 6d 6f 76 65 55 73 65 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 moveUser()..........{...........
9880 20 20 20 55 6e 70 61 69 72 44 65 76 69 63 65 73 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ...UnpairDevices();.............
98a0 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 ...var.userIndex.=.index;.......
98c0 20 20 20 20 20 20 20 52 65 6d 6f 76 65 55 73 65 72 28 75 73 65 72 49 6e 64 65 78 29 3b 0d 0a 0d .......RemoveUser(userIndex);...
98e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 64 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 .............m_Id.=.default;....
9900 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 79 3e ......}............///.<summary>
9920 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 20 61 20 6c 69 73 74 20 6f 66 20 61 ..........///.Return.a.list.of.a
9940 6c 6c 20 63 75 72 72 65 6e 74 6c 79 20 61 64 64 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 20 ll.currently.added.devices.that.
9960 61 72 65 20 6e 6f 74 20 70 61 69 72 65 64 20 74 6f 20 61 6e 79 20 75 73 65 72 2e 0d 0a 20 20 20 are.not.paired.to.any.user......
9980 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>..........///
99a0 20 3c 72 65 74 75 72 6e 73 3e 41 20 28 70 6f 73 73 69 62 6c 79 20 65 6d 70 74 79 29 20 6c 69 73 .<returns>A.(possibly.empty).lis
99c0 74 20 6f 66 20 64 65 76 69 63 65 73 20 74 68 61 74 20 61 72 65 20 63 75 72 72 65 6e 74 6c 79 20 t.of.devices.that.are.currently.
99e0 6e 6f 74 20 70 61 69 72 65 64 20 74 6f 20 61 20 75 73 65 72 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d not.paired.to.a.user.</returns>.
9a00 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 20 .........///.<remarks>..........
9a20 2f 2f 2f 20 54 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6c 69 73 74 20 75 73 65 73 20 3c 73 65 65 ///.The.resulting.list.uses.<see
9a40 20 63 72 65 66 3d 22 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d 70 22 3e 20 74 65 6d 70 6f 72 61 72 .cref="Allocator.Temp">.temporar
9a60 79 2c 20 75 6e 6d 61 6e 61 67 65 64 20 6d 65 6d 6f 72 79 3c 2f 73 65 65 3e 2e 20 49 66 20 6e 6f y,.unmanaged.memory</see>..If.no
9a80 74 20 64 69 73 70 6f 73 65 64 20 6f 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 78 70 6c 69 t.disposed.of..........///.expli
9aa0 63 69 74 6c 79 2c 20 74 68 65 20 6c 69 73 74 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c citly,.the.list.will.automatical
9ac0 6c 79 20 62 65 20 64 65 61 6c 6c 6f 63 61 74 65 64 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 ly.be.deallocated.at.the.end.of.
9ae0 74 68 65 20 66 72 61 6d 65 20 61 6e 64 20 77 69 6c 6c 20 62 65 63 6f 6d 65 20 75 6e 75 73 61 62 the.frame.and.will.become.unusab
9b00 6c 65 2e 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 le...........///.</remarks>.....
9b20 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 53 79 73 .....///.<seealso.cref="InputSys
9b40 74 65 6d 2e 64 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 tem.devices"/>..........///.<see
9b60 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 also.cref="pairedDevices"/>.....
9b80 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 .....///.<seealso.cref="PerformP
9ba0 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 airingWithDevice"/>..........pub
9bc0 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 49 6e 70 75 lic.static.InputControlList<Inpu
9be0 74 44 65 76 69 63 65 3e 20 47 65 74 55 6e 70 61 69 72 65 64 49 6e 70 75 74 44 65 76 69 63 65 73 tDevice>.GetUnpairedInputDevices
9c00 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c ()..........{..............var.l
9c20 69 73 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 49 6e 70 75 74 ist.=.new.InputControlList<Input
9c40 44 65 76 69 63 65 3e 28 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d 70 29 3b 0d 0a 20 20 20 20 20 20 Device>(Allocator.Temp);........
9c60 20 20 20 20 20 20 47 65 74 55 6e 70 61 69 72 65 64 49 6e 70 75 74 44 65 76 69 63 65 73 28 72 65 ......GetUnpairedInputDevices(re
9c80 66 20 6c 69 73 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6c 69 73 f.list);..............return.lis
9ca0 74 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 20 3c 73 75 t;..........}............///.<su
9cc0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 61 6c 6c 20 63 75 72 72 mmary>..........///.Add.all.curr
9ce0 65 6e 74 6c 79 20 61 64 64 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 20 61 72 65 20 6e 6f 74 ently.added.devices.that.are.not
9d00 20 70 61 69 72 65 64 20 74 6f 20 61 6e 79 20 75 73 65 72 20 74 6f 20 3c 70 61 72 61 6d 72 65 66 .paired.to.any.user.to.<paramref
9d20 20 6e 61 6d 65 3d 22 6c 69 73 74 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 .name="list"/>...........///.</s
9d40 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
9d60 3d 22 6c 69 73 74 22 3e 4c 69 73 74 20 74 6f 20 61 64 64 20 74 68 65 20 64 65 76 69 63 65 73 20 ="list">List.to.add.the.devices.
9d80 74 6f 2e 20 44 65 76 69 63 65 73 20 77 69 6c 6c 20 62 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 to..Devices.will.be.added.to.the
9da0 20 65 6e 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 72 65 74 75 .end.</param>..........///.<retu
9dc0 72 6e 73 3e 4e 75 6d 62 65 72 20 6f 66 20 64 65 76 69 63 65 73 20 61 64 64 65 64 20 74 6f 20 3c rns>Number.of.devices.added.to.<
9de0 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 69 73 74 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 paramref.name="list"/>.</returns
9e00 3e 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 >..........///.<seealso.cref="In
9e20 70 75 74 53 79 73 74 65 6d 2e 64 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f putSystem.devices"/>..........//
9e40 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f /.<seealso.cref="pairedDevices"/
9e60 3e 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 50 65 >..........///.<seealso.cref="Pe
9e80 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 rformPairingWithDevice"/>.......
9ea0 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 47 65 74 55 6e 70 61 69 72 65 64 ...public.static.int.GetUnpaired
9ec0 49 6e 70 75 74 44 65 76 69 63 65 73 28 72 65 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 InputDevices(ref.InputControlLis
9ee0 74 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 6c 69 73 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d t<InputDevice>.list)..........{.
9f00 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 75 6e 74 42 65 66 6f 72 65 20 3d 20 6c .............var.countBefore.=.l
9f20 69 73 74 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 ist.Count;..............foreach.
9f40 28 76 61 72 20 64 65 76 69 63 65 20 69 6e 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 64 65 76 69 63 (var.device.in.InputSystem.devic
9f60 65 73 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 es)..............{..............
9f80 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 69 6e 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 ....//.If.it's.in.s_AllPairedDev
9fa0 69 63 65 73 2c 20 74 68 65 72 65 20 69 73 20 2a 73 6f 6d 65 2a 20 75 73 65 72 20 74 68 61 74 20 ices,.there.is.*some*.user.that.
9fc0 69 73 20 75 73 69 6e 67 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 is.using.the.device.............
9fe0 20 20 20 20 20 20 2f 2f 20 57 65 20 64 6f 6e 27 74 20 63 61 72 65 20 77 68 69 63 68 20 6f 6e 65 ......//.We.don't.care.which.one
a000 20 69 74 20 69 73 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .it.is.here...................if
a020 20 28 41 72 72 61 79 48 65 6c 70 65 72 73 2e 43 6f 6e 74 61 69 6e 73 52 65 66 65 72 65 6e 63 65 .(ArrayHelpers.ContainsReference
a040 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 (s_AllPairedDevices,.s_AllPaired
a060 44 65 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 DeviceCount,.device))...........
a080 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...........continue;............
a0a0 20 20 20 20 20 20 20 20 6c 69 73 74 2e 41 64 64 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 ........list.Add(device);.......
a0c0 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 6c .......}................return.l
a0e0 69 73 74 2e 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 ist.Count.-.countBefore;........
a100 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>....
a120 20 20 20 20 20 20 2f 2f 2f 20 46 69 6e 64 20 74 68 65 20 75 73 65 72 20 28 69 66 20 61 6e 79 29 ......///.Find.the.user.(if.any)
a140 20 74 68 61 74 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 .that.<paramref.name="device"/>.
a160 69 73 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 2e 0d 0a 20 20 20 20 20 20 20 is.currently.paired.to..........
a180 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 20 3c 70 61 .///.</summary>..........///.<pa
a1a0 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 20 69 6e 70 75 74 20 64 65 76 69 63 ram.name="device">An.input.devic
a1c0 65 2e 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 e.</param>..........///.<returns
a1e0 3e 54 68 65 20 75 73 65 72 20 74 68 61 74 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 >The.user.that.<paramref.name="d
a200 65 76 69 63 65 22 2f 3e 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 evice"/>.is.currently.paired.to.
a220 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 or.<c>null</c>.if.the.device....
a240 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 ......///.is.not.currently.paire
a260 64 20 74 6f 20 61 6e 20 75 73 65 72 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 d.to.an.user.</returns>.........
a280 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 .///.<remarks>..........///.Note
a2a0 20 74 68 61 74 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 20 6d 61 79 20 62 65 20 70 61 69 72 .that.multiple.users.may.be.pair
a2c0 65 64 20 74 6f 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 2e 20 49 66 20 74 68 61 74 20 69 ed.to.the.same.device..If.that.i
a2e0 73 20 74 68 65 20 63 61 73 65 20 66 6f 72 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 s.the.case.for.<paramref.name="d
a300 65 76 69 63 65 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 6d 65 74 68 6f evice"/>,..........///.the.metho
a320 64 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 6f 6e 65 20 6f 66 20 74 68 65 20 75 73 65 72 73 20 77 d.will.return.one.of.the.users.w
a340 69 74 68 20 6e 6f 20 67 75 61 72 61 6e 74 65 65 20 77 68 69 63 68 20 6f 6e 65 20 69 74 20 69 73 ith.no.guarantee.which.one.it.is
a360 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 54 6f 20 66 ...........///..........///.To.f
a380 69 6e 64 20 61 6c 6c 20 75 73 65 72 73 20 70 61 69 72 65 64 20 74 6f 20 61 20 64 65 76 69 63 65 ind.all.users.paired.to.a.device
a3a0 20 72 65 71 75 69 72 65 73 20 6d 61 6e 75 61 6c 6c 79 20 67 6f 69 6e 67 20 74 68 72 6f 75 67 68 .requires.manually.going.through
a3c0 20 74 68 65 20 6c 69 73 74 20 6f 66 20 75 73 65 72 73 20 61 6e 64 20 74 68 65 69 72 20 70 61 69 .the.list.of.users.and.their.pai
a3e0 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 red..........///.devices........
a400 20 20 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 ...///.</remarks>..........///.<
a420 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
a440 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e ption"><paramref.name="device"/>
a460 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 0d 0a 20 20 .is.<c>null</c>.</exception>....
a480 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 70 61 69 72 65 64 44 ......///.<seealso.cref="pairedD
a4a0 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 evices"/>..........///.<seealso.
a4c0 63 72 65 66 3d 22 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 22 2f cref="PerformPairingWithDevice"/
a4e0 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 49 6e 70 75 74 55 73 >..........public.static.InputUs
a500 65 72 3f 20 46 69 6e 64 55 73 65 72 50 61 69 72 65 64 54 6f 44 65 76 69 63 65 28 49 6e 70 75 74 er?.FindUserPairedToDevice(Input
a520 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 Device.device)..........{.......
a540 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 .......if.(device.==.null)......
a560 20 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 ............throw.new.ArgumentNu
a580 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 0d 0a llException(nameof(device));....
a5a0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 54 72 79 46 ............var.userIndex.=.TryF
a5c0 69 6e 64 55 73 65 72 49 6e 64 65 78 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 indUserIndex(device);...........
a5e0 20 20 20 69 66 20 28 75 73 65 72 49 6e 64 65 78 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 ...if.(userIndex.==.-1).........
a600 20 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 .........return.null;...........
a620 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 .....return.s_AllUsers[userIndex
a640 5d 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 75 62 6c 69 63 20 ];..........}............public.
a660 73 74 61 74 69 63 20 49 6e 70 75 74 55 73 65 72 3f 20 46 69 6e 64 55 73 65 72 42 79 41 63 63 6f static.InputUser?.FindUserByAcco
a680 75 6e 74 28 49 6e 70 75 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 70 6c 61 74 66 unt(InputUserAccountHandle.platf
a6a0 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 7b ormUserAccountHandle)..........{
a6c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 ..............if.(platformUserAc
a6e0 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 3d 20 64 65 66 61 75 6c 74 28 49 6e 70 75 74 55 73 65 72 countHandle.==.default(InputUser
a700 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 AccountHandle)).................
a720 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 45 6d .throw.new.ArgumentException("Em
a740 70 74 79 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 68 61 6e 64 6c 65 pty.platform.user.account.handle
a760 22 2c 20 6e 61 6d 65 6f 66 28 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e ",.nameof(platformUserAccountHan
a780 64 6c 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e dle));................var.userIn
a7a0 64 65 78 20 3d 20 54 72 79 46 69 6e 64 55 73 65 72 49 6e 64 65 78 28 70 6c 61 74 66 6f 72 6d 55 dex.=.TryFindUserIndex(platformU
a7c0 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 serAccountHandle);..............
a7e0 69 66 20 28 75 73 65 72 49 6e 64 65 78 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 if.(userIndex.==.-1)............
a800 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 20 20 ......return.null;..............
a820 20 20 72 65 74 75 72 6e 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 3b 0d ..return.s_AllUsers[userIndex];.
a840 0a 20 20 20 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 .........}............public.sta
a860 74 69 63 20 49 6e 70 75 74 55 73 65 72 20 43 72 65 61 74 65 55 73 65 72 57 69 74 68 6f 75 74 50 tic.InputUser.CreateUserWithoutP
a880 61 69 72 65 64 44 65 76 69 63 65 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 airedDevices()..........{.......
a8a0 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 41 64 64 55 73 65 72 28 29 .......var.userIndex.=.AddUser()
a8c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 41 6c 6c 55 73 65 72 73 ;..............return.s_AllUsers
a8e0 5b 75 73 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 [userIndex];..........}.........
a900 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 61 6c 6c 6f 77 20 72 65 2d 61 64 64 69 6e 67 20 61 ...////REVIEW:.allow.re-adding.a
a920 20 75 73 65 72 20 74 68 72 6f 75 67 68 20 74 68 69 73 20 6d 65 74 68 6f 64 3f 0d 0a 20 20 20 20 .user.through.this.method?......
a940 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 50 ....///.<summary>..........///.P
a960 61 69 72 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 74 6f 20 61 20 75 73 65 72 2e 0d air.the.given.device.to.a.user..
a980 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 20 .........///.</summary>.........
a9a0 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 .///.<param.name="device">Device
a9c0 20 74 6f 20 70 61 69 72 20 74 6f 20 61 20 75 73 65 72 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 .to.pair.to.a.user.</param>.....
a9e0 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 65 72 22 3e 4f 70 74 69 .....///.<param.name="user">Opti
aa00 6f 6e 61 6c 20 70 61 72 61 6d 65 74 65 72 2e 20 49 66 20 67 69 76 65 6e 2c 20 69 6e 73 74 65 61 onal.parameter..If.given,.instea
aa20 64 20 6f 66 20 63 72 65 61 74 69 6e 67 20 61 20 6e 65 77 20 75 73 65 72 20 74 6f 20 70 61 69 72 d.of.creating.a.new.user.to.pair
aa40 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 2c 20 74 68 65 .the.device..........///.to,.the
aa60 20 64 65 76 69 63 65 20 69 73 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 75 .device.is.paired.to.the.given.u
aa80 73 65 72 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 ser.</param>..........///.<param
aaa0 20 6e 61 6d 65 3d 22 6f 70 74 69 6f 6e 73 22 3e 4f 70 74 69 6f 6e 61 6c 20 73 65 74 20 6f 66 20 .name="options">Optional.set.of.
aac0 6f 70 74 69 6f 6e 73 20 74 6f 20 6d 6f 64 69 66 79 20 70 61 69 72 69 6e 67 20 62 65 68 61 76 69 options.to.modify.pairing.behavi
aae0 6f 72 2e 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 6d 61 72 6b or.</param>..........///.<remark
ab00 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 79 20 64 65 66 61 75 6c 74 2c 20 61 20 6e 65 s>..........///.By.default,.a.ne
ab20 77 20 75 73 65 72 20 69 73 20 63 72 65 61 74 65 64 20 61 6e 64 20 3c 70 61 72 61 6d 72 65 66 20 w.user.is.created.and.<paramref.
ab40 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 61 64 64 65 64 20 3c 73 65 65 20 63 72 name="device"/>.is.added.<see.cr
ab60 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ef="pairedDevices"/>..........//
ab80 2f 20 6f 66 20 74 68 65 20 75 73 65 72 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 /.of.the.user.and.<see.cref="Inp
aba0 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 50 61 69 72 65 64 22 2f 3e 20 69 73 20 utUserChange.DevicePaired"/>.is.
abc0 73 65 6e 74 20 6f 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 2e 0d sent.on.<see.cref="onChange"/>..
abe0 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 49 66 20 61 20 76 .........///..........///.If.a.v
ac00 61 6c 69 64 20 75 73 65 72 20 69 73 20 73 75 70 70 6c 69 65 64 20 74 6f 20 3c 70 61 72 61 6d 72 alid.user.is.supplied.to.<paramr
ac20 65 66 20 6e 61 6d 65 3d 22 75 73 65 72 22 2f 3e 2c 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 ef.name="user"/>,.the.device.is.
ac40 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 75 73 65 72 20 69 6e 73 74 65 61 64 paired.to.the.given.user.instead
ac60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 66 20 63 72 65 61 74 69 6e 67 20 61 20 6e 65 77 20 ..........///.of.creating.a.new.
ac80 75 73 65 72 2e 20 42 79 20 64 65 66 61 75 6c 74 2c 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 user..By.default,.the.device.is.
aca0 61 64 64 65 64 20 74 6f 20 74 68 65 20 6c 69 73 74 20 6f 66 20 61 6c 72 65 61 64 79 20 70 61 69 added.to.the.list.of.already.pai
acc0 72 65 64 20 64 65 76 69 63 65 73 20 66 6f 72 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 red.devices.for.the.user........
ace0 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 61 6e 20 62 65 20 63 68 61 6e 67 65 64 20 62 79 20 75 73 ...///.This.can.be.changed.by.us
ad00 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e 67 4f ing.<see.cref="InputUserPairingO
ad20 70 74 69 6f 6e 73 2e 55 6e 70 61 69 72 43 75 72 72 65 6e 74 44 65 76 69 63 65 73 46 72 6f 6d 55 ptions.UnpairCurrentDevicesFromU
ad40 73 65 72 22 2f 3e 20 77 68 69 63 68 20 63 61 75 73 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ser"/>.which.causes..........///
ad60 20 64 65 76 69 63 65 73 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 .devices.currently.paired.to.the
ad80 20 75 73 65 72 20 74 6f 20 66 69 72 73 74 20 62 65 20 75 6e 70 61 69 72 65 64 2e 0d 0a 20 20 20 .user.to.first.be.unpaired......
ada0 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 64 .....///..........///.The.method
adc0 20 77 69 6c 6c 20 6e 6f 74 20 70 72 65 76 65 6e 74 20 70 61 69 72 69 6e 67 20 6f 66 20 74 68 65 .will.not.prevent.pairing.of.the
ade0 20 73 61 6d 65 20 64 65 76 69 63 65 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 2e 0d .same.device.to.multiple.users..
ae00 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
ae20 68 61 74 20 69 66 20 74 68 65 20 75 73 65 72 20 68 61 73 20 61 6e 20 61 73 73 6f 63 69 61 74 65 hat.if.the.user.has.an.associate
ae40 64 20 73 65 74 20 6f 66 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 d.set.of.actions.(<see.cref="act
ae60 69 6f 6e 73 22 2f 3e 29 2c 20 74 68 65 20 6c 69 73 74 20 6f 66 20 64 65 76 69 63 65 73 20 6f 6e ions"/>),.the.list.of.devices.on
ae80 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 .the..........///.actions.(<see.
aea0 63 72 65 66 3d 22 49 49 6e 70 75 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 2e 64 65 76 cref="IInputActionCollection.dev
aec0 69 63 65 73 22 2f 3e 29 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 62 65 20 75 ices"/>).will.automatically.be.u
aee0 70 64 61 74 65 64 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 20 74 68 65 20 6e 65 77 6c 79 0d 0a 20 pdated.meaning.that.the.newly...
af00 20 20 20 20 20 20 20 2f 2f 2f 20 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 77 69 6c 6c 20 61 .......///.paired.devices.will.a
af20 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 72 65 66 6c 65 63 74 20 69 6e 20 74 68 65 20 73 65 74 20 utomatically.reflect.in.the.set.
af40 6f 66 20 64 65 76 69 63 65 73 20 61 76 61 69 6c 61 62 6c 65 20 74 6f 20 74 68 65 20 75 73 65 72 of.devices.available.to.the.user
af60 27 73 20 61 63 74 69 6f 6e 73 2e 20 49 66 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 's.actions..If.the..........///.
af80 75 73 65 72 20 68 61 73 20 61 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 74 68 61 74 20 69 user.has.a.control.scheme.that.i
afa0 73 20 63 75 72 72 65 6e 74 6c 79 20 61 63 74 69 76 61 74 65 64 20 28 3c 73 65 65 20 63 72 65 66 s.currently.activated.(<see.cref
afc0 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 22 2f 3e 29 2c 20 74 68 65 6e 20 3c 73 65 65 20 63 ="controlScheme"/>),.then.<see.c
afe0 72 65 66 3d 22 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 22 2f 3e 0d 0a 20 20 20 20 ref="controlSchemeMatch"/>......
b000 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 61 6c 73 6f 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 ....///.will.also.automatically.
b020 75 70 64 61 74 65 20 74 6f 20 72 65 66 6c 65 63 74 20 74 68 65 20 6d 61 74 63 68 69 6e 67 20 6f update.to.reflect.the.matching.o
b040 66 20 64 65 76 69 63 65 73 20 74 6f 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 27 f.devices.to.the.control.scheme'
b060 73 20 64 65 76 69 63 65 20 72 65 71 75 69 72 65 6d 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 s.device.requirements...........
b080 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 ///..........///.If.the.given.de
b0a0 76 69 63 65 20 69 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 20 75 73 65 72 20 61 vice.is.associated.with.a.user.a
b0c0 63 63 6f 75 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 20 28 71 75 ccount.at.the.platform.level.(qu
b0e0 65 72 69 65 64 20 74 68 72 6f 75 67 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 eried.through..........///.<see.
b100 63 72 65 66 3d 22 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d cref="QueryPairedUserAccountComm
b120 61 6e 64 22 2f 3e 29 2c 20 74 68 65 20 75 73 65 72 27 73 20 70 6c 61 74 66 6f 72 6d 20 61 63 63 and"/>),.the.user's.platform.acc
b140 6f 75 6e 74 20 64 65 74 61 69 6c 73 20 28 3c 73 65 65 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 ount.details.(<see.cref="platfor
b160 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 mUserAccountHandle"/>,..........
b180 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 ///.<see.cref="platformUserAccou
b1a0 6e 74 4e 61 6d 65 22 2f 3e 2c 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 70 6c 61 74 66 6f ntName"/>,.and.<see.cref="platfo
b1c0 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 22 2f 3e 29 20 61 72 65 20 75 70 64 61 74 65 64 20 rmUserAccountId"/>).are.updated.
b1e0 61 63 63 6f 72 64 69 6e 67 6c 79 2e 20 49 6e 20 74 68 69 73 20 63 61 73 65 2c 0d 0a 20 20 20 20 accordingly..In.this.case,......
b200 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e ....///.<see.cref="InputUserChan
b220 67 65 2e 41 63 63 6f 75 6e 74 43 68 61 6e 67 65 64 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 65 ge.AccountChanged"/>.or.<see.cre
b240 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 4e 61 6d 65 43 68 f="InputUserChange.AccountNameCh
b260 61 6e 67 65 64 22 2f 3e 20 6d 61 79 20 62 65 20 73 69 67 6e 61 6c 6c 65 64 2e 0d 0a 20 20 20 20 anged"/>.may.be.signalled.......
b280 20 20 20 20 2f 2f 2f 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 43 68 61 ....///.through.<see.cref="onCha
b2a0 6e 67 65 22 2f 3e 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 nge"/>...........///..........//
b2c0 2f 20 49 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 69 73 20 6e 6f 74 20 61 73 73 /.If.the.given.device.is.not.ass
b2e0 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 61 74 20 74 ociated.with.a.user.account.at.t
b300 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 2c 20 62 75 74 20 69 74 20 64 6f 65 73 0d 0a he.platform.level,.but.it.does..
b320 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 73 70 6f 6e 64 20 74 6f 20 3c 73 65 65 20 63 72 65 66 ........///.respond.to.<see.cref
b340 3d 22 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d ="InitiateUserAccountPairingComm
b360 61 6e 64 22 2f 3e 2c 20 74 68 65 6e 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 4e 4f 54 20 69 and"/>,.then.the.device.is.NOT.i
b380 6d 6d 65 64 69 61 74 65 6c 79 20 70 61 69 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 mmediately.paired..........///.t
b3a0 6f 20 74 68 65 20 75 73 65 72 2e 20 49 6e 73 74 65 61 64 2c 20 70 61 69 72 69 6e 67 20 69 73 20 o.the.user..Instead,.pairing.is.
b3c0 64 65 66 65 72 72 65 64 20 74 6f 20 75 6e 74 69 6c 20 61 66 74 65 72 20 61 6e 20 61 63 63 6f 75 deferred.to.until.after.an.accou
b3e0 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 6d 61 64 65 20 62 79 20 74 68 nt.selection.has.been.made.by.th
b400 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 20 74 68 69 73 20 63 61 73 e.user...........///.In.this.cas
b420 65 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 e,.<see.cref="InputUserChange.Ac
b440 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 22 2f 3e 20 77 69 6c 6c countSelectionInProgress"/>.will
b460 20 62 65 20 73 69 67 6e 61 6c 6c 65 64 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 65 66 3d .be.signalled.through.<see.cref=
b480 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 3c 73 "onChange"/>..........///.and.<s
b4a0 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 ee.cref="InputUserChange.Account
b4c0 43 68 61 6e 67 65 64 22 2f 3e 20 77 69 6c 6c 20 62 65 20 73 69 67 6e 61 6c 6c 65 64 20 6f 6e 63 Changed"/>.will.be.signalled.onc
b4e0 65 20 74 68 65 20 75 73 65 72 20 68 61 73 20 73 65 6c 65 63 74 65 64 20 61 6e 20 61 63 63 6f 75 e.the.user.has.selected.an.accou
b500 6e 74 20 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e nt.or..........///.<see.cref="In
b520 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 43 61 putUserChange.AccountSelectionCa
b540 6e 63 65 6c 65 64 22 2f 3e 20 77 69 6c 6c 20 62 65 20 73 69 67 6e 61 6c 6c 65 64 20 69 66 20 74 nceled"/>.will.be.signalled.if.t
b560 68 65 20 75 73 65 72 20 63 61 6e 63 65 6c 73 20 61 63 63 6f 75 6e 74 0d 0a 20 20 20 20 20 20 20 he.user.cancels.account.........
b580 20 2f 2f 2f 20 73 65 6c 65 63 74 69 6f 6e 2e 20 54 68 65 20 64 65 76 69 63 65 20 77 69 6c 6c 20 .///.selection..The.device.will.
b5a0 62 65 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 20 6f 6e 63 65 20 61 63 63 6f 75 be.paired.to.the.user.once.accou
b5c0 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 69 73 20 63 6f 6d 70 6c 65 74 65 2e 0d 0a 20 20 20 20 20 nt.selection.is.complete........
b5e0 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 62 65 68 61 76 69 6f ...///..........///.This.behavio
b600 72 20 69 73 20 6d 6f 73 74 20 75 73 65 66 75 6c 20 6f 6e 20 58 62 6f 78 20 61 6e 64 20 53 77 69 r.is.most.useful.on.Xbox.and.Swi
b620 74 63 68 20 74 6f 20 72 65 71 75 69 72 65 20 74 68 65 20 75 73 65 72 20 74 6f 20 63 68 6f 6f 73 tch.to.require.the.user.to.choos
b640 65 20 77 68 69 63 68 20 61 63 63 6f 75 6e 74 20 74 6f 20 70 6c 61 79 20 77 69 74 68 2e 20 4e 6f e.which.account.to.play.with..No
b660 74 65 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 66 20 74 68 65 20 64 65 76 69 te.that..........///.if.the.devi
b680 63 65 20 69 73 20 61 6c 72 65 61 64 79 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 20 ce.is.already.associated.with.a.
b6a0 75 73 65 72 20 61 63 63 6f 75 6e 74 2c 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 user.account,.account.selection.
b6c0 77 69 6c 6c 20 6e 6f 74 20 62 65 20 69 6e 69 74 69 61 74 65 64 2e 20 48 6f 77 65 76 65 72 2c 0d will.not.be.initiated..However,.
b6e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 74 20 63 61 6e 20 62 65 20 65 78 70 6c 69 63 69 74 6c .........///.it.can.be.explicitl
b700 79 20 66 6f 72 63 65 64 20 74 6f 20 62 65 20 70 65 72 66 6f 72 6d 65 64 20 62 79 20 75 73 69 6e y.forced.to.be.performed.by.usin
b720 67 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 g.<see..........///.cref="InputU
b740 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 50 6c 61 74 66 6f 72 6d 55 serPairingOptions.ForcePlatformU
b760 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 22 2f 3e 2e 20 54 68 69 73 20 69 73 20 serAccountSelection"/>..This.is.
b780 75 73 65 66 75 6c 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 6f 72 20 65 78 61 6d 70 6c 65 useful,..........///.for.example
b7a0 2c 20 74 6f 20 61 6c 6c 6f 77 20 74 68 65 20 75 73 65 72 20 74 6f 20 65 78 70 6c 69 63 69 74 6c ,.to.allow.the.user.to.explicitl
b7c0 79 20 73 77 69 74 63 68 20 61 63 63 6f 75 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d y.switch.accounts...........///.
b7e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4f 6e 20 58 62 6f 78 20 61 6e 64 20 53 77 69 74 63 68 2c .........///.On.Xbox.and.Switch,
b800 20 74 6f 20 70 65 72 6d 69 74 20 70 6c 61 79 69 6e 67 20 65 76 65 6e 20 6f 6e 20 64 65 76 69 63 .to.permit.playing.even.on.devic
b820 65 73 20 74 68 61 74 20 64 6f 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 68 61 76 65 20 61 6e es.that.do.not.currently.have.an
b840 20 61 73 73 6f 63 69 61 74 65 64 20 75 73 65 72 20 61 63 63 6f 75 6e 74 2c 0d 0a 20 20 20 20 20 .associated.user.account,.......
b860 20 20 20 2f 2f 2f 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 50 ...///.use.<see.cref="InputUserP
b880 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 4e 6f 50 6c 61 74 66 6f 72 6d 55 73 65 airingOptions.ForceNoPlatformUse
b8a0 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f rAccountSelection"/>.........../
b8c0 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4f 6e 20 50 53 34 2c 20 64 65 76 69 63 65 73 20 //..........///.On.PS4,.devices.
b8e0 77 69 6c 6c 20 61 6c 77 61 79 73 20 68 61 76 65 20 61 73 73 6f 63 69 61 74 65 64 20 75 73 65 72 will.always.have.associated.user
b900 20 61 63 63 6f 75 6e 74 73 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 20 74 68 65 20 72 65 74 75 72 .accounts.meaning.that.the.retur
b920 6e 65 64 20 49 6e 70 75 74 55 73 65 72 20 77 69 6c 6c 20 61 6c 77 61 79 73 0d 0a 20 20 20 20 20 ned.InputUser.will.always.......
b940 20 20 20 2f 2f 2f 20 68 61 76 65 20 75 70 64 61 74 65 64 20 70 6c 61 74 66 6f 72 6d 20 61 63 63 ...///.have.updated.platform.acc
b960 6f 75 6e 74 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 ount.details...........///......
b980 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 71 ....///.Note.that.user.account.q
b9a0 75 65 72 69 65 73 20 61 6e 64 20 69 6e 69 74 69 61 74 69 6e 67 20 61 63 63 6f 75 6e 74 20 73 65 ueries.and.initiating.account.se
b9c0 6c 65 63 74 69 6f 6e 20 63 61 6e 20 62 65 20 69 6e 74 65 72 63 65 70 74 65 64 20 62 79 20 74 68 lection.can.be.intercepted.by.th
b9e0 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e 20 46 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e.application..For..........///.
ba00 65 78 61 6d 70 6c 65 2c 20 6f 6e 20 53 77 69 74 63 68 20 77 68 65 72 65 20 75 73 65 72 20 61 63 example,.on.Switch.where.user.ac
ba20 63 6f 75 6e 74 20 70 61 69 72 69 6e 67 20 69 73 20 6e 6f 74 20 73 74 6f 72 65 64 20 61 74 20 74 count.pairing.is.not.stored.at.t
ba40 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 2c 20 6f 6e 65 20 63 61 6e 2c 20 66 6f 72 20 he.platform.level,.one.can,.for.
ba60 65 78 61 6d 70 6c 65 2c 20 62 6f 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6d 70 6c 65 example,.both..........///.imple
ba80 6d 65 6e 74 20 63 75 73 74 6f 6d 20 70 61 69 72 69 6e 67 20 6c 6f 67 69 63 20 61 73 20 77 65 6c ment.custom.pairing.logic.as.wel
baa0 6c 20 61 73 20 61 20 63 75 73 74 6f 6d 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 l.as.a.custom.account.selection.
bac0 55 49 20 62 79 20 69 6e 74 65 72 63 65 70 74 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 51 75 UI.by.intercepting.<see.cref="Qu
bae0 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 22 2f 3e 0d 0a eryPairedUserAccountCommand"/>..
bb00 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 ........///.and.<seealso.cref="I
bb20 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 nitiateUserAccountPairingCommand
bb40 22 2f 3e 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 3c "/>...........///..........///.<
bb60 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 20 example>..........///.<code>....
bb80 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 44 65 76 69 63 65 43 6f ......///.InputSystem.onDeviceCo
bba0 6d 6d 61 6e 64 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 64 65 76 69 63 mmand.+=..........///.....(devic
bbc0 65 2c 20 63 6f 6d 6d 61 6e 64 50 74 72 2c 20 72 75 6e 74 69 6d 65 29 20 3d 3e 0d 0a 20 20 20 20 e,.commandPtr,.runtime).=>......
bbe0 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 ....///.....{..........///......
bc00 20 20 20 2f 2f 20 44 65 61 6c 69 6e 67 20 77 69 74 68 20 49 6e 70 75 74 44 65 76 69 63 65 43 6f ...//.Dealing.with.InputDeviceCo
bc20 6d 6d 61 6e 64 73 20 72 65 71 75 69 72 65 73 20 68 61 6e 64 6c 69 6e 67 20 72 61 77 20 70 6f 69 mmands.requires.handling.raw.poi
bc40 6e 74 65 72 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 75 6e 73 61 nters...........///.........unsa
bc60 66 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 fe..........///.........{.......
bc80 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 27 72 65 20 6f 6e 6c 79 ...///.............//.We're.only
bca0 20 6c 6f 6f 6b 69 6e 67 20 66 6f 72 20 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f .looking.for.QueryPairedUserAcco
bcc0 75 6e 74 43 6f 6d 6d 61 6e 64 20 61 6e 64 20 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 untCommand.and.InitiateUserAccou
bce0 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 ntPairingCommand.here...........
bd00 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6d 6d 61 6e 64 50 74 72 2d 3e ///.............if.(commandPtr->
bd20 74 79 70 65 20 21 3d 20 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f type.!=.QueryPairedUserAccountCo
bd40 6d 6d 61 6e 64 2e 54 79 70 65 20 26 26 20 63 6f 6d 6d 61 6e 64 50 74 72 2d 3e 74 79 70 65 20 21 mmand.Type.&&.commandPtr->type.!
bd60 3d 20 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d =.InitiateUserAccountPairingComm
bd80 61 6e 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 and)..........///...............
bda0 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 20 2f 2f 20 43 6f 6d 6d 61 6e 64 20 6e 6f 74 20 68 61 ..return.null;.//.Command.not.ha
bdc0 6e 64 6c 65 64 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 ndled...........///..........///
bde0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 64 65 76 69 63 65 20 .............//.Check.if.device.
be00 69 73 20 74 68 65 20 6f 6e 65 20 79 6f 75 72 20 69 6e 74 65 72 65 73 74 65 64 20 69 6e 2e 20 41 is.the.one.your.interested.in..A
be20 73 20 61 6e 20 65 78 61 6d 70 6c 65 2c 20 77 65 20 6c 6f 6f 6b 20 66 6f 72 20 53 77 69 74 63 68 s.an.example,.we.look.for.Switch
be40 20 67 61 6d 65 70 61 64 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 .gamepads..........///..........
be60 20 20 20 2f 2f 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 ...//.here...........///........
be80 20 20 20 20 20 69 66 20 28 21 28 64 65 76 69 63 65 20 69 73 20 4e 70 61 64 29 29 0d 0a 20 20 20 .....if.(!(device.is.Npad)).....
bea0 20 20 20 20 20 2f 2f 2f 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.
bec0 6e 75 6c 6c 3b 20 2f 2f 20 43 6f 6d 6d 61 6e 64 20 6e 6f 74 20 68 61 6e 64 6c 65 64 2e 0d 0a 20 null;.//.Command.not.handled....
bee0 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .......///..........///.........
bf00 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 61 20 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 ....//.If.it's.a.QueryPairedUser
bf20 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2c 20 73 65 65 20 69 66 20 77 65 20 68 61 76 65 20 61 AccountCommand,.see.if.we.have.a
bf40 20 75 73 65 72 20 49 44 20 74 6f 20 75 73 65 20 77 69 74 68 20 74 68 65 20 4e 70 61 64 0d 0a 20 .user.ID.to.use.with.the.Npad...
bf60 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 61 73 65 64 20 .......///.............//.based.
bf80 6f 6e 20 6c 61 73 74 20 74 69 6d 65 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 72 61 6e on.last.time.the.application.ran
bfa0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 ...........///.............if.(c
bfc0 6f 6d 6d 61 6e 64 50 74 72 2d 3e 74 79 70 65 20 3d 3d 20 51 75 65 72 79 50 61 69 72 65 64 55 73 ommandPtr->type.==.QueryPairedUs
bfe0 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 54 79 70 65 29 0d 0a 20 20 20 20 20 20 20 20 erAccountCommand.Type)..........
c000 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ///.............{..........///..
c020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 0d 0a 20 20 20 20 20 20 20 ...............////TODO.........
c040 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 .///.........}..........///.....
c060 7d 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 20 20 20 20 20 20 };..........///.</code>.........
c080 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 2f 2f 20 3c 2f 72 .///.</example>..........///.</r
c0a0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a emarks>..........///.<example>..
c0c0 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 2f 20 ........///.<code>..........///.
c0e0 2f 2f 20 50 61 69 72 20 64 65 76 69 63 65 20 74 6f 20 6e 65 77 20 75 73 65 72 2e 0d 0a 20 20 20 //.Pair.device.to.new.user......
c100 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 75 73 65 72 20 3d 20 49 6e 70 75 74 55 73 65 72 2e 50 65 .....///.var.user.=.InputUser.Pe
c120 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 28 77 61 6e 64 31 29 3b 0d 0a rformPairingWithDevice(wand1);..
c140 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 20 50 61 69 72 ........///..........///.//.Pair
c160 20 61 6e 6f 74 68 65 72 20 64 65 76 69 63 65 20 74 6f 20 74 68 65 20 73 61 6d 65 20 75 73 65 72 .another.device.to.the.same.user
c180 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 55 73 65 72 2e 50 65 72 66 6f 72 6d ...........///.InputUser.Perform
c1a0 50 61 69 72 69 6e 67 57 69 74 68 44 65 76 69 63 65 28 77 61 6e 64 32 2c 20 75 73 65 72 3a 20 75 PairingWithDevice(wand2,.user:.u
c1c0 73 65 72 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 20 20 20 ser);..........///.</code>......
c1e0 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 2f 2f 20 ....///.</example>..........///.
c200 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 0d <seealso.cref="pairedDevices"/>.
c220 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 55 6e 70 61 .........///.<seealso.cref="Unpa
c240 69 72 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 irDevice"/>..........///.<seeals
c260 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 o.cref="UnpairDevices"/>........
c280 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 6e 70 61 69 72 44 65 76 69 63 ..///.<seealso.cref="UnpairDevic
c2a0 65 73 41 6e 64 52 65 6d 6f 76 65 55 73 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 esAndRemoveUser"/>..........///.
c2c0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 <seealso.cref="InputUserChange.D
c2e0 65 76 69 63 65 50 61 69 72 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 evicePaired"/>..........public.s
c300 74 61 74 69 63 20 49 6e 70 75 74 55 73 65 72 20 50 65 72 66 6f 72 6d 50 61 69 72 69 6e 67 57 69 tatic.InputUser.PerformPairingWi
c320 74 68 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 0d 0a 20 20 thDevice(InputDevice.device,....
c340 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 55 73 65 72 20 75 73 65 72 20 3d 20 64 65 66 61 75 ..........InputUser.user.=.defau
c360 6c 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e lt,..............InputUserPairin
c380 67 4f 70 74 69 6f 6e 73 20 6f 70 74 69 6f 6e 73 20 3d 20 49 6e 70 75 74 55 73 65 72 50 61 69 72 gOptions.options.=.InputUserPair
c3a0 69 6e 67 4f 70 74 69 6f 6e 73 2e 4e 6f 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ingOptions.None)..........{.....
c3c0 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 .........if.(device.==.null)....
c3e0 20 20 20 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 ..............throw.new.Argument
c400 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a NullException(nameof(device));..
c420 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 65 72 20 21 3d 20 64 65 66 61 75 6c 74 20 ............if.(user.!=.default.
c440 26 26 20 21 75 73 65 72 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &&.!user.valid).................
c460 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 49 6e .throw.new.ArgumentException("In
c480 76 61 6c 69 64 20 75 73 65 72 22 2c 20 6e 61 6d 65 6f 66 28 75 73 65 72 29 29 3b 0d 0a 0d 0a 20 valid.user",.nameof(user));.....
c4a0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 6e 65 77 20 75 73 65 72 2c 20 69 ...........//.Create.new.user,.i
c4c0 66 20 6e 65 65 64 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 75 73 65 72 49 f.needed...............int.userI
c4e0 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 65 72 20 3d 3d 20 64 ndex;..............if.(user.==.d
c500 65 66 61 75 6c 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 20 20 efault)..............{..........
c520 20 20 20 20 20 20 20 20 75 73 65 72 49 6e 64 65 78 20 3d 20 41 64 64 55 73 65 72 28 29 3b 0d 0a ........userIndex.=.AddUser();..
c540 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d ............}..............else.
c560 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 .............{..................
c580 2f 2f 20 57 65 20 68 61 76 65 20 61 6e 20 65 78 69 73 74 69 6e 67 20 75 73 65 72 2e 0d 0a 20 20 //.We.have.an.existing.user.....
c5a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 49 6e 64 65 78 20 3d 20 75 73 65 72 2e 69 ..............userIndex.=.user.i
c5c0 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 ndex;....................//.See.
c5e0 69 66 20 77 65 27 72 65 20 73 75 70 70 6f 73 65 64 20 74 6f 20 63 6c 65 61 72 20 6f 75 74 20 74 if.we're.supposed.to.clear.out.t
c600 68 65 20 75 73 65 72 27 73 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 64 65 76 69 63 he.user's.currently.paired.devic
c620 65 73 20 66 69 72 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 es.first...................if.((
c640 6f 70 74 69 6f 6e 73 20 26 20 49 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e options.&.InputUserPairingOption
c660 73 2e 55 6e 70 61 69 72 43 75 72 72 65 6e 74 44 65 76 69 63 65 73 46 72 6f 6d 55 73 65 72 29 20 s.UnpairCurrentDevicesFromUser).
c680 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 75 73 65 72 2e !=.0)......................user.
c6a0 55 6e 70 61 69 72 44 65 76 69 63 65 73 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 UnpairDevices();................
c6c0 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 63 61 6c 6c 20 69 66 20 64 65 76 69 63 65 20 69 73 20 ....//.Ignore.call.if.device.is.
c6e0 61 6c 72 65 61 64 79 20 70 61 69 72 65 64 20 74 6f 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 already.paired.to.user..........
c700 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 65 72 2e 70 61 69 72 65 64 44 65 76 69 63 65 73 2e .........if.(user.pairedDevices.
c720 43 6f 6e 74 61 69 6e 73 52 65 66 65 72 65 6e 63 65 28 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 ContainsReference(device))......
c740 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 ............{...................
c760 20 20 20 2f 2f 20 53 74 69 6c 6c 20 6d 69 67 68 74 20 68 61 76 65 20 74 6f 20 69 6e 69 74 69 61 ...//.Still.might.have.to.initia
c780 74 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 te.user.account.selection.......
c7a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 6f 70 74 69 6f 6e 73 20 26 20 49 ................if.((options.&.I
c7c0 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 50 6c 61 74 nputUserPairingOptions.ForcePlat
c7e0 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 29 20 21 3d 20 30 29 0d formUserAccountSelection).!=.0).
c800 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 49 6e 69 74 69 61 74 .........................Initiat
c820 65 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 28 75 73 65 72 49 6e 64 65 78 2c eUserAccountSelection(userIndex,
c840 20 64 65 76 69 63 65 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 .device,.options);..............
c860 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 75 73 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ........return.user;............
c880 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 20 20 ......}..............}..........
c8a0 20 20 20 20 20 20 2f 2f 20 48 61 6e 64 6c 65 20 74 68 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 ......//.Handle.the.user.account
c8c0 20 73 69 64 65 20 6f 66 20 70 61 69 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 .side.of.pairing...............v
c8e0 61 72 20 61 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 20 3d 20 ar.accountSelectionInProgress.=.
c900 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 28 75 73 65 InitiateUserAccountSelection(use
c920 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 2c 20 6f 70 74 69 6f 6e 73 29 3b 0d 0a 0d 0a 20 20 20 rIndex,.device,.options);.......
c940 20 20 20 20 20 20 20 20 20 2f 2f 20 45 78 63 65 70 74 20 69 66 20 77 65 20 68 61 76 65 20 69 6e .........//.Except.if.we.have.in
c960 69 74 69 61 74 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 2c 20 70 itiate.user.account.selection,.p
c980 61 69 72 20 74 68 65 20 64 65 76 69 63 65 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f air.the.device.to............../
c9a0 2f 20 74 6f 20 74 68 65 20 75 73 65 72 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 /.to.the.user.now...............
c9c0 69 66 20 28 21 61 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 29 if.(!accountSelectionInProgress)
c9e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 64 64 44 65 76 69 63 65 54 6f 55 73 65 ..................AddDeviceToUse
ca00 72 28 75 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 r(userIndex,.device);...........
ca20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 .....return.s_AllUsers[userIndex
ca40 5d 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 ];..........}............private
ca60 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 .static.bool.InitiateUserAccount
ca80 53 65 6c 65 63 74 69 6f 6e 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 44 65 Selection(int.userIndex,.InputDe
caa0 76 69 63 65 20 64 65 76 69 63 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 55 vice.device,..............InputU
cac0 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 20 6f 70 74 69 6f 6e 73 29 0d 0a 20 20 20 20 serPairingOptions.options)......
cae0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 74 68 65 ....{..............//.See.if.the
cb00 72 65 27 73 20 61 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 77 65 20 re's.a.platform.user.account.we.
cb20 63 61 6e 20 67 65 74 20 66 72 6f 6d 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 can.get.from.the.device.........
cb40 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 57 65 20 64 6f 6e 27 74 20 71 75 65 72 79 20 74 68 ......//.NOTE:.We.don't.query.th
cb60 65 20 63 75 72 72 65 6e 74 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 69 66 20 74 68 65 20 63 61 e.current.user.account.if.the.ca
cb80 6c 6c 65 72 20 68 61 73 20 6f 70 74 65 64 20 74 6f 20 66 6f 72 63 65 20 61 63 63 6f 75 6e 74 20 ller.has.opted.to.force.account.
cba0 73 65 6c 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 71 75 65 72 selection...............var.quer
cbc0 79 55 73 65 72 41 63 63 6f 75 6e 74 52 65 73 75 6c 74 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 yUserAccountResult.=............
cbe0 20 20 20 20 20 20 28 6f 70 74 69 6f 6e 73 20 26 20 49 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e ......(options.&.InputUserPairin
cc00 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e gOptions.ForcePlatformUserAccoun
cc20 74 53 65 6c 65 63 74 69 6f 6e 29 20 3d 3d 20 30 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tSelection).==.0................
cc40 20 20 3f 20 55 70 64 61 74 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 28 75 73 ..?.UpdatePlatformUserAccount(us
cc60 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 erIndex,.device)................
cc80 20 20 3a 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 ..:.0;................////REVIEW
cca0 3a 20 77 68 61 74 20 73 68 6f 75 6c 64 20 77 65 20 64 6f 20 69 66 20 74 68 65 72 65 20 61 6c 72 :.what.should.we.do.if.there.alr
ccc0 65 61 64 79 20 69 73 20 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 20 eady.is.an.account.selection.in.
cce0 70 72 6f 67 72 65 73 73 3f 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 progress?.InvalidOperationExcept
cd00 69 6f 6e 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 64 65 76 69 ion?..............//.If.the.devi
cd20 63 65 20 73 75 70 70 6f 72 74 73 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 ce.supports.user.account.selecti
cd40 6f 6e 20 62 75 74 20 77 65 20 64 69 64 6e 27 74 20 67 65 74 20 6f 6e 65 2c 0d 0a 20 20 20 20 20 on.but.we.didn't.get.one,.......
cd60 20 20 20 20 20 20 20 2f 2f 20 74 72 79 20 74 6f 20 69 6e 69 74 69 61 74 65 20 61 63 63 6f 75 6e .......//.try.to.initiate.accoun
cd80 74 20 73 65 6c 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 6f t.selection...............if.((o
cda0 70 74 69 6f 6e 73 20 26 20 49 6e 70 75 74 55 73 65 72 50 61 69 72 69 6e 67 4f 70 74 69 6f 6e 73 ptions.&.InputUserPairingOptions
cdc0 2e 46 6f 72 63 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 .ForcePlatformUserAccountSelecti
cde0 6f 6e 29 20 21 3d 20 30 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 71 75 on).!=.0.||..................(qu
ce00 65 72 79 55 73 65 72 41 63 63 6f 75 6e 74 52 65 73 75 6c 74 20 21 3d 20 49 6e 70 75 74 44 65 76 eryUserAccountResult.!=.InputDev
ce20 69 63 65 43 6f 6d 6d 61 6e 64 2e 47 65 6e 65 72 69 63 46 61 69 6c 75 72 65 20 26 26 0d 0a 20 20 iceCommand.GenericFailure.&&....
ce40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 71 75 65 72 79 55 73 65 72 41 63 63 6f 75 6e 74 ...............(queryUserAccount
ce60 52 65 73 75 6c 74 20 26 20 28 6c 6f 6e 67 29 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 Result.&.(long)QueryPairedUserAc
ce80 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 52 65 73 75 6c 74 2e 44 65 76 69 63 65 50 61 69 72 65 64 countCommand.Result.DevicePaired
cea0 54 6f 55 73 65 72 41 63 63 6f 75 6e 74 29 20 3d 3d 20 30 20 26 26 0d 0a 20 20 20 20 20 20 20 20 ToUserAccount).==.0.&&..........
cec0 20 20 20 20 20 20 20 20 20 28 6f 70 74 69 6f 6e 73 20 26 20 49 6e 70 75 74 55 73 65 72 50 61 69 .........(options.&.InputUserPai
cee0 72 69 6e 67 4f 70 74 69 6f 6e 73 2e 46 6f 72 63 65 4e 6f 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 ringOptions.ForceNoPlatformUserA
cf00 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 29 20 3d 3d 20 30 29 29 0d 0a 20 20 20 20 20 20 20 ccountSelection).==.0)).........
cf20 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 28 49 6e 69 74 .....{..................if.(Init
cf40 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 41 74 50 6c 61 74 66 6f iateUserAccountSelectionAtPlatfo
cf60 72 6d 4c 65 76 65 6c 28 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rmLevel(device))................
cf80 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 73 5f 41 6c 6c 55 73 ..{......................s_AllUs
cfa0 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 66 6c 61 67 73 20 7c 3d 20 55 73 65 72 46 erData[userIndex].flags.|=.UserF
cfc0 6c 61 67 73 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 lags.UserAccountSelectionInProgr
cfe0 65 73 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 67 6f ess;......................s_Ongo
d000 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 2e 41 70 70 65 6e 64 28 0d 0a 20 20 ingAccountSelections.Append(....
d020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 4f 6e 67 6f 69 6e ......................new.Ongoin
d040 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 gAccountSelection...............
d060 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 ...........{....................
d080 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 20 3d 20 64 65 76 69 63 65 2c 0d 0a 20 20 20 20 ..........device.=.device,......
d0a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 49 64 20 3d ........................userId.=
d0c0 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 69 64 2c 0d 0a 20 20 20 20 .s_AllUsers[userIndex].id,......
d0e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 29 3b 0d 0a 0d 0a 20 20 20 20 20 ....................});.........
d100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 72 ...............//.Make.sure.we.r
d120 65 63 65 69 76 65 20 61 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 63 6f eceive.a.notification.for.the.co
d140 6e 66 69 67 75 72 61 74 69 6f 6e 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nfiguration.event...............
d160 20 20 20 20 20 20 20 20 48 6f 6f 6b 49 6e 74 6f 44 65 76 69 63 65 43 68 61 6e 67 65 28 29 3b 0d ........HookIntoDeviceChange();.
d180 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 54 65 6c 6c 20 6c .......................//.Tell.l
d1a0 69 73 74 65 6e 65 72 73 20 74 68 61 74 20 77 65 20 73 74 61 72 74 65 64 20 61 6e 20 61 63 63 6f isteners.that.we.started.an.acco
d1c0 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 unt.selection...................
d1e0 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 ....Notify(userIndex,.InputUserC
d200 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 hange.AccountSelectionInProgress
d220 2c 20 64 65 76 69 63 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.device);......................
d240 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..return.true;..................
d260 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 20 20 }..............}................
d280 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 20 20 return.false;..........}........
d2a0 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 45 71 75 61 6c 73 28 49 6e 70 75 74 55 73 65 72 ....public.bool.Equals(InputUser
d2c0 20 6f 74 68 65 72 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 .other)..........{..............
d2e0 72 65 74 75 72 6e 20 6d 5f 49 64 20 3d 3d 20 6f 74 68 65 72 2e 6d 5f 49 64 3b 0d 0a 20 20 20 20 return.m_Id.==.other.m_Id;......
d300 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 ....}............public.override
d320 20 62 6f 6f 6c 20 45 71 75 61 6c 73 28 6f 62 6a 65 63 74 20 6f 62 6a 29 0d 0a 20 20 20 20 20 20 .bool.Equals(object.obj)........
d340 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 52 65 66 65 72 65 6e 63 65 45 71 ..{..............if.(ReferenceEq
d360 75 61 6c 73 28 6e 75 6c 6c 2c 20 6f 62 6a 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 uals(null,.obj))................
d380 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 20 72 65 74 ..return.false;..............ret
d3a0 75 72 6e 20 6f 62 6a 20 69 73 20 49 6e 70 75 74 55 73 65 72 20 26 26 20 45 71 75 61 6c 73 28 28 urn.obj.is.InputUser.&&.Equals((
d3c0 49 6e 70 75 74 55 73 65 72 29 6f 62 6a 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 InputUser)obj);..........}......
d3e0 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 69 6e 74 20 47 65 74 48 61 73 ......public.override.int.GetHas
d400 68 43 6f 64 65 28 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 hCode()..........{..............
d420 72 65 74 75 72 6e 20 28 69 6e 74 29 6d 5f 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a return.(int)m_Id;..........}....
d440 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 6f 70 65 72 61 ........public.static.bool.opera
d460 74 6f 72 3d 3d 28 49 6e 70 75 74 55 73 65 72 20 6c 65 66 74 2c 20 49 6e 70 75 74 55 73 65 72 20 tor==(InputUser.left,.InputUser.
d480 72 69 67 68 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 20 20 72 right)..........{..............r
d4a0 65 74 75 72 6e 20 6c 65 66 74 2e 6d 5f 49 64 20 3d 3d 20 72 69 67 68 74 2e 6d 5f 49 64 3b 0d 0a eturn.left.m_Id.==.right.m_Id;..
d4c0 20 20 20 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 ........}............public.stat
d4e0 69 63 20 62 6f 6f 6c 20 6f 70 65 72 61 74 6f 72 21 3d 28 49 6e 70 75 74 55 73 65 72 20 6c 65 66 ic.bool.operator!=(InputUser.lef
d500 74 2c 20 49 6e 70 75 74 55 73 65 72 20 72 69 67 68 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a t,.InputUser.right)..........{..
d520 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6c 65 66 74 2e 6d 5f 49 64 20 21 3d 20 ............return.left.m_Id.!=.
d540 72 69 67 68 74 2e 6d 5f 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 right.m_Id;..........}..........
d560 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 41 64 64 ..///.<summary>..........///.Add
d580 20 61 20 6e 65 77 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d .a.new.user...........///.</summ
d5a0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 49 6e 64 65 78 ary>..........///.<returns>Index
d5c0 20 6f 66 20 74 68 65 20 6e 65 77 6c 79 20 63 72 65 61 74 65 64 20 75 73 65 72 2e 3c 2f 72 65 74 .of.the.newly.created.user.</ret
d5e0 75 72 6e 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 urns>..........///.<remarks>....
d600 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 69 6e 67 20 61 20 75 73 65 72 20 73 65 6e 64 73 20 61 20 ......///.Adding.a.user.sends.a.
d620 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 notification.with.<see.cref="Inp
d640 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 64 64 65 64 22 2f 3e 20 74 68 72 6f 75 67 68 20 3c 73 utUserChange.Added"/>.through.<s
d660 65 65 20 63 72 65 66 3d 22 6f 6e 43 68 61 6e 67 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f ee.cref="onChange"/>.........../
d680 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 75 73 65 72 20 77 69 6c 6c 20 73 74 //..........///.The.user.will.st
d6a0 61 72 74 20 6f 75 74 20 77 69 74 68 20 6e 6f 20 64 65 76 69 63 65 73 20 61 6e 64 20 6e 6f 20 61 art.out.with.no.devices.and.no.a
d6c0 63 74 69 6f 6e 73 20 61 73 73 69 67 6e 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 ctions.assigned...........///...
d6e0 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 75 73 65 72 20 69 73 20 61 64 64 65 64 20 74 6f 20 .......///.The.user.is.added.to.
d700 3c 73 65 65 20 63 72 65 66 3d 22 61 6c 6c 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 <see.cref="all"/>...........///.
d720 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 </remarks>..........private.stat
d740 69 63 20 69 6e 74 20 41 64 64 55 73 65 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ic.int.AddUser()..........{.....
d760 20 20 20 20 20 20 20 20 20 76 61 72 20 69 64 20 3d 20 2b 2b 73 5f 4c 61 73 74 55 73 65 72 49 64 .........var.id.=.++s_LastUserId
d780 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 74 6f 20 6c 69 73 74 2e ;................//.Add.to.list.
d7a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 43 6f 75 6e 74 20 3d 20 73 5f ..............var.userCount.=.s_
d7c0 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 AllUserCount;..............Array
d7e0 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 Helpers.AppendWithCapacity(ref.s
d800 5f 41 6c 6c 55 73 65 72 73 2c 20 72 65 66 20 75 73 65 72 43 6f 75 6e 74 2c 20 6e 65 77 20 49 6e _AllUsers,.ref.userCount,.new.In
d820 70 75 74 55 73 65 72 20 7b 6d 5f 49 64 20 3d 20 69 64 7d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 putUser.{m_Id.=.id});...........
d840 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e ...var.userIndex.=.ArrayHelpers.
d860 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 5f 41 6c 6c 55 73 65 72 AppendWithCapacity(ref.s_AllUser
d880 44 61 74 61 2c 20 72 65 66 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 2c 20 6e 65 77 20 55 73 Data,.ref.s_AllUserCount,.new.Us
d8a0 65 72 44 61 74 61 28 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 6e erData());................//.Sen
d8c0 64 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 d.notification...............Not
d8e0 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 ify(userIndex,.InputUserChange.A
d900 64 64 65 64 2c 20 6e 75 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 dded,.null);................retu
d920 72 6e 20 75 73 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 rn.userIndex;..........}........
d940 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 52 ....///.<summary>..........///.R
d960 65 6d 6f 76 65 20 61 6e 20 61 63 74 69 76 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f emove.an.active.user.........../
d980 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 20 3c 70 61 72 61 //.</summary>..........///.<para
d9a0 6d 20 6e 61 6d 65 3d 22 75 73 65 72 49 6e 64 65 78 22 3e 49 6e 64 65 78 20 6f 66 20 61 63 74 69 m.name="userIndex">Index.of.acti
d9c0 76 65 20 75 73 65 72 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 ve.user.</param>..........///.<r
d9e0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 69 6e 67 20 61 20 emarks>..........///.Removing.a.
da00 75 73 65 72 20 61 6c 73 6f 20 75 6e 61 73 73 69 67 6e 73 20 61 6c 6c 20 63 75 72 72 65 6e 74 6c user.also.unassigns.all.currentl
da20 79 20 61 73 73 69 67 6e 65 64 20 64 65 76 69 63 65 73 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 y.assigned.devices.from.the.user
da40 2e 20 4f 6e 20 63 6f 6d 70 6c 65 74 69 6f 6e 20 6f 66 20 74 68 69 73 0d 0a 20 20 20 20 20 20 20 ..On.completion.of.this.........
da60 20 2f 2f 2f 20 6d 65 74 68 6f 64 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 .///.method,.<see.cref="pairedDe
da80 76 69 63 65 73 22 2f 3e 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 65 72 vices"/>.of.<paramref.name="user
daa0 22 2f 3e 20 77 69 6c 6c 20 62 65 20 65 6d 70 74 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 "/>.will.be.empty...........///.
dac0 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 </remarks>..........private.stat
dae0 69 63 20 76 6f 69 64 20 52 65 6d 6f 76 65 55 73 65 72 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 ic.void.RemoveUser(int.userIndex
db00 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e )..........{..............Debug.
db20 41 73 73 65 72 74 28 75 73 65 72 49 6e 64 65 78 20 3e 3d 20 30 20 26 26 20 75 73 65 72 49 6e 64 Assert(userIndex.>=.0.&&.userInd
db40 65 78 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ex.<.s_AllUserCount);...........
db60 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 ...Debug.Assert(s_AllUserData[us
db80 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 20 3d 3d 20 30 2c 20 22 55 73 65 72 erIndex].deviceCount.==.0,."User
dba0 20 6d 75 73 74 20 6e 6f 74 20 68 61 76 65 20 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 73 74 .must.not.have.paired.devices.st
dbc0 69 6c 6c 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 65 74 20 64 ill");................//.Reset.d
dbe0 61 74 61 20 66 72 6f 6d 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 2e 0d 0a 20 20 20 20 20 20 ata.from.control.scheme.........
dc00 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 ......if.(s_AllUserData[userInde
dc20 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 x].controlScheme.!=.null).......
dc40 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 28 73 5f .......{..................if.(s_
dc60 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 20 21 AllUserData[userIndex].actions.!
dc80 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 =.null)......................s_A
dca0 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 2e 62 69 llUserData[userIndex].actions.bi
dcc0 6e 64 69 6e 67 4d 61 73 6b 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ndingMask.=.null;..............}
dce0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 ..............s_AllUserData[user
dd00 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 2e 44 69 73 70 6f 73 Index].controlSchemeMatch.Dispos
dd20 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 6f 76 65 20 6c 6f e();................//.Remove.lo
dd40 73 74 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 6f 73 st.devices...............var.los
dd60 74 44 65 76 69 63 65 43 6f 75 6e 74 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 tDeviceCount.=.s_AllUserData[use
dd80 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 rIndex].lostDeviceCount;........
dda0 20 20 20 20 20 20 69 66 20 28 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 20 3e 20 30 29 0d 0a ......if.(lostDeviceCount.>.0)..
ddc0 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 41 ............{..................A
dde0 72 72 61 79 48 65 6c 70 65 72 73 2e 45 72 61 73 65 53 6c 69 63 65 57 69 74 68 43 61 70 61 63 69 rrayHelpers.EraseSliceWithCapaci
de00 74 79 28 72 65 66 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 ty(ref.s_AllLostDevices,.ref.s_A
de20 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 llLostDeviceCount,..............
de40 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d ........s_AllUserData[userIndex]
de60 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 2c 20 6c 6f 73 74 44 65 76 69 63 .lostDeviceStartIndex,.lostDevic
de80 65 43 6f 75 6e 74 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 eCount);..............}.........
dea0 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 6f 76 65 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 .......//.Remove.account.selecti
dec0 6f 6e 73 20 74 68 61 74 20 61 72 65 20 69 6e 20 70 72 6f 67 72 65 73 73 2e 0d 0a 20 20 20 20 20 ons.that.are.in.progress........
dee0 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 73 5f 4f 6e 67 .......for.(var.i.=.0;.i.<.s_Ong
df00 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 2e 6c 65 6e 67 74 68 3b 20 2b 2b oingAccountSelections.length;.++
df20 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 i)..............{...............
df40 20 20 20 69 66 20 28 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e ...if.(s_OngoingAccountSelection
df60 73 5b 69 5d 2e 75 73 65 72 49 64 20 21 3d 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e s[i].userId.!=.s_AllUsers[userIn
df80 64 65 78 5d 2e 69 64 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 dex].id)......................co
dfa0 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 67 ntinue;....................s_Ong
dfc0 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 2e 52 65 6d 6f 76 65 41 74 42 79 oingAccountSelections.RemoveAtBy
dfe0 4d 6f 76 69 6e 67 54 61 69 6c 57 69 74 68 43 61 70 61 63 69 74 79 28 69 29 3b 0d 0a 20 20 20 20 MovingTailWithCapacity(i);......
e000 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ............--i;..............}.
e020 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 6e 64 20 6e 6f 74 69 66 69 63 61 74 ...............//.Send.notificat
e040 69 6f 6e 20 28 64 6f 20 62 65 66 6f 72 65 20 77 65 20 61 63 74 75 61 6c 6c 79 20 72 65 6d 6f 76 ion.(do.before.we.actually.remov
e060 65 20 74 68 65 20 75 73 65 72 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 e.the.user)...............Notify
e080 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 52 65 6d 6f (userIndex,.InputUserChange.Remo
e0a0 76 65 64 2c 20 6e 75 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 ved,.null);................//.Re
e0c0 6d 6f 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 43 6f 75 6e 74 move...............var.userCount
e0e0 20 3d 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .=.s_AllUserCount;..............
e100 41 72 72 61 79 48 65 6c 70 65 72 73 2e 45 72 61 73 65 41 74 57 69 74 68 43 61 70 61 63 69 74 79 ArrayHelpers.EraseAtWithCapacity
e120 28 73 5f 41 6c 6c 55 73 65 72 73 2c 20 72 65 66 20 75 73 65 72 43 6f 75 6e 74 2c 20 75 73 65 72 (s_AllUsers,.ref.userCount,.user
e140 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 Index);..............ArrayHelper
e160 73 2e 45 72 61 73 65 41 74 57 69 74 68 43 61 70 61 63 69 74 79 28 73 5f 41 6c 6c 55 73 65 72 44 s.EraseAtWithCapacity(s_AllUserD
e180 61 74 61 2c 20 72 65 66 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 2c 20 75 73 65 72 49 6e 64 ata,.ref.s_AllUserCount,.userInd
e1a0 65 78 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d 6f 76 65 20 6f 75 ex);................//.Remove.ou
e1c0 72 20 68 6f 6f 6b 20 69 66 20 77 65 20 6e 6f 20 6c 6f 6e 67 65 72 20 6e 65 65 64 20 69 74 2e 0d r.hook.if.we.no.longer.need.it..
e1e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 20 .............if.(s_AllUserCount.
e200 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ==.0)..............{............
e220 20 20 20 20 20 20 55 6e 68 6f 6f 6b 46 72 6f 6d 44 65 76 69 63 65 43 68 61 6e 67 65 28 29 3b 0d ......UnhookFromDeviceChange();.
e240 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 68 6f 6f 6b 46 72 6f 6d 41 63 74 69 6f .................UnhookFromActio
e260 6e 43 68 61 6e 67 65 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 nChange();..............}.......
e280 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 ...}............private.static.v
e2a0 6f 69 64 20 4e 6f 74 69 66 79 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 oid.Notify(int.userIndex,.InputU
e2c0 73 65 72 43 68 61 6e 67 65 20 63 68 61 6e 67 65 2c 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 serChange.change,.InputDevice.de
e2e0 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 vice)..........{..............De
e300 62 75 67 2e 41 73 73 65 72 74 28 75 73 65 72 49 6e 64 65 78 20 3e 3d 20 30 20 26 26 20 75 73 65 bug.Assert(userIndex.>=.0.&&.use
e320 72 49 6e 64 65 78 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 29 3b 0d 0a 0d 0a 20 20 20 rIndex.<.s_AllUserCount);.......
e340 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 73 5f 4f .........for.(var.i.=.0;.i.<.s_O
e360 6e 43 68 61 6e 67 65 2e 6c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 nChange.length;.++i)............
e380 20 20 20 20 20 20 73 5f 4f 6e 43 68 61 6e 67 65 5b 69 5d 28 73 5f 41 6c 6c 55 73 65 72 73 5b 75 ......s_OnChange[i](s_AllUsers[u
e3a0 73 65 72 49 6e 64 65 78 5d 2c 20 63 68 61 6e 67 65 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 serIndex],.change,.device);.....
e3c0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 .....}............private.static
e3e0 20 69 6e 74 20 54 72 79 46 69 6e 64 55 73 65 72 49 6e 64 65 78 28 75 69 6e 74 20 75 73 65 72 49 .int.TryFindUserIndex(uint.userI
e400 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 d)..........{..............Debug
e420 2e 41 73 73 65 72 74 28 75 73 65 72 49 64 20 21 3d 20 49 6e 76 61 6c 69 64 49 64 29 3b 0d 0a 0d .Assert(userId.!=.InvalidId);...
e440 0a 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 3c .............for.(var.i.=.0;.i.<
e460 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 .s_AllUserCount;.++i)...........
e480 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 28 73 5f 41 6c 6c 55 ...{..................if.(s_AllU
e4a0 73 65 72 73 5b 69 5d 2e 6d 5f 49 64 20 3d 3d 20 75 73 65 72 49 64 29 0d 0a 20 20 20 20 20 20 20 sers[i].m_Id.==.userId).........
e4c0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 .............return.i;..........
e4e0 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 ....}..............return.-1;...
e500 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 .......}............private.stat
e520 69 63 20 69 6e 74 20 54 72 79 46 69 6e 64 55 73 65 72 49 6e 64 65 78 28 49 6e 70 75 74 55 73 65 ic.int.TryFindUserIndex(InputUse
e540 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 70 6c 61 74 66 6f 72 6d 48 61 6e 64 6c 65 29 0d 0a rAccountHandle.platformHandle)..
e560 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 ........{..............Debug.Ass
e580 65 72 74 28 70 6c 61 74 66 6f 72 6d 48 61 6e 64 6c 65 20 21 3d 20 6e 65 77 20 49 6e 70 75 74 55 ert(platformHandle.!=.new.InputU
e5a0 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 28 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 serAccountHandle());............
e5c0 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 5f 41 6c 6c 55 73 65 ....for.(var.i.=.0;.i.<.s_AllUse
e5e0 72 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 rCount;.++i)..............{.....
e600 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 .............if.(s_AllUserData[i
e620 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 3d 20 70 ].platformUserAccountHandle.==.p
e640 6c 61 74 66 6f 72 6d 48 61 6e 64 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 latformHandle)..................
e660 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 ....return.i;..............}....
e680 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ..........return.-1;..........}.
e6a0 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 20 20 20 ...........///.<summary>........
e6c0 20 20 2f 2f 2f 20 46 69 6e 64 20 74 68 65 20 75 73 65 72 20 28 69 66 20 61 6e 79 29 20 74 68 61 ..///.Find.the.user.(if.any).tha
e6e0 74 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 61 73 73 69 67 6e 65 64 20 74 68 65 20 67 69 76 65 t.is.currently.assigned.the.give
e700 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 2e 0d 0a 20 20 n.<paramref.name="device"/>.....
e720 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 2f ......///.</summary>..........//
e740 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 20 69 6e 70 75 74 20 /.<param.name="device">An.input.
e760 64 65 76 69 63 65 20 74 68 61 74 20 68 61 73 20 62 65 65 6e 20 61 64 64 65 64 20 74 6f 20 74 68 device.that.has.been.added.to.th
e780 65 20 73 79 73 74 65 6d 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c e.system.</param>..........///.<
e7a0 72 65 74 75 72 6e 73 3e 49 6e 64 65 78 20 6f 66 20 74 68 65 20 75 73 65 72 20 74 68 61 74 20 68 returns>Index.of.the.user.that.h
e7c0 61 73 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 61 6d 6f as.<paramref.name="device"/>.amo
e7e0 6e 67 20 69 74 73 20 3c 73 65 65 20 63 72 65 66 3d 22 70 61 69 72 65 64 44 65 76 69 63 65 73 22 ng.its.<see.cref="pairedDevices"
e800 2f 3e 20 6f 72 20 2d 31 20 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 20 75 73 65 72 />.or.-1.if..........///.no.user
e820 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 61 73 73 69 67 6e 65 64 20 74 68 65 20 67 69 76 65 6e .is.currently.assigned.the.given
e840 20 64 65 76 69 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 .device.</returns>..........priv
e860 61 74 65 20 73 74 61 74 69 63 20 69 6e 74 20 54 72 79 46 69 6e 64 55 73 65 72 49 6e 64 65 78 28 ate.static.int.TryFindUserIndex(
e880 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a InputDevice.device)..........{..
e8a0 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 64 65 76 69 63 65 20 ............Debug.Assert(device.
e8c0 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 76 61 72 20 69 6e 64 !=.null);................var.ind
e8e0 65 78 4f 66 44 65 76 69 63 65 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 65 78 4f exOfDevice.=.ArrayHelpers.IndexO
e900 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 64 fReference(s_AllPairedDevices,.d
e920 65 76 69 63 65 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d evice,.s_AllPairedDeviceCount);.
e940 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 4f 66 44 65 76 69 63 65 20 3d .............if.(indexOfDevice.=
e960 3d 20 2d 31 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 2d 31 =.-1)..................return.-1
e980 3b 0d 0a 0d 0a 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 ;................for.(var.i.=.0;
e9a0 20 69 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 .i.<.s_AllUserCount;.++i).......
e9c0 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 73 74 .......{..................var.st
e9e0 61 72 74 49 6e 64 65 78 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 artIndex.=.s_AllUserData[i].devi
ea00 63 65 53 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 20 20 69 ceStartIndex;..................i
ea20 66 20 28 73 74 61 72 74 49 6e 64 65 78 20 3c 3d 20 69 6e 64 65 78 4f 66 44 65 76 69 63 65 20 26 f.(startIndex.<=.indexOfDevice.&
ea40 26 20 69 6e 64 65 78 4f 66 44 65 76 69 63 65 20 3c 20 73 74 61 72 74 49 6e 64 65 78 20 2b 20 73 &.indexOfDevice.<.startIndex.+.s
ea60 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 29 0d 0a 20 20 _AllUserData[i].deviceCount)....
ea80 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 69 3b 0d 0a 20 20 20 ..................return.i;.....
eaa0 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 72 6e .........}................return
eac0 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 2f 2f 20 3c .-1;..........}............///.<
eae0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 74 68 65 20 67 69 summary>..........///.Add.the.gi
eb00 76 65 6e 20 64 65 76 69 63 65 20 74 6f 20 74 68 65 20 75 73 65 72 20 61 73 20 65 69 74 68 65 72 ven.device.to.the.user.as.either
eb20 20 61 20 6c 6f 73 74 20 64 65 76 69 63 65 20 6f 72 20 61 20 70 61 69 72 65 64 20 64 65 76 69 63 .a.lost.device.or.a.paired.devic
eb40 65 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 0a 20 20 20 20 e...........///.</summary>......
eb60 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 65 72 49 6e 64 65 78 22 3e ....///.<param.name="userIndex">
eb80 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 6e 61 6d </param>..........///.<param.nam
eba0 65 3d 22 64 65 76 69 63 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f e="device"></param>..........///
ebc0 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 61 73 4c 6f 73 74 44 65 76 69 63 65 22 3e 3c 2f 70 61 .<param.name="asLostDevice"></pa
ebe0 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 ram>..........private.static.voi
ec00 64 20 41 64 64 44 65 76 69 63 65 54 6f 55 73 65 72 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c d.AddDeviceToUser(int.userIndex,
ec20 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 62 6f 6f 6c 20 61 73 4c 6f 73 74 .InputDevice.device,.bool.asLost
ec40 44 65 76 69 63 65 20 3d 20 66 61 6c 73 65 2c 20 62 6f 6f 6c 20 64 6f 6e 74 55 70 64 61 74 65 43 Device.=.false,.bool.dontUpdateC
ec60 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 7b ontrolScheme.=.false)..........{
ec80 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 75 73 65 72 49 ..............Debug.Assert(userI
eca0 6e 64 65 78 20 3e 3d 20 30 20 26 26 20 75 73 65 72 49 6e 64 65 78 20 3c 20 73 5f 41 6c 6c 55 73 ndex.>=.0.&&.userIndex.<.s_AllUs
ecc0 65 72 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 erCount);..............Debug.Ass
ece0 65 72 74 28 64 65 76 69 63 65 20 21 3d 20 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ert(device.!=.null);............
ed00 20 20 69 66 20 28 61 73 4c 6f 73 74 44 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..if.(asLostDevice).............
ed20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 21 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 .....Debug.Assert(!s_AllUsers[us
ed40 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 73 2e 43 6f 6e 74 61 69 6e 73 52 65 66 erIndex].lostDevices.ContainsRef
ed60 65 72 65 6e 63 65 28 64 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c erence(device));..............el
ed80 73 65 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 se..................Debug.Assert
eda0 28 21 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 61 69 72 65 64 44 65 (!s_AllUsers[userIndex].pairedDe
edc0 76 69 63 65 73 2e 43 6f 6e 74 61 69 6e 73 52 65 66 65 72 65 6e 63 65 28 64 65 76 69 63 65 29 29 vices.ContainsReference(device))
ede0 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 63 65 43 6f 75 6e 74 ;................var.deviceCount
ee00 20 3d 20 61 73 4c 6f 73 74 44 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.asLostDevice.................
ee20 20 3f 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 .?.s_AllUserData[userIndex].lost
ee40 44 65 76 69 63 65 43 6f 75 6e 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 73 DeviceCount..................:.s
ee60 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 43 6f _AllUserData[userIndex].deviceCo
ee80 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 53 74 61 72 unt;..............var.deviceStar
eea0 74 49 6e 64 65 78 20 3d 20 61 73 4c 6f 73 74 44 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 20 tIndex.=.asLostDevice...........
eec0 20 20 20 20 20 20 20 3f 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 .......?.s_AllUserData[userIndex
eee0 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 ].lostDeviceStartIndex..........
ef00 20 20 20 20 20 20 20 20 3a 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 ........:.s_AllUserData[userInde
ef20 78 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 x].deviceStartIndex;............
ef40 20 20 20 20 2b 2b 73 5f 50 61 69 72 69 6e 67 53 74 61 74 65 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a ....++s_PairingStateVersion;....
ef60 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 6f 76 65 20 6f 75 72 20 64 65 76 69 63 65 73 20 ............//.Move.our.devices.
ef80 74 6f 20 65 6e 64 20 6f 66 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 to.end.of.array...............if
efa0 20 28 64 65 76 69 63 65 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .(deviceCount.>.0)..............
efc0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e {..................ArrayHelpers.
efe0 4d 6f 76 65 53 6c 69 63 65 28 61 73 4c 6f 73 74 44 65 76 69 63 65 20 3f 20 73 5f 41 6c 6c 4c 6f MoveSlice(asLostDevice.?.s_AllLo
f000 73 74 44 65 76 69 63 65 73 20 3a 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 stDevices.:.s_AllPairedDevices,.
f020 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 deviceStartIndex,...............
f040 20 20 20 20 20 20 20 61 73 4c 6f 73 74 44 65 76 69 63 65 20 3f 20 73 5f 41 6c 6c 4c 6f 73 74 44 .......asLostDevice.?.s_AllLostD
f060 65 76 69 63 65 43 6f 75 6e 74 20 2d 20 64 65 76 69 63 65 43 6f 75 6e 74 20 3a 20 73 5f 41 6c 6c eviceCount.-.deviceCount.:.s_All
f080 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 20 2d 20 64 65 76 69 63 65 43 6f 75 6e 74 2c PairedDeviceCount.-.deviceCount,
f0a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 43 6f 75 6e ......................deviceCoun
f0c0 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 t);....................//.Adjust
f0e0 20 75 73 65 72 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 69 6d 70 61 63 74 65 64 20 62 .users.that.have.been.impacted.b
f100 79 20 74 68 65 20 63 68 61 6e 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 y.the.change...................f
f120 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e or.(var.i.=.0;.i.<.s_AllUserCoun
f140 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)..................{......
f160 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 20 3d 3d 20 75 73 65 72 49 6e 64 ................if.(i.==.userInd
f180 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e ex)..........................con
f1a0 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 tinue;........................if
f1c0 20 28 28 61 73 4c 6f 73 74 44 65 76 69 63 65 20 3f 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b .((asLostDevice.?.s_AllUserData[
f1e0 69 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3a 20 73 5f 41 6c 6c 55 i].lostDeviceStartIndex.:.s_AllU
f200 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 29 20 3c 3d 20 serData[i].deviceStartIndex).<=.
f220 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 deviceStartIndex)...............
f240 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...........continue;............
f260 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 73 4c 6f 73 74 44 65 76 69 63 65 29 0d 0a 20 ............if.(asLostDevice)...
f280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 .......................s_AllUser
f2a0 44 61 74 61 5b 69 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 2d 3d 20 Data[i].lostDeviceStartIndex.-=.
f2c0 64 65 76 69 63 65 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 deviceCount;....................
f2e0 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..........................
f300 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 s_AllUserData[i].deviceStartInde
f320 78 20 2d 3d 20 64 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 x.-=.deviceCount;...............
f340 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 ...}..............}.............
f360 20 20 20 2f 2f 20 41 70 70 65 6e 64 20 74 6f 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 ...//.Append.to.array...........
f380 20 20 20 20 69 66 20 28 61 73 4c 6f 73 74 44 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 ....if.(asLostDevice)...........
f3a0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 ...{..................s_AllUserD
f3c0 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e ata[userIndex].lostDeviceStartIn
f3e0 64 65 78 20 3d 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 20 2d 20 64 65 76 dex.=.s_AllLostDeviceCount.-.dev
f400 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 iceCount;..................Array
f420 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 Helpers.AppendWithCapacity(ref.s
f440 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 _AllLostDevices,.ref.s_AllLostDe
f460 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 viceCount,.device);.............
f480 20 20 20 20 20 2b 2b 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e .....++s_AllUserData[userIndex].
f4a0 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d lostDeviceCount;..............}.
f4c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b .............else..............{
f4e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b ..................s_AllUserData[
f500 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3d 20 73 5f userIndex].deviceStartIndex.=.s_
f520 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 20 2d 20 64 65 76 69 63 65 43 6f 75 AllPairedDeviceCount.-.deviceCou
f540 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 nt;..................ArrayHelper
f560 73 2e 41 70 70 65 6e 64 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 5f 41 6c 6c 50 61 s.AppendWithCapacity(ref.s_AllPa
f580 69 72 65 64 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 iredDevices,.ref.s_AllPairedDevi
f5a0 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ceCount,.device);...............
f5c0 20 20 20 2b 2b 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 ...++s_AllUserData[userIndex].de
f5e0 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f viceCount;....................//
f600 20 49 66 20 74 68 65 20 75 73 65 72 20 68 61 73 20 61 63 74 69 6f 6e 73 2c 20 73 79 6e 63 20 74 .If.the.user.has.actions,.sync.t
f620 68 65 20 64 65 76 69 63 65 73 20 6f 6e 20 74 68 65 6d 20 77 69 74 68 20 77 68 61 74 20 77 65 20 he.devices.on.them.with.what.we.
f640 68 61 76 65 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 have.now...................var.a
f660 63 74 69 6f 6e 73 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 ctions.=.s_AllUserData[userIndex
f680 5d 2e 61 63 74 69 6f 6e 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ].actions;..................if.(
f6a0 61 63 74 69 6f 6e 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 actions.!=.null)................
f6c0 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 61 63 74 69 6f 6e 73 ..{......................actions
f6e0 2e 64 65 76 69 63 65 73 20 3d 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d .devices.=.s_AllUsers[userIndex]
f700 2e 70 61 69 72 65 64 44 65 76 69 63 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .pairedDevices;.................
f720 20 20 20 20 20 20 20 2f 2f 20 41 6c 73 6f 2c 20 69 66 20 77 65 20 68 61 76 65 20 61 20 63 6f 6e .......//.Also,.if.we.have.a.con
f740 74 72 6f 6c 20 73 63 68 65 6d 65 2c 20 75 70 64 61 74 65 20 74 68 65 20 6d 61 74 63 68 69 6e 67 trol.scheme,.update.the.matching
f760 20 6f 66 20 64 65 76 69 63 65 20 72 65 71 75 69 72 65 6d 65 6e 74 73 0d 0a 20 20 20 20 20 20 20 .of.device.requirements.........
f780 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 67 61 69 6e 73 74 20 74 68 65 20 64 65 76 69 .............//.against.the.devi
f7a0 63 65 20 77 65 20 6e 6f 77 20 68 61 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ce.we.now.have..................
f7c0 20 20 20 20 20 69 66 20 28 21 64 6f 6e 74 55 70 64 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d .....if.(!dontUpdateControlSchem
f7e0 65 20 26 26 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f e.&&.s_AllUserData[userIndex].co
f800 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 ntrolScheme.!=.null)............
f820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d ..............UpdateControlSchem
f840 65 4d 61 74 63 68 28 75 73 65 72 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 eMatch(userIndex);..............
f860 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 20 ....}..............}............
f880 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 67 65 74 20 4f 6e 44 65 76 69 63 65 ....//.Make.sure.we.get.OnDevice
f8a0 43 68 61 6e 67 65 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 Change.notifications............
f8c0 20 20 20 48 6f 6f 6b 49 6e 74 6f 44 65 76 69 63 65 43 68 61 6e 67 65 28 29 3b 0d 0a 0d 0a 20 20 ...HookIntoDeviceChange();......
f8e0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 65 74 20 6c 69 73 74 65 6e 65 72 73 20 6b 6e 6f 77 2e ..........//.Let.listeners.know.
f900 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 ..............Notify(userIndex,.
f920 61 73 4c 6f 73 74 44 65 76 69 63 65 20 3f 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 asLostDevice.?.InputUserChange.D
f940 65 76 69 63 65 4c 6f 73 74 20 3a 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 eviceLost.:.InputUserChange.Devi
f960 63 65 50 61 69 72 65 64 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d cePaired,.device);..........}...
f980 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 6d .........private.static.void.Rem
f9a0 6f 76 65 44 65 76 69 63 65 46 72 6f 6d 55 73 65 72 28 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c oveDeviceFromUser(int.userIndex,
f9c0 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 62 6f 6f 6c 20 61 73 4c 6f 73 74 .InputDevice.device,.bool.asLost
f9e0 44 65 76 69 63 65 20 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 Device.=.false)..........{......
fa00 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 75 73 65 72 49 6e 64 65 78 20 3e ........Debug.Assert(userIndex.>
fa20 3d 20 30 20 26 26 20 75 73 65 72 49 6e 64 65 78 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e =.0.&&.userIndex.<.s_AllUserCoun
fa40 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 64 65 t);..............Debug.Assert(de
fa60 76 69 63 65 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 76 61 vice.!=.null);................va
fa80 72 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 20 61 73 4c 6f 73 74 44 65 76 69 63 65 0d 0a 20 20 r.deviceIndex.=.asLostDevice....
faa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 ..............?.ArrayHelpers.Ind
fac0 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 exOfReference(s_AllLostDevices,.
fae0 64 65 76 69 63 65 2c 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 29 0d 0a 20 device,.s_AllLostDeviceCount)...
fb00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e ...............:.ArrayHelpers.In
fb20 64 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 dexOfReference(s_AllPairedDevice
fb40 73 2c 20 64 65 76 69 63 65 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e s,.device,.s_AllPairedDeviceCoun
fb60 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 64 65 t);..............Debug.Assert(de
fb80 76 69 63 65 49 6e 64 65 78 20 21 3d 20 2d 31 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 viceIndex.!=.-1);..............i
fba0 66 20 28 64 65 76 69 63 65 49 6e 64 65 78 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 f.(deviceIndex.==.-1)...........
fbc0 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 44 65 76 69 63 65 20 ...{..................//.Device.
fbe0 6e 6f 74 20 69 6e 20 6c 69 73 74 2e 20 49 67 6e 6f 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 not.in.list..Ignore.............
fc00 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ......return;..............}....
fc20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 73 4c 6f 73 74 44 65 76 69 63 65 29 0d 0a 20 ............if.(asLostDevice)...
fc40 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 41 72 ...........{..................Ar
fc60 72 61 79 48 65 6c 70 65 72 73 2e 45 72 61 73 65 41 74 57 69 74 68 43 61 70 61 63 69 74 79 28 73 rayHelpers.EraseAtWithCapacity(s
fc80 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 _AllLostDevices,.ref.s_AllLostDe
fca0 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 viceCount,.deviceIndex);........
fcc0 20 20 20 20 20 20 20 20 20 20 2d 2d 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e ..........--s_AllUserData[userIn
fce0 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 dex].lostDeviceCount;...........
fd00 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 ...}..............else..........
fd20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 73 5f 50 61 69 72 69 ....{..................--s_Pairi
fd40 6e 67 53 74 61 74 65 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ngStateVersion;.................
fd60 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 45 72 61 73 65 41 74 57 69 74 68 43 61 70 61 63 69 74 .ArrayHelpers.EraseAtWithCapacit
fd80 79 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 50 y(s_AllPairedDevices,.ref.s_AllP
fda0 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 49 6e 64 65 78 29 3b 0d airedDeviceCount,.deviceIndex);.
fdc0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 .................--s_AllUserData
fde0 5b 75 73 65 72 49 6e 64 65 78 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 [userIndex].deviceCount;........
fe00 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 ......}................//.Adjust
fe20 20 69 6e 64 69 63 65 73 20 6f 66 20 6f 74 68 65 72 20 75 73 65 72 73 2e 0d 0a 20 20 20 20 20 20 .indices.of.other.users.........
fe40 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 73 5f 41 6c 6c 55 ......for.(var.i.=.0;.i.<.s_AllU
fe60 73 65 72 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 serCount;.++i)..............{...
fe80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 61 73 4c 6f 73 74 44 65 76 69 63 65 ...............if.((asLostDevice
fea0 20 3f 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 .?.s_AllUserData[i].lostDeviceSt
fec0 61 72 74 49 6e 64 65 78 20 3a 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 artIndex.:.s_AllUserData[i].devi
fee0 63 65 53 74 61 72 74 49 6e 64 65 78 29 20 3c 3d 20 64 65 76 69 63 65 49 6e 64 65 78 29 0d 0a 20 ceStartIndex).<=.deviceIndex)...
ff00 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 0d 0a ...................continue;....
ff20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 73 4c 6f 73 74 44 65 76 69 63 65 ................if.(asLostDevice
ff40 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 73 5f 41 6c 6c 55 73 )......................--s_AllUs
ff60 65 72 44 61 74 61 5b 69 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b 0d erData[i].lostDeviceStartIndex;.
ff80 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 20 20 20 .................else...........
ffa0 20 20 20 20 20 20 20 20 20 20 20 2d 2d 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 ...........--s_AllUserData[i].de
ffc0 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a viceStartIndex;..............}..
ffe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 61 73 4c 6f 73 74 44 65 76 69 63 65 29 ..............if.(!asLostDevice)
10000 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 ..............{.................
10020 20 2f 2f 20 52 65 6d 6f 76 65 20 61 6e 79 20 6f 6e 67 6f 69 6e 67 20 61 63 63 6f 75 6e 74 20 73 .//.Remove.any.ongoing.account.s
10040 65 6c 65 63 74 69 6f 6e 73 20 66 6f 72 20 74 68 65 20 75 73 65 72 20 6f 6e 20 74 68 65 20 67 69 elections.for.the.user.on.the.gi
10060 76 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 ven.device...................for
10080 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e .(var.i.=.0;.i.<.s_OngoingAccoun
100a0 74 53 65 6c 65 63 74 69 6f 6e 73 2e 6c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 tSelections.length;.++i)........
100c0 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 ..........{.....................
100e0 20 69 66 20 28 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 5b .if.(s_OngoingAccountSelections[
10100 69 5d 2e 75 73 65 72 49 64 20 21 3d 20 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 i].userId.!=.s_AllUsers[userInde
10120 78 5d 2e 69 64 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 x].id.||........................
10140 20 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 5b 69 5d 2e ..s_OngoingAccountSelections[i].
10160 64 65 76 69 63 65 20 21 3d 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 device.!=.device)...............
10180 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...........continue;............
101a0 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 ............s_OngoingAccountSele
101c0 63 74 69 6f 6e 73 2e 52 65 6d 6f 76 65 41 74 42 79 4d 6f 76 69 6e 67 54 61 69 6c 57 69 74 68 43 ctions.RemoveAtByMovingTailWithC
101e0 61 70 61 63 69 74 79 28 69 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 apacity(i);.....................
10200 20 2d 2d 69 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 .--i;..................}........
10220 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 75 73 65 72 20 68 61 73 20 61 ............//.If.the.user.has.a
10240 63 74 69 6f 6e 73 2c 20 73 79 6e 63 20 74 68 65 20 64 65 76 69 63 65 73 20 6f 6e 20 74 68 65 6d ctions,.sync.the.devices.on.them
10260 20 77 69 74 68 20 77 68 61 74 20 77 65 20 68 61 76 65 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 .with.what.we.have.now..........
10280 20 20 20 20 20 20 20 20 20 76 61 72 20 61 63 74 69 6f 6e 73 20 3d 20 73 5f 41 6c 6c 55 73 65 72 .........var.actions.=.s_AllUser
102a0 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 61 63 74 69 6f 6e 73 3b 0d 0a 20 20 20 20 20 20 Data[userIndex].actions;........
102c0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 63 74 69 6f 6e 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a ..........if.(actions.!=.null)..
102e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
10300 20 20 20 20 20 20 20 61 63 74 69 6f 6e 73 2e 64 65 76 69 63 65 73 20 3d 20 73 5f 41 6c 6c 55 73 .......actions.devices.=.s_AllUs
10320 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 61 69 72 65 64 44 65 76 69 63 65 73 3b 0d 0a 0d ers[userIndex].pairedDevices;...
10340 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 73 5f 41 6c 6c 55 73 .....................if.(s_AllUs
10360 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 21 3d 20 ers[userIndex].controlScheme.!=.
10380 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 55 null)..........................U
103a0 70 64 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 28 75 73 65 72 49 6e 64 65 pdateControlSchemeMatch(userInde
103c0 78 29 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 20 x);..................}..........
103e0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 69 66 79 20 6c 69 73 74 65 6e 65 72 73 2e 0d 0a ..........//.Notify.listeners...
10400 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 ................Notify(userIndex
10420 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 44 65 76 69 63 65 55 6e 70 61 69 72 65 64 ,.InputUserChange.DeviceUnpaired
10440 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 ,.device);..............}.......
10460 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 ...}............private.static.v
10480 6f 69 64 20 55 70 64 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 28 69 6e 74 oid.UpdateControlSchemeMatch(int
104a0 20 75 73 65 72 49 6e 64 65 78 2c 20 62 6f 6f 6c 20 61 75 74 6f 50 61 69 72 4d 69 73 73 69 6e 67 .userIndex,.bool.autoPairMissing
104c0 20 3d 20 66 61 6c 73 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 .=.false)..........{............
104e0 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 75 73 65 72 49 6e 64 65 78 20 3e 3d 20 30 20 26 26 ..Debug.Assert(userIndex.>=.0.&&
10500 20 75 73 65 72 49 6e 64 65 78 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 29 3b 0d 0a 0d .userIndex.<.s_AllUserCount);...
10520 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 20 69 66 .............//.Nothing.to.do.if
10540 20 77 65 20 64 6f 6e 27 74 20 68 61 76 65 20 61 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 2e .we.don't.have.a.control.scheme.
10560 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b ..............if.(s_AllUserData[
10580 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 20 3d 3d 20 6e 75 6c 6c userIndex].controlScheme.==.null
105a0 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 3b 0d 0a 0d 0a 20 20 )..................return;......
105c0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 72 69 64 20 6f 66 20 6c 61 73 74 20 6d 61 74 ..........//.Get.rid.of.last.mat
105e0 63 68 20 72 65 73 75 6c 74 20 61 6e 64 20 73 74 61 72 74 20 6e 65 77 20 6d 61 74 63 68 2e 0d 0a ch.result.and.start.new.match...
10600 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e ............s_AllUserData[userIn
10620 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 2e 44 69 73 70 6f 73 65 28 dex].controlSchemeMatch.Dispose(
10640 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 74 63 68 52 65 73 75 6c 74 20 );..............var.matchResult.
10660 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 4d 61 74 63 68 52 65 =.new.InputControlScheme.MatchRe
10680 73 75 6c 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 20 20 20 20 sult();..............try........
106a0 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 4d 61 74 63 ......{..................//.Matc
106c0 68 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 27 73 20 72 65 71 75 69 72 65 6d 65 h.the.control.scheme's.requireme
106e0 6e 74 73 20 61 67 61 69 6e 73 74 20 74 68 65 20 64 65 76 69 63 65 73 20 70 61 69 72 65 64 20 74 nts.against.the.devices.paired.t
10700 6f 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 o.the.user...................var
10720 20 73 63 68 65 6d 65 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 .scheme.=.s_AllUserData[userInde
10740 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 x].controlScheme.Value;.........
10760 20 20 20 20 20 20 20 20 20 69 66 20 28 73 63 68 65 6d 65 2e 64 65 76 69 63 65 52 65 71 75 69 72 .........if.(scheme.deviceRequir
10780 65 6d 65 6e 74 73 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ements.Count.>.0)...............
107a0 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 61 76 ...{......................var.av
107c0 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f ailableDevices.=.new.InputContro
107e0 6c 4c 69 73 74 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 28 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d lList<InputDevice>(Allocator.Tem
10800 70 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 0d 0a 20 20 p);......................try....
10820 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 ..................{.............
10840 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 64 65 76 69 63 65 73 20 61 6c 72 65 .............//.Add.devices.alre
10860 61 64 79 20 70 61 69 72 65 64 20 74 6f 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ady.paired.to.user..............
10880 20 20 20 20 20 20 20 20 20 20 20 20 20 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 2e 41 64 .............availableDevices.Ad
108a0 64 53 6c 69 63 65 28 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 61 69 dSlice(s_AllUsers[userIndex].pai
108c0 72 65 64 44 65 76 69 63 65 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 redDevices);....................
108e0 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 27 72 65 20 73 75 70 70 6f 73 65 64 20 74 6f 20 ........//.If.we're.supposed.to.
10900 67 72 61 62 20 77 68 61 74 65 76 65 72 20 61 64 64 69 74 69 6f 6e 61 6c 20 64 65 76 69 63 65 73 grab.whatever.additional.devices
10920 20 77 65 20 6e 65 65 64 20 66 72 6f 6d 20 77 68 61 74 27 73 0d 0a 20 20 20 20 20 20 20 20 20 20 .we.need.from.what's............
10940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 76 61 69 6c 61 62 6c 65 2c 20 61 64 64 20 ..............//.available,.add.
10960 61 6c 6c 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 74 6f 20 74 68 65 20 6c 69 73 74 all.unpaired.devices.to.the.list
10980 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 20 4e 4f ...........................//.NO
109a0 54 45 3a 20 54 68 65 73 65 20 64 65 76 69 63 65 73 20 67 6f 20 2a 61 66 74 65 72 2a 20 74 68 65 TE:.These.devices.go.*after*.the
109c0 20 64 65 76 69 63 65 73 20 61 6c 72 65 61 64 79 20 70 61 69 72 65 64 20 28 69 66 20 61 6e 79 29 .devices.already.paired.(if.any)
109e0 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .meaning.that...................
10a00 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 .......//.......the.control.sche
10a20 6d 65 20 6d 61 74 63 68 69 6e 67 20 77 69 6c 6c 20 67 72 61 62 20 61 6c 72 65 61 64 79 20 70 61 me.matching.will.grab.already.pa
10a40 69 72 65 64 20 64 65 76 69 63 65 73 20 2a 66 69 72 73 74 2a 2e 0d 0a 20 20 20 20 20 20 20 20 20 ired.devices.*first*............
10a60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 75 74 6f 50 61 69 72 4d 69 73 73 69 ...............if.(autoPairMissi
10a80 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ng)..........................{..
10aa0 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 76 61 72 20 ............................var.
10ac0 73 74 61 72 74 49 6e 64 65 78 20 3d 20 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 2e 43 6f startIndex.=.availableDevices.Co
10ae0 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 20 20 unt;............................
10b00 20 20 76 61 72 20 63 6f 75 6e 74 20 3d 20 47 65 74 55 6e 70 61 69 72 65 64 49 6e 70 75 74 44 65 ..var.count.=.GetUnpairedInputDe
10b20 76 69 63 65 73 28 72 65 66 20 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 29 3b 0d 0a 0d 0a vices(ref.availableDevices);....
10b40 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 57 ............................//.W
10b60 65 20 77 61 6e 74 20 74 6f 20 66 61 76 6f 72 20 64 65 76 69 63 65 73 20 74 68 61 74 20 61 72 65 e.want.to.favor.devices.that.are
10b80 20 61 6c 72 65 61 64 79 20 61 73 73 69 67 6e 65 64 20 74 6f 20 74 68 65 20 73 61 6d 65 20 70 6c .already.assigned.to.the.same.pl
10ba0 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 atform.user.account.............
10bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6f 72 74 20 74 68 65 20 75 6e ..................//.Sort.the.un
10be0 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 77 65 27 76 65 20 61 64 64 65 64 20 74 6f 20 74 68 paired.devices.we've.added.to.th
10c00 65 20 6c 69 73 74 20 73 75 63 68 20 74 68 61 74 20 74 68 65 20 6f 6e 65 73 20 62 65 6c 6f 6e 67 e.list.such.that.the.ones.belong
10c20 69 6e 67 20 74 6f 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ing.to.the......................
10c40 20 20 20 20 20 20 20 20 2f 2f 20 73 61 6d 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 63 6f 6d ........//.same.user.account.com
10c60 65 20 66 69 72 73 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 e.first.........................
10c80 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 ......if.(s_AllUserData[userInde
10ca0 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 21 3d 20 x].platformUserAccountHandle.!=.
10cc0 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 20 null)...........................
10ce0 20 20 20 20 20 20 20 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 2e 53 6f 72 74 28 73 74 61 .......availableDevices.Sort(sta
10d00 72 74 49 6e 64 65 78 2c 20 63 6f 75 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rtIndex,.count,.................
10d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 43 6f 6d 70 61 72 65 .....................new.Compare
10d40 44 65 76 69 63 65 73 42 79 55 73 65 72 41 63 63 6f 75 6e 74 0d 0a 20 20 20 20 20 20 20 20 20 20 DevicesByUserAccount............
10d60 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 0d 0a 20 20 20 ..........................{.....
10d80 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 ................................
10da0 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d .....platformUserAccountHandle.=
10dc0 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f .s_AllUserData[userIndex].platfo
10de0 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 2e 56 61 6c 75 65 0d 0a 20 20 20 20 20 rmUserAccountHandle.Value.......
10e00 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 7d ...............................}
10e20 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 7d 0d 0a 0d );..........................}...
10e40 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 6d 61 74 63 68 52 65 .........................matchRe
10e60 73 75 6c 74 20 3d 20 73 63 68 65 6d 65 2e 50 69 63 6b 44 65 76 69 63 65 73 46 72 6f 6d 28 61 76 sult.=.scheme.PickDevicesFrom(av
10e80 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ailableDevices);................
10ea0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 74 63 68 52 65 73 75 6c 74 2e 69 73 53 75 63 63 ..........if.(matchResult.isSucc
10ec0 65 73 73 66 75 6c 4d 61 74 63 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 essfulMatch)....................
10ee0 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 ......{.........................
10f00 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 64 20 6c 6f 73 74 20 73 6f 6d 65 20 64 65 76 69 .....//.If.we.had.lost.some.devi
10f20 63 65 73 2c 20 66 6c 75 73 68 20 74 68 65 20 6c 69 73 74 2e 20 57 65 20 68 61 76 65 6e 27 74 20 ces,.flush.the.list..We.haven't.
10f40 72 65 67 61 69 6e 65 64 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 regained.the.device.............
10f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 75 74 20 77 65 27 72 65 20 6e 6f .................//.but.we're.no
10f80 20 6c 6f 6e 67 65 72 20 6d 69 73 73 69 6e 67 20 64 65 76 69 63 65 73 20 74 6f 20 70 6c 61 79 2e .longer.missing.devices.to.play.
10fa0 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
10fc0 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 .(s_AllUserData[userIndex].lostD
10fe0 65 76 69 63 65 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eviceCount.>.0).................
11000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 45 72 .................ArrayHelpers.Er
11020 61 73 65 53 6c 69 63 65 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 73 5f 41 6c 6c 4c 6f aseSliceWithCapacity(ref.s_AllLo
11040 73 74 44 65 76 69 63 65 73 2c 20 72 65 66 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f stDevices,.ref.s_AllLostDeviceCo
11060 75 6e 74 2c 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 unt,............................
11080 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 ..........s_AllUserData[userInde
110a0 78 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 2c 0d 0a 20 20 20 20 20 20 x].lostDeviceStartIndex,........
110c0 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 73 5f ..............................s_
110e0 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 6c 6f 73 74 44 65 76 69 63 AllUserData[userIndex].lostDevic
11100 65 43 6f 75 6e 74 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 eCount);........................
11120 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 69 73 20 73 61 74 ........//.Control.scheme.is.sat
11140 69 73 66 69 65 64 20 77 69 74 68 20 74 68 65 20 64 65 76 69 63 65 73 20 77 65 20 68 61 76 65 20 isfied.with.the.devices.we.have.
11160 61 76 61 69 6c 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 available.......................
11180 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 6d 61 79 20 68 61 76 65 20 67 72 61 62 62 65 ........//.If.we.may.have.grabbe
111a0 64 20 61 73 20 6f 66 20 79 65 74 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2c 20 67 6f d.as.of.yet.unpaired.devices,.go
111c0 20 61 6e 64 20 70 61 69 72 20 74 68 65 6d 20 74 6f 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 .and.pair.them.to.the.user......
111e0 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 61 75 74 .........................if.(aut
11200 6f 50 61 69 72 4d 69 73 73 69 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 oPairMissing)...................
11220 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 ...........{....................
11240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 64 61 74 65 20 6d 61 74 63 68 20 72 65 ..............//.Update.match.re
11260 73 75 6c 74 20 6f 6e 20 75 73 65 72 20 62 65 66 6f 72 65 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 sult.on.user.before.potentially.
11280 69 6e 76 6f 6b 69 6e 67 20 63 61 6c 6c 62 61 63 6b 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 invoking.callbacks..............
112a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 .....................s_AllUserDa
112c0 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 ta[userIndex].controlSchemeMatch
112e0 20 3d 20 6d 61 74 63 68 52 65 73 75 6c 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .=.matchResult;.................
11300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 ...................foreach.(var.
11320 64 65 76 69 63 65 20 69 6e 20 6d 61 74 63 68 52 65 73 75 6c 74 2e 64 65 76 69 63 65 73 29 0d 0a device.in.matchResult.devices)..
11340 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 ................................
11360 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 20 {...............................
11380 20 20 20 20 20 20 20 2f 2f 20 53 6b 69 70 20 69 66 20 61 6c 72 65 61 64 79 20 70 61 69 72 65 64 .......//.Skip.if.already.paired
113a0 20 74 6f 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .to.user........................
113c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 ...............if.(s_AllUsers[us
113e0 65 72 49 6e 64 65 78 5d 2e 70 61 69 72 65 64 44 65 76 69 63 65 73 2e 43 6f 6e 74 61 69 6e 73 52 erIndex].pairedDevices.ContainsR
11400 65 66 65 72 65 6e 63 65 28 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 eference(device))...............
11420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 ...........................conti
11440 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nue;............................
11460 20 20 20 20 20 20 20 20 20 20 20 20 41 64 64 44 65 76 69 63 65 54 6f 55 73 65 72 28 75 73 65 72 ............AddDeviceToUser(user
11480 49 6e 64 65 78 2c 20 64 65 76 69 63 65 2c 20 64 6f 6e 74 55 70 64 61 74 65 43 6f 6e 74 72 6f 6c Index,.device,.dontUpdateControl
114a0 53 63 68 65 6d 65 3a 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Scheme:.true);..................
114c0 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 ................}...............
114e0 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 ...............}................
11500 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 ..........}.....................
11520 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 61 6c 6c 79 0d .}......................finally.
11540 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 .....................{..........
11560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 ................availableDevices
11580 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 20 20 20 20 20 20 20 .Dispose();.....................
115a0 20 7d 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 20 20 .}..................}...........
115c0 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 .........s_AllUserData[userIndex
115e0 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 20 3d 20 6d 61 74 63 68 52 65 73 75 ].controlSchemeMatch.=.matchResu
11600 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 lt;..............}..............
11620 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b catch.(Exception)..............{
11640 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 20 68 61 64 20 61 ..................//.If.we.had.a
11660 6e 20 65 78 63 65 70 74 69 6f 6e 20 61 6e 64 20 61 72 65 20 62 61 69 6c 69 6e 67 20 6f 75 74 2c n.exception.and.are.bailing.out,
11680 20 6d 61 6b 65 20 73 75 72 65 20 77 65 20 61 72 65 6e 27 74 20 6c 65 61 6b 69 6e 67 20 6e 61 74 .make.sure.we.aren't.leaking.nat
116a0 69 76 65 20 6d 65 6d 6f 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 ive.memory..................//.w
116c0 65 20 61 6c 6c 6f 63 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 e.allocated...................ma
116e0 74 63 68 52 65 73 75 6c 74 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 tchResult.Dispose();............
11700 20 20 20 20 20 20 74 68 72 6f 77 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 ......throw;..............}.....
11720 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 .....}............private.static
11740 20 6c 6f 6e 67 20 55 70 64 61 74 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 28 .long.UpdatePlatformUserAccount(
11760 69 6e 74 20 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 int.userIndex,.InputDevice.devic
11780 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 e)..........{..............Debug
117a0 2e 41 73 73 65 72 74 28 75 73 65 72 49 6e 64 65 78 20 3e 3d 20 30 20 26 26 20 75 73 65 72 49 6e .Assert(userIndex.>=.0.&&.userIn
117c0 64 65 78 20 3c 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 dex.<.s_AllUserCount);..........
117e0 20 20 20 20 20 20 2f 2f 20 46 65 74 63 68 20 61 63 63 6f 75 6e 74 20 64 65 74 61 69 6c 73 20 66 ......//.Fetch.account.details.f
11800 72 6f 6d 20 62 61 63 6b 65 6e 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 71 75 rom.backend...............var.qu
11820 65 72 79 52 65 73 75 6c 74 20 3d 20 51 75 65 72 79 50 61 69 72 65 64 50 6c 61 74 66 6f 72 6d 55 eryResult.=.QueryPairedPlatformU
11840 73 65 72 41 63 63 6f 75 6e 74 28 64 65 76 69 63 65 2c 20 6f 75 74 20 76 61 72 20 70 6c 61 74 66 serAccount(device,.out.var.platf
11860 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 ormUserAccountHandle,...........
11880 20 20 20 20 20 20 20 6f 75 74 20 76 61 72 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 .......out.var.platformUserAccou
118a0 6e 74 4e 61 6d 65 2c 20 6f 75 74 20 76 61 72 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f ntName,.out.var.platformUserAcco
118c0 75 6e 74 49 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 68 69 6e untId);................//.Nothin
118e0 67 20 6d 75 63 68 20 74 6f 20 64 6f 20 69 66 20 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 20 62 79 g.much.to.do.if.not.supported.by
11900 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 71 75 65 72 79 52 .device...............if.(queryR
11920 65 73 75 6c 74 20 3d 3d 20 49 6e 70 75 74 44 65 76 69 63 65 43 6f 6d 6d 61 6e 64 2e 47 65 6e 65 esult.==.InputDeviceCommand.Gene
11940 72 69 63 46 61 69 6c 75 72 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ricFailure)..............{......
11960 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 74 68 65 72 65 27 73 20 ............//.Check.if.there's.
11980 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 20 70 72 6f 67 72 65 73 73 an.account.selection.in.progress
119a0 2e 20 54 68 65 72 65 20 73 68 6f 75 6c 64 6e 27 74 20 62 65 20 61 73 20 69 74 27 73 0d 0a 20 20 ..There.shouldn't.be.as.it's....
119c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 65 69 72 64 20 66 6f 72 20 74 68 65 20 64 ..............//.weird.for.the.d
119e0 65 76 69 63 65 20 74 6f 20 6e 6f 20 73 69 67 6e 61 6c 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 73 evice.to.no.signal.it.does.not.s
11a00 75 70 70 6f 72 74 20 71 75 65 72 79 69 6e 67 20 75 73 65 72 20 61 63 63 6f 75 6e 74 2c 20 62 75 upport.querying.user.account,.bu
11a20 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6a 75 73 74 20 74 6f 20 62 65 t..................//.just.to.be
11a40 20 73 61 66 65 2c 20 77 65 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .safe,.we.check.................
11a60 20 20 69 66 20 28 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e ..if.((s_AllUserData[userIndex].
11a80 66 6c 61 67 73 20 26 20 55 73 65 72 46 6c 61 67 73 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c flags.&.UserFlags.UserAccountSel
11aa0 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 29 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 ectionInProgress).!=.0).........
11ac0 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 .............Notify(userIndex,.I
11ae0 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 43 nputUserChange.AccountSelectionC
11b00 61 6e 63 65 6c 65 64 2c 20 6e 75 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 anceled,.null);.................
11b20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 ...s_AllUserData[userIndex].plat
11b40 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 formUserAccountHandle.=.null;...
11b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 ...............s_AllUserData[use
11b80 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 20 rIndex].platformUserAccountName.
11ba0 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 73 5f 41 6c 6c 55 73 =.null;..................s_AllUs
11bc0 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 erData[userIndex].platformUserAc
11be0 63 6f 75 6e 74 49 64 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 countId.=.null;.................
11c00 20 20 20 72 65 74 75 72 6e 20 71 75 65 72 79 52 65 73 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 ...return.queryResult;..........
11c20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 ....}................//.Check.if
11c40 20 74 68 65 72 65 27 73 20 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 74 68 .there's.an.account.selection.th
11c60 61 74 20 77 65 20 68 61 76 65 20 69 6e 69 74 69 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 at.we.have.initiated............
11c80 20 20 20 69 66 20 28 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d ...if.((s_AllUserData[userIndex]
11ca0 2e 66 6c 61 67 73 20 26 20 55 73 65 72 46 6c 61 67 73 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 .flags.&.UserFlags.UserAccountSe
11cc0 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 29 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 lectionInProgress).!=.0)........
11ce0 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 59 65 73 2c ......{..................//.Yes,
11d00 20 74 68 65 72 65 20 69 73 2e 20 53 65 65 20 69 66 20 69 74 20 69 73 20 63 6f 6d 70 6c 65 74 65 .there.is..See.if.it.is.complete
11d20 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 71 75 65 72 79 52 .....................if.((queryR
11d40 65 73 75 6c 74 20 26 20 28 6c 6f 6e 67 29 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 esult.&.(long)QueryPairedUserAcc
11d60 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 52 65 73 75 6c 74 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 ountCommand.Result.UserAccountSe
11d80 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 29 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 lectionInProgress).!=.0)........
11da0 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 ..........{.....................
11dc0 20 2f 2f 20 4e 6f 2c 20 73 74 69 6c 6c 20 69 6e 20 70 72 6f 67 72 65 73 73 2e 0d 0a 20 20 20 20 .//.No,.still.in.progress.......
11de0 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 65 ............}..................e
11e00 6c 73 65 20 69 66 20 28 28 71 75 65 72 79 52 65 73 75 6c 74 20 26 20 28 6c 6f 6e 67 29 51 75 65 lse.if.((queryResult.&.(long)Que
11e20 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 52 65 73 75 6c ryPairedUserAccountCommand.Resul
11e40 74 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 43 61 6e 63 65 6c 65 64 29 20 t.UserAccountSelectionCanceled).
11e60 21 3d 20 30 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 !=.0)..................{........
11e80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 6f 74 20 63 61 6e 63 65 6c 65 64 2e 0d 0a ..............//.Got.canceled...
11ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 ....................Notify(userI
11ec0 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 53 65 6c ndex,.InputUserChange.AccountSel
11ee0 65 63 74 69 6f 6e 43 61 6e 63 65 6c 65 64 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 ectionCanceled,.device);........
11f00 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
11f20 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..................{............
11f40 20 20 20 20 20 20 20 20 20 20 2f 2f 20 59 65 73 2c 20 69 74 20 69 73 20 63 6f 6d 70 6c 65 74 65 ..........//.Yes,.it.is.complete
11f60 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 .......................s_AllUser
11f80 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 66 6c 61 67 73 20 26 3d 20 7e 55 73 65 72 46 6c Data[userIndex].flags.&=.~UserFl
11fa0 61 67 73 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e 50 72 6f 67 72 65 ags.UserAccountSelectionInProgre
11fc0 73 73 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 73 5f 41 6c 6c ss;........................s_All
11fe0 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 UserData[userIndex].platformUser
12000 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f AccountHandle.=.platformUserAcco
12020 75 6e 74 48 61 6e 64 6c 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 untHandle;......................
12040 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 s_AllUserData[userIndex].platfor
12060 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 20 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 mUserAccountName.=.platformUserA
12080 63 63 6f 75 6e 74 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 ccountName;.....................
120a0 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f .s_AllUserData[userIndex].platfo
120c0 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 20 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 rmUserAccountId.=.platformUserAc
120e0 63 6f 75 6e 74 49 64 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 countId;........................
12100 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 Notify(userIndex,.InputUserChang
12120 65 2e 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 43 6f 6d 70 6c 65 74 65 2c 20 64 65 76 69 e.AccountSelectionComplete,.devi
12140 63 65 29 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 20 20 20 ce);..................}.........
12160 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 .....}..............//.Check.if.
12180 75 73 65 72 20 61 63 63 6f 75 6e 74 20 64 65 74 61 69 6c 73 20 68 61 76 65 20 63 68 61 6e 67 65 user.account.details.have.change
121a0 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 73 5f 41 6c 6c 55 73 d...............else.if.(s_AllUs
121c0 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 erData[userIndex].platformUserAc
121e0 63 6f 75 6e 74 48 61 6e 64 6c 65 20 21 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 countHandle.!=.platformUserAccou
12200 6e 74 48 61 6e 64 6c 65 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntHandle.||.....................
12220 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 74 66 ..s_AllUserData[userIndex].platf
12240 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 20 21 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 ormUserAccountId.!=.platformUser
12260 41 63 63 6f 75 6e 74 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 AccountId)..............{.......
12280 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 ...........s_AllUserData[userInd
122a0 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 ex].platformUserAccountHandle.=.
122c0 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3b 0d 0a 20 20 20 20 platformUserAccountHandle;......
122e0 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e ............s_AllUserData[userIn
12300 64 65 78 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 20 3d 20 70 dex].platformUserAccountName.=.p
12320 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 latformUserAccountName;.........
12340 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 .........s_AllUserData[userIndex
12360 5d 2e 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 20 3d 20 70 6c 61 74 66 6f ].platformUserAccountId.=.platfo
12380 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rmUserAccountId;................
123a0 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 ....Notify(userIndex,.InputUserC
123c0 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 43 68 61 6e 67 65 64 2c 20 64 65 76 69 63 65 29 3b 0d 0a hange.AccountChanged,.device);..
123e0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 ............}..............else.
12400 69 66 20 28 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 6c 61 if.(s_AllUserData[userIndex].pla
12420 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 20 21 3d 20 70 6c 61 74 66 6f 72 6d tformUserAccountName.!=.platform
12440 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d UserAccountName)..............{.
12460 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 .................Notify(userInde
12480 78 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2e 41 63 63 6f 75 6e 74 4e 61 6d 65 43 68 x,.InputUserChange.AccountNameCh
124a0 61 6e 67 65 64 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a anged,.device);..............}..
124c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 71 75 65 72 79 52 65 73 75 6c 74 ..............return.queryResult
124e0 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 20 3c 73 75 6d ;..........}............///.<sum
12500 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 67 69 76 65 6e 20 mary>..........///.If.the.given.
12520 64 65 76 69 63 65 20 69 73 20 70 61 69 72 65 64 20 74 6f 20 61 20 75 73 65 72 20 61 63 63 6f 75 device.is.paired.to.a.user.accou
12540 6e 74 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 6c 65 76 65 6c 2c 20 72 65 74 75 72 6e nt.at.the.platform.level,.return
12560 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .the.platform.user..........///.
12580 61 63 63 6f 75 6e 74 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f account.details...........///.</
125a0 73 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 summary>..........///.<param.nam
125c0 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 79 20 69 6e 70 75 74 20 64 65 76 69 63 65 2e 3c 2f 70 61 e="device">Any.input.device.</pa
125e0 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 70 ram>..........///.<param.name="p
12600 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 22 3e 52 65 63 65 69 76 65 73 20 74 latformAccountHandle">Receives.t
12620 68 65 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 68 61 6e 64 6c 65 20 he.platform.user.account.handle.
12640 6f 72 20 6e 75 6c 6c 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 or.null.</param>..........///.<p
12660 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 4e 61 6d 65 22 3e aram.name="platformAccountName">
12680 52 65 63 65 69 76 65 73 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 Receives.the.platform.user.accou
126a0 6e 74 20 6e 61 6d 65 20 6f 72 20 6e 75 6c 6c 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 nt.name.or.null.</param>........
126c0 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 ..///.<param.name="platformAccou
126e0 6e 74 49 64 22 3e 52 65 63 65 69 76 65 73 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 ntId">Receives.the.platform.user
12700 20 61 63 63 6f 75 6e 74 20 49 44 20 6f 72 20 6e 75 6c 6c 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 .account.ID.or.null.</param>....
12720 20 20 20 20 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 64 ......///.<returns>True.if.the.d
12740 65 76 69 63 65 20 69 73 20 70 61 69 72 65 64 20 74 6f 20 61 20 75 73 65 72 20 61 63 63 6f 75 6e evice.is.paired.to.a.user.accoun
12760 74 2c 20 66 61 6c 73 65 20 6f 74 68 65 72 77 69 73 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 t,.false.otherwise.</returns>...
12780 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 20 2f 2f .......///.<remarks>..........//
127a0 2f 20 53 65 6e 64 73 20 3c 73 65 65 20 63 72 65 66 3d 22 51 75 65 72 79 50 61 69 72 65 64 55 73 /.Sends.<see.cref="QueryPairedUs
127c0 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 22 2f 3e 20 74 6f 20 74 68 65 20 64 65 76 69 63 erAccountCommand"/>.to.the.devic
127e0 65 2e 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 e...........///.</remarks>......
12800 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 51 75 65 72 79 50 61 69 72 ....///.<seealso.cref="QueryPair
12820 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 68 61 6e 64 6c 65 22 2f 3e 0d 0a edUserAccountCommand.handle"/>..
12840 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 51 75 65 72 79 ........///.<seealso.cref="Query
12860 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 6e 61 6d 65 22 2f 3e PairedUserAccountCommand.name"/>
12880 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 51 75 65 ..........///.<seealso.cref="Que
128a0 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 69 64 22 2f 3e ryPairedUserAccountCommand.id"/>
128c0 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 6c 6f 6e 67 20 51 75 ..........private.static.long.Qu
128e0 65 72 79 50 61 69 72 65 64 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 28 49 6e 70 eryPairedPlatformUserAccount(Inp
12900 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f 75 utDevice.device,..............ou
12920 74 20 49 6e 70 75 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3f 20 70 6c 61 74 66 6f t.InputUserAccountHandle?.platfo
12940 72 6d 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 2c 20 6f 75 74 20 73 74 72 69 6e 67 20 70 6c 61 74 rmAccountHandle,.out.string.plat
12960 66 6f 72 6d 41 63 63 6f 75 6e 74 4e 61 6d 65 2c 20 6f 75 74 20 73 74 72 69 6e 67 20 70 6c 61 74 formAccountName,.out.string.plat
12980 66 6f 72 6d 41 63 63 6f 75 6e 74 49 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 formAccountId)..........{.......
129a0 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 64 65 76 69 63 65 20 21 3d 20 6e 75 .......Debug.Assert(device.!=.nu
129c0 6c 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 51 75 65 72 79 20 75 73 65 ll);................//.Query.use
129e0 72 20 61 63 63 6f 75 6e 74 20 69 6e 66 6f 20 66 72 6f 6d 20 62 61 63 6b 65 6e 64 2e 0d 0a 20 20 r.account.info.from.backend.....
12a00 20 20 20 20 20 20 20 20 20 20 76 61 72 20 71 75 65 72 79 50 61 69 72 65 64 55 73 65 72 20 3d 20 ..........var.queryPairedUser.=.
12a20 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 2e 43 72 QueryPairedUserAccountCommand.Cr
12a40 65 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 73 75 6c 74 20 eate();..............var.result.
12a60 3d 20 64 65 76 69 63 65 2e 45 78 65 63 75 74 65 43 6f 6d 6d 61 6e 64 28 72 65 66 20 71 75 65 72 =.device.ExecuteCommand(ref.quer
12a80 79 50 61 69 72 65 64 55 73 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 yPairedUser);..............if.(r
12aa0 65 73 75 6c 74 20 3d 3d 20 49 6e 70 75 74 44 65 76 69 63 65 43 6f 6d 6d 61 6e 64 2e 47 65 6e 65 esult.==.InputDeviceCommand.Gene
12ac0 72 69 63 46 61 69 6c 75 72 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ricFailure)..............{......
12ae0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 ............//.Not.currently.pai
12b00 72 65 64 20 74 6f 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 69 6e 20 62 61 63 6b 65 6e 64 2e 0d red.to.user.account.in.backend..
12b20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 .................platformAccount
12b40 48 61 6e 64 6c 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 Handle.=.null;..................
12b60 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 4e 61 6d 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 platformAccountName.=.null;.....
12b80 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 49 64 20 3d .............platformAccountId.=
12ba0 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 49 .null;..................return.I
12bc0 6e 70 75 74 44 65 76 69 63 65 43 6f 6d 6d 61 6e 64 2e 47 65 6e 65 72 69 63 46 61 69 6c 75 72 65 nputDeviceCommand.GenericFailure
12be0 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 ;..............}................
12c00 2f 2f 20 53 75 63 63 65 73 73 2e 20 54 68 65 72 65 20 69 73 20 61 20 75 73 65 72 20 61 63 63 6f //.Success..There.is.a.user.acco
12c20 75 6e 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 64 65 76 69 unt.currently.paired.to.the.devi
12c40 63 65 20 61 6e 64 20 77 65 20 6e 6f 77 20 68 61 76 65 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 ce.and.we.now.have.the..........
12c60 20 20 20 20 2f 2f 20 70 6c 61 74 66 6f 72 6d 27 73 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 64 ....//.platform's.user.account.d
12c80 65 74 61 69 6c 73 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 72 65 73 75 etails.................if.((resu
12ca0 6c 74 20 26 20 28 6c 6f 6e 67 29 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e lt.&.(long)QueryPairedUserAccoun
12cc0 74 43 6f 6d 6d 61 6e 64 2e 52 65 73 75 6c 74 2e 44 65 76 69 63 65 50 61 69 72 65 64 54 6f 55 73 tCommand.Result.DevicePairedToUs
12ce0 65 72 41 63 63 6f 75 6e 74 29 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d erAccount).!=.0)..............{.
12d00 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 .................platformAccount
12d20 48 61 6e 64 6c 65 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 Handle.=......................ne
12d40 77 20 49 6e 70 75 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 28 64 65 76 69 63 65 2e w.InputUserAccountHandle(device.
12d60 64 65 73 63 72 69 70 74 69 6f 6e 2e 69 6e 74 65 72 66 61 63 65 4e 61 6d 65 20 3f 3f 20 22 3c 55 description.interfaceName.??."<U
12d80 6e 6b 6e 6f 77 6e 3e 22 2c 20 71 75 65 72 79 50 61 69 72 65 64 55 73 65 72 2e 68 61 6e 64 6c 65 nknown>",.queryPairedUser.handle
12da0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f );..................platformAcco
12dc0 75 6e 74 4e 61 6d 65 20 3d 20 71 75 65 72 79 50 61 69 72 65 64 55 73 65 72 2e 6e 61 6d 65 3b 0d untName.=.queryPairedUser.name;.
12de0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 .................platformAccount
12e00 49 64 20 3d 20 71 75 65 72 79 50 61 69 72 65 64 55 73 65 72 2e 69 64 3b 0d 0a 20 20 20 20 20 20 Id.=.queryPairedUser.id;........
12e20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 ......}..............else.......
12e40 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 54 68 65 .......{..................//.The
12e60 20 64 65 76 69 63 65 20 73 75 70 70 6f 72 74 73 20 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 .device.supports.QueryPairedUser
12e80 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 6e 64 20 62 75 74 20 72 65 70 6f 72 74 73 20 74 68 61 74 20 AccountCommand.but.reports.that.
12ea0 74 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 64 65 76 69 63 65 20 69 the..................//.device.i
12ec0 73 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 70 61 69 72 65 64 20 74 6f 20 61 20 75 73 65 72 s.not.currently.paired.to.a.user
12ee0 2e 0d 0a 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 20 20 20 20 ...................//...........
12f00 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 4f 6e 20 53 77 69 74 63 68 2c 20 77 68 65 72 65 .......//.NOTE:.On.Switch,.where
12f20 20 74 68 65 20 73 79 73 74 65 6d 20 69 74 73 65 6c 66 20 64 6f 65 73 20 6e 6f 74 20 73 74 6f 72 .the.system.itself.does.not.stor
12f40 65 20 61 63 63 6f 75 6e 74 3c 2d 3e 70 61 69 72 69 6e 67 2c 20 77 65 20 77 69 6c 6c 20 61 6c 77 e.account<->pairing,.we.will.alw
12f60 61 79 73 0d 0a 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 65 6e ays..................//.......en
12f80 64 20 75 70 20 68 65 72 65 20 75 6e 74 69 6c 20 77 65 27 76 65 20 69 6e 69 74 69 61 74 65 64 20 d.up.here.until.we've.initiated.
12fa0 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 20 74 68 72 6f 75 67 68 20 74 68 65 an.account.selection.through.the
12fc0 20 62 61 63 6b 65 6e 64 20 69 74 73 65 6c 66 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .backend.itself.................
12fe0 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 6e 75 6c 6c 3b 0d ..platformAccountHandle.=.null;.
13000 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6c 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 .................platformAccount
13020 4e 61 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 70 6c Name.=.null;..................pl
13040 61 74 66 6f 72 6d 41 63 63 6f 75 6e 74 49 64 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 atformAccountId.=.null;.........
13060 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 72 65 73 .....}................return.res
13080 75 6c 74 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 20 3c ult;..........}............///.<
130a0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 72 79 20 74 6f 20 69 6e 69 summary>..........///.Try.to.ini
130c0 74 69 61 74 65 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 70 61 69 72 69 6e 67 20 66 6f 72 20 74 tiate.user.account.pairing.for.t
130e0 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 he.given.device.at.the.platform.
13100 6c 65 76 65 6c 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 0a level...........///.</summary>..
13120 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 64 65 76 69 63 65 22 ........///.<param.name="device"
13140 3e 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 3e ></param>..........///.<returns>
13160 54 72 75 65 20 69 66 20 74 68 65 20 64 65 76 69 63 65 20 61 63 63 65 70 74 65 64 20 74 68 65 20 True.if.the.device.accepted.the.
13180 72 65 71 75 65 73 74 20 61 6e 64 20 61 6e 20 61 63 63 6f 75 6e 74 20 70 69 63 6b 65 72 20 68 61 request.and.an.account.picker.ha
131a0 73 20 62 65 65 6e 20 72 61 69 73 65 64 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 s.been.raised.</returns>........
131c0 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 6e ..///.<remarks>..........///.Sen
131e0 64 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e ds.<see.cref="InitiateUserAccoun
13200 74 50 61 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 22 2f 3e 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 tPairingCommand"/>.to.the.device
13220 2e 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>.......
13240 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 6e 69 74 69 61 74 65 55 ...private.static.bool.InitiateU
13260 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 41 74 50 6c 61 74 66 6f 72 6d 4c 65 76 serAccountSelectionAtPlatformLev
13280 65 6c 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 el(InputDevice.device)..........
132a0 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 64 65 76 69 {..............Debug.Assert(devi
132c0 63 65 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 76 61 72 20 ce.!=.null);................var.
132e0 69 6e 69 74 69 61 74 65 55 73 65 72 50 61 69 72 69 6e 67 20 3d 20 49 6e 69 74 69 61 74 65 55 73 initiateUserPairing.=.InitiateUs
13300 65 72 41 63 63 6f 75 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 2e 43 72 65 61 74 65 28 29 erAccountPairingCommand.Create()
13320 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e 69 74 69 61 74 65 50 61 69 72 69 ;..............var.initiatePairi
13340 6e 67 52 65 73 75 6c 74 20 3d 20 64 65 76 69 63 65 2e 45 78 65 63 75 74 65 43 6f 6d 6d 61 6e 64 ngResult.=.device.ExecuteCommand
13360 28 72 65 66 20 69 6e 69 74 69 61 74 65 55 73 65 72 50 61 69 72 69 6e 67 29 3b 0d 0a 20 20 20 20 (ref.initiateUserPairing);......
13380 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 69 74 69 61 74 65 50 61 69 72 69 6e 67 52 65 73 75 6c ........if.(initiatePairingResul
133a0 74 20 3d 3d 20 28 6c 6f 6e 67 29 49 6e 69 74 69 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 50 61 t.==.(long)InitiateUserAccountPa
133c0 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 2e 52 65 73 75 6c 74 2e 45 72 72 6f 72 41 6c 72 65 61 64 79 iringCommand.Result.ErrorAlready
133e0 49 6e 50 72 6f 67 72 65 73 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 InProgress)..................thr
13400 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e ow.new.InvalidOperationException
13420 28 22 55 73 65 72 20 70 61 69 72 69 6e 67 20 61 6c 72 65 61 64 79 20 69 6e 20 70 72 6f 67 72 65 ("User.pairing.already.in.progre
13440 73 73 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 6e 69 74 ss");................return.init
13460 69 61 74 65 50 61 69 72 69 6e 67 52 65 73 75 6c 74 20 3d 3d 20 28 6c 6f 6e 67 29 49 6e 69 74 69 iatePairingResult.==.(long)Initi
13480 61 74 65 55 73 65 72 41 63 63 6f 75 6e 74 50 61 69 72 69 6e 67 43 6f 6d 6d 61 6e 64 2e 52 65 73 ateUserAccountPairingCommand.Res
134a0 75 6c 74 2e 53 75 63 63 65 73 73 66 75 6c 6c 79 49 6e 69 74 69 61 74 65 64 3b 0d 0a 20 20 20 20 ult.SuccessfullyInitiated;......
134c0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 ....}............private.static.
134e0 76 6f 69 64 20 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 28 6f 62 6a 65 63 74 20 6f 62 6a 2c 20 void.OnActionChange(object.obj,.
13500 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 20 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 InputActionChange.change).......
13520 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 6e 67 65 20 3d 3d 20 ...{..............if.(change.==.
13540 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 42 6f 75 6e 64 43 6f 6e 74 72 6f 6c 73 43 InputActionChange.BoundControlsC
13560 68 61 6e 67 65 64 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 hanged)..............{..........
13580 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 73 5f 41 6c ........for.(var.i.=.0;.i.<.s_Al
135a0 6c 55 73 65 72 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 20 20 lUserCount;.++i)................
135c0 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 66 20 76 61 72 ..{......................ref.var
135e0 20 75 73 65 72 20 3d 20 72 65 66 20 73 5f 41 6c 6c 55 73 65 72 73 5b 69 5d 3b 0d 0a 20 20 20 20 .user.=.ref.s_AllUsers[i];......
13600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 52 65 66 65 72 65 6e 63 65 45 71 75 ................if.(ReferenceEqu
13620 61 6c 73 28 75 73 65 72 2e 61 63 74 69 6f 6e 73 2c 20 6f 62 6a 29 29 0d 0a 20 20 20 20 20 20 20 als(user.actions,.obj)).........
13640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 74 69 66 79 28 69 2c 20 49 6e 70 75 74 .................Notify(i,.Input
13660 55 73 65 72 43 68 61 6e 67 65 2e 43 6f 6e 74 72 6f 6c 73 43 68 61 6e 67 65 64 2c 20 6e 75 6c 6c UserChange.ControlsChanged,.null
13680 29 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 20 20 20 20 20 );..................}...........
136a0 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 2f 2f 2f 20 3c ...}..........}............///.<
136c0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 76 6f 6b 65 64 20 69 6e summary>..........///.Invoked.in
136e0 20 72 65 73 70 6f 6e 73 65 20 74 6f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 79 73 .response.to.<see.cref="InputSys
13700 74 65 6d 2e 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 tem.onDeviceChange"/>...........
13720 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 20 3c 70 61 72 ///.</summary>..........///.<par
13740 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 am.name="device"></param>.......
13760 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 68 61 6e 67 65 22 3e 3c 2f 70 61 ...///.<param.name="change"></pa
13780 72 61 6d 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 ram>..........///.<remarks>.....
137a0 20 20 20 20 20 2f 2f 2f 20 57 65 20 6d 6f 6e 69 74 6f 72 20 74 68 65 20 64 65 76 69 63 65 20 73 .....///.We.monitor.the.device.s
137c0 65 74 75 70 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 66 6f 72 20 61 63 74 69 76 69 74 79 20 etup.in.the.system.for.activity.
137e0 74 68 61 74 20 69 6d 70 61 63 74 73 20 74 68 65 20 75 73 65 72 20 73 65 74 75 70 2e 0d 0a 20 20 that.impacts.the.user.setup.....
13800 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 20 20 20 70 72 ......///.</remarks>..........pr
13820 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 ivate.static.void.OnDeviceChange
13840 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 49 6e 70 75 74 44 65 76 69 63 65 (InputDevice.device,.InputDevice
13860 43 68 61 6e 67 65 20 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 Change.change)..........{.......
13880 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 20 20 20 .......switch.(change)..........
138a0 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 45 78 69 73 74 69 ....{..................//.Existi
138c0 6e 67 20 64 65 76 69 63 65 20 72 65 6d 6f 76 65 64 2e 20 4d 61 79 20 6d 65 61 6e 20 61 20 75 73 ng.device.removed..May.mean.a.us
138e0 65 72 20 68 61 73 20 6c 6f 73 74 20 61 20 64 65 76 69 63 65 20 64 75 65 20 74 6f 20 74 68 65 20 er.has.lost.a.device.due.to.the.
13900 62 61 74 74 65 72 79 20 72 75 6e 6e 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 battery.running.................
13920 20 2f 2f 20 6f 75 74 20 6f 72 20 74 68 65 20 64 65 76 69 63 65 20 62 65 69 6e 67 20 75 6e 70 6c .//.out.or.the.device.being.unpl
13940 75 67 67 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a ugged...................//.NOTE:
13960 20 57 65 20 69 67 6e 6f 72 65 20 44 69 73 63 6f 6e 6e 65 63 74 65 64 20 68 65 72 65 2e 20 52 65 .We.ignore.Disconnected.here..Re
13980 6d 6f 76 65 64 20 69 73 20 77 68 61 74 20 67 65 74 73 20 73 65 6e 74 20 77 68 65 6e 65 76 65 72 moved.is.what.gets.sent.whenever
139a0 20 61 20 64 65 76 69 63 65 20 69 73 20 74 61 6b 65 6e 20 6f 66 66 20 6f 66 0d 0a 20 20 20 20 20 .a.device.is.taken.off.of.......
139c0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e ...........//.......InputSystem.
139e0 64 65 76 69 63 65 73 20 2d 2d 20 77 68 69 63 68 20 69 73 20 77 68 61 74 20 77 65 27 72 65 20 69 devices.--.which.is.what.we're.i
13a00 6e 74 65 72 65 73 74 65 64 20 69 6e 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nterested.in.here...............
13a20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 52 65 6d 6f 76 ....case.InputDeviceChange.Remov
13a40 65 64 3a 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 ed:..................{..........
13a60 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 75 6c 64 20 68 61 76 65 20 62 65 65 6e 20 72 ............//.Could.have.been.r
13a80 65 6d 6f 76 65 64 20 66 72 6f 6d 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 2e 20 52 65 70 65 emoved.from.multiple.users..Repe
13aa0 61 74 65 64 6c 79 20 73 65 61 72 63 68 20 69 6e 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 atedly.search.in.s_AllPairedDevi
13ac0 63 65 73 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 75 6e 74 69 ces......................//.unti
13ae0 6c 20 77 65 20 63 61 6e 27 74 20 66 69 6e 64 20 74 68 65 20 64 65 76 69 63 65 20 61 6e 79 6d 6f l.we.can't.find.the.device.anymo
13b00 72 65 2e 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 64 65 76 re.......................var.dev
13b20 69 63 65 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 65 78 4f 66 52 iceIndex.=.ArrayHelpers.IndexOfR
13b40 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 64 65 76 eference(s_AllPairedDevices,.dev
13b60 69 63 65 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 ice,.s_AllPairedDeviceCount);...
13b80 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 64 65 76 69 63 65 ...................while.(device
13ba0 49 6e 64 65 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Index.!=.-1)....................
13bc0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ..{..........................//.
13be0 46 69 6e 64 20 75 73 65 72 2e 20 4d 75 73 74 20 62 65 20 74 68 65 72 65 20 61 73 20 77 65 20 66 Find.user..Must.be.there.as.we.f
13c00 6f 75 6e 64 20 74 68 65 20 64 65 76 69 63 65 20 69 6e 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 ound.the.device.in.s_AllPairedDe
13c20 76 69 63 65 73 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 vices...........................
13c40 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 var.userIndex.=.-1;.............
13c60 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 3c .............for.(var.i.=.0;.i.<
13c80 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 .s_AllUserCount;.++i)...........
13ca0 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 ...............{................
13cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 ..............var.deviceStartInd
13ce0 65 78 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 72 ex.=.s_AllUserData[i].deviceStar
13d00 74 49 6e 64 65 78 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 tIndex;.........................
13d20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3c 3d 20 64 65 76 .....if.(deviceStartIndex.<=.dev
13d40 69 63 65 49 6e 64 65 78 20 26 26 20 64 65 76 69 63 65 49 6e 64 65 78 20 3c 20 64 65 76 69 63 65 iceIndex.&&.deviceIndex.<.device
13d60 53 74 61 72 74 49 6e 64 65 78 20 2b 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 StartIndex.+.s_AllUserData[i].de
13d80 76 69 63 65 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 viceCount)......................
13da0 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 20 ........{.......................
13dc0 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 3b 0d 0a 20 20 20 20 20 ...........userIndex.=.i;.......
13de0 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 61 6b ...........................break
13e00 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 20 7d ;..............................}
13e20 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 0a 20 ..........................}.....
13e40 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 41 64 64 20 64 65 .......................//.Add.de
13e60 76 69 63 65 20 74 6f 20 6c 69 73 74 20 6f 66 20 6c 6f 73 74 20 64 65 76 69 63 65 73 2e 0d 0a 20 vice.to.list.of.lost.devices....
13e80 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 4e 4f 54 45 3a 20 .......................//.NOTE:.
13ea0 54 68 69 73 20 77 69 6c 6c 20 61 6c 73 6f 20 73 65 6e 64 20 61 20 44 65 76 69 63 65 4c 6f 73 74 This.will.also.send.a.DeviceLost
13ec0 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .notification...................
13ee0 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 54 65 6d 70 6f 72 61 72 69 6c 79 20 74 68 65 ........//.NOTE:.Temporarily.the
13f00 20 64 65 76 69 63 65 20 69 73 20 6f 6e 20 62 6f 74 68 20 6c 69 73 74 73 2e 0d 0a 20 20 20 20 20 .device.is.on.both.lists........
13f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 64 64 44 65 76 69 63 65 54 6f 55 73 ...................AddDeviceToUs
13f40 65 72 28 75 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 2c 20 61 73 4c 6f 73 74 44 65 76 69 er(userIndex,.device,.asLostDevi
13f60 63 65 3a 20 74 72 75 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ce:.true);......................
13f80 20 20 20 20 20 20 2f 2f 20 52 65 6d 6f 76 65 20 69 74 20 66 72 6f 6d 20 74 68 65 20 75 73 65 72 ......//.Remove.it.from.the.user
13fa0 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 52 65 6d 6f 76 ...........................Remov
13fc0 65 44 65 76 69 63 65 46 72 6f 6d 55 73 65 72 28 75 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 eDeviceFromUser(userIndex,.devic
13fe0 65 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 2f e);............................/
14000 2f 20 53 65 61 72 63 68 20 66 6f 72 20 61 6e 6f 74 68 65 72 20 75 73 65 72 20 70 61 69 72 65 64 /.Search.for.another.user.paired
14020 20 74 6f 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 .to.the.same.device.............
14040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 0d 0a 20 20 20 ..............deviceIndex.=.....
14060 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 41 72 72 61 79 48 65 .........................ArrayHe
14080 6c 70 65 72 73 2e 49 6e 64 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 lpers.IndexOfReference(s_AllPair
140a0 65 64 44 65 76 69 63 65 73 2c 20 64 65 76 69 63 65 2c 20 64 65 76 69 63 65 49 6e 64 65 78 20 2b edDevices,.device,.deviceIndex.+
140c0 20 31 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 .1,.s_AllPairedDeviceCount);....
140e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................}.............
14100 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;.................
14120 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 4e 65 77 20 64 65 76 .}....................//.New.dev
14140 69 63 65 20 77 61 73 20 61 64 64 65 64 2e 20 53 65 65 20 69 66 20 69 74 20 77 61 73 20 61 20 64 ice.was.added..See.if.it.was.a.d
14160 65 76 69 63 65 20 77 65 20 70 72 65 76 69 6f 75 73 6c 79 20 6c 6f 73 74 20 6f 6e 20 61 20 75 73 evice.we.previously.lost.on.a.us
14180 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 er...................case.InputD
141a0 65 76 69 63 65 43 68 61 6e 67 65 2e 41 64 64 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 eviceChange.Added:..............
141c0 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 43 6f ....{......................//.Co
141e0 75 6c 64 20 62 65 20 61 20 70 72 65 76 69 6f 75 73 6c 79 20 6c 6f 73 74 20 64 65 76 69 63 65 2e uld.be.a.previously.lost.device.
14200 20 43 6f 75 6c 64 20 61 66 66 65 63 74 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 2e 20 52 65 .Could.affect.multiple.users..Re
14220 70 65 61 74 65 64 6c 79 20 73 65 61 72 63 68 20 69 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 peatedly.search.in..............
14240 20 20 20 20 20 20 20 20 2f 2f 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 20 75 6e 74 69 ........//.s_AllLostDevices.unti
14260 6c 20 77 65 20 63 61 6e 27 74 20 66 69 6e 64 20 74 68 65 20 64 65 76 69 63 65 20 61 6e 79 6d 6f l.we.can't.find.the.device.anymo
14280 72 65 2e 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 64 65 76 re.......................var.dev
142a0 69 63 65 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 65 78 4f 66 52 iceIndex.=.ArrayHelpers.IndexOfR
142c0 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2c 20 64 65 76 69 63 eference(s_AllLostDevices,.devic
142e0 65 2c 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 e,.s_AllLostDeviceCount);.......
14300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 64 65 76 69 63 65 49 6e 64 65 ...............while.(deviceInde
14320 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d x.!=.-1)......................{.
14340 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 46 69 6e 64 .........................//.Find
14360 20 75 73 65 72 2e 20 4d 75 73 74 20 62 65 20 74 68 65 72 65 20 61 73 20 77 65 20 66 6f 75 6e 64 .user..Must.be.there.as.we.found
14380 20 74 68 65 20 64 65 76 69 63 65 20 69 6e 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 2e .the.device.in.s_AllLostDevices.
143a0 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 75 73 ..........................var.us
143c0 65 72 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 erIndex.=.-1;...................
143e0 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 73 5f 41 6c 6c .......for.(var.i.=.0;.i.<.s_All
14400 55 73 65 72 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 20 20 20 UserCount;.++i).................
14420 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 .........{......................
14440 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3d 20 73 ........var.deviceStartIndex.=.s
14460 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 6c 6f 73 74 44 65 76 69 63 65 53 74 61 72 74 49 _AllUserData[i].lostDeviceStartI
14480 6e 64 65 78 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 ndex;...........................
144a0 20 20 20 69 66 20 28 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3c 3d 20 64 65 76 69 63 ...if.(deviceStartIndex.<=.devic
144c0 65 49 6e 64 65 78 20 26 26 20 64 65 76 69 63 65 49 6e 64 65 78 20 3c 20 64 65 76 69 63 65 53 74 eIndex.&&.deviceIndex.<.deviceSt
144e0 61 72 74 49 6e 64 65 78 20 2b 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 6c 6f 73 74 artIndex.+.s_AllUserData[i].lost
14500 44 65 76 69 63 65 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 DeviceCount)....................
14520 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 ..........{.....................
14540 20 20 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 49 6e 64 65 78 20 3d 20 69 3b 0d 0a 20 20 20 .............userIndex.=.i;.....
14560 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
14580 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;.............................
145a0 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 .}..........................}...
145c0 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 52 65 6d 6f .........................//.Remo
145e0 76 65 20 66 72 6f 6d 20 6c 69 73 74 20 6f 66 20 6c 6f 73 74 20 64 65 76 69 63 65 73 2e 20 4e 6f ve.from.list.of.lost.devices..No
14600 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .notification...................
14620 20 20 20 20 20 20 20 20 52 65 6d 6f 76 65 44 65 76 69 63 65 46 72 6f 6d 55 73 65 72 28 75 73 65 ........RemoveDeviceFromUser(use
14640 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 2c 20 61 73 4c 6f 73 74 44 65 76 69 63 65 3a 20 74 72 rIndex,.device,.asLostDevice:.tr
14660 75 65 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 ue);............................
14680 2f 2f 20 4e 6f 74 69 66 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 //.Notify.......................
146a0 20 20 20 20 4e 6f 74 69 66 79 28 75 73 65 72 49 6e 64 65 78 2c 20 49 6e 70 75 74 55 73 65 72 43 ....Notify(userIndex,.InputUserC
146c0 68 61 6e 67 65 2e 44 65 76 69 63 65 52 65 67 61 69 6e 65 64 2c 20 64 65 76 69 63 65 29 3b 0d 0a hange.DeviceRegained,.device);..
146e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 ..........................//.Add
14700 20 62 61 63 6b 20 61 73 20 6e 6f 72 6d 61 6c 6c 79 20 70 61 69 72 65 64 20 64 65 76 69 63 65 2e .back.as.normally.paired.device.
14720 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 41 64 64 44 65 76 ..........................AddDev
14740 69 63 65 54 6f 55 73 65 72 28 75 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 29 3b 0d 0a 0d iceToUser(userIndex,.device);...
14760 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 53 65 61 72 .........................//.Sear
14780 63 68 20 66 6f 72 20 61 6e 6f 74 68 65 72 20 75 73 65 72 20 77 68 6f 20 68 61 64 20 6c 6f 73 74 ch.for.another.user.who.had.lost
147a0 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .the.same.device................
147c0 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 0d 0a 20 20 20 20 20 20 ...........deviceIndex.=........
147e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 ......................ArrayHelpe
14800 72 73 2e 49 6e 64 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 rs.IndexOfReference(s_AllLostDev
14820 69 63 65 73 2c 20 64 65 76 69 63 65 2c 20 64 65 76 69 63 65 49 6e 64 65 78 20 2b 20 31 2c 20 73 ices,.device,.deviceIndex.+.1,.s
14840 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 _AllLostDeviceCount);...........
14860 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 20 20 ...........}....................
14880 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 7d 0d 0a 0d 0a 20 ..break;..................}.....
148a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 44 65 76 69 63 65 20 68 61 64 20 69 74 73 ...............//.Device.had.its
148c0 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 63 68 61 6e 67 65 64 20 77 68 69 63 68 20 6d 61 79 .configuration.changed.which.may
148e0 20 6d 65 61 6e 20 77 65 20 68 61 76 65 20 61 20 64 69 66 66 65 72 65 6e 74 20 75 73 65 72 20 61 .mean.we.have.a.different.user.a
14900 63 63 6f 75 6e 74 20 70 61 69 72 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ccount.paired................../
14920 2f 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 /.to.the.device.now.............
14940 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 43 6f 6e ......case.InputDeviceChange.Con
14960 66 69 67 75 72 61 74 69 6f 6e 43 68 61 6e 67 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 figurationChanged:..............
14980 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 53 65 ....{......................//.Se
149a0 65 20 69 66 20 74 68 65 20 74 68 69 73 20 69 73 20 61 20 64 65 76 69 63 65 20 74 68 61 74 20 77 e.if.the.this.is.a.device.that.w
149c0 65 20 77 65 72 65 20 77 61 69 74 69 6e 67 20 66 6f 72 20 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 e.were.waiting.for.an.account.se
149e0 6c 65 63 74 69 6f 6e 20 6f 6e 2e 20 49 66 20 73 6f 2c 20 70 61 69 72 0d 0a 20 20 20 20 20 20 20 lection.on..If.so,.pair.........
14a00 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 69 74 20 74 6f 20 74 68 65 20 75 73 65 72 20 74 .............//.it.to.the.user.t
14a20 68 61 74 20 77 61 73 20 77 61 69 74 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 hat.was.waiting.................
14a40 20 20 20 20 20 20 76 61 72 20 77 61 73 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 ......var.wasOngoingAccountSelec
14a60 74 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tion.=.false;...................
14a80 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 5f 4f 6e 67 6f 69 6e 67 ...for.(var.i.=.0;.i.<.s_Ongoing
14aa0 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 2e 6c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d 0a AccountSelections.length;.++i)..
14ac0 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 ....................{...........
14ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f ...............if.(s_OngoingAcco
14b00 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 5b 69 5d 2e 64 65 76 69 63 65 20 21 3d 20 64 65 76 69 63 untSelections[i].device.!=.devic
14b20 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)..............................
14b40 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 continue;.......................
14b60 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 6e 65 77 20 49 6e 70 75 74 55 73 .....var.userIndex.=.new.InputUs
14b80 65 72 20 7b 20 6d 5f 49 64 20 3d 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 er.{.m_Id.=.s_OngoingAccountSele
14ba0 63 74 69 6f 6e 73 5b 69 5d 2e 75 73 65 72 49 64 20 7d 2e 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 ctions[i].userId.}.index;.......
14bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 71 75 65 72 79 52 65 73 75 ...................var.queryResu
14be0 6c 74 20 3d 20 55 70 64 61 74 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 28 75 lt.=.UpdatePlatformUserAccount(u
14c00 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 serIndex,.device);..............
14c20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 71 75 65 72 79 52 65 73 75 6c 74 20 26 20 28 ............if.((queryResult.&.(
14c40 6c 6f 6e 67 29 51 75 65 72 79 50 61 69 72 65 64 55 73 65 72 41 63 63 6f 75 6e 74 43 6f 6d 6d 61 long)QueryPairedUserAccountComma
14c60 6e 64 2e 52 65 73 75 6c 74 2e 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 49 6e nd.Result.UserAccountSelectionIn
14c80 50 72 6f 67 72 65 73 73 29 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Progress).==.0).................
14ca0 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 .........{......................
14cc0 20 20 20 20 20 20 20 20 77 61 73 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 ........wasOngoingAccountSelecti
14ce0 6f 6e 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 20 20 20 on.=.true;......................
14d00 20 20 20 20 20 20 20 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f ........s_OngoingAccountSelectio
14d20 6e 73 2e 52 65 6d 6f 76 65 41 74 42 79 4d 6f 76 69 6e 67 54 61 69 6c 57 69 74 68 43 61 70 61 63 ns.RemoveAtByMovingTailWithCapac
14d40 69 74 79 28 69 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 ity(i);.........................
14d60 20 20 20 20 20 2d 2d 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .....--i;.......................
14d80 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 77 61 73 6e 27 74 .........//.If.the.device.wasn't
14da0 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 2c 20 70 61 69 72 20 69 74 20 6e 6f 77 .paired.to.the.user,.pair.it.now
14dc0 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 20 20 20 20 69 ...............................i
14de0 66 20 28 21 73 5f 41 6c 6c 55 73 65 72 73 5b 75 73 65 72 49 6e 64 65 78 5d 2e 70 61 69 72 65 64 f.(!s_AllUsers[userIndex].paired
14e00 44 65 76 69 63 65 73 2e 43 6f 6e 74 61 69 6e 73 52 65 66 65 72 65 6e 63 65 28 64 65 76 69 63 65 Devices.ContainsReference(device
14e20 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 20 ))..............................
14e40 20 20 20 20 41 64 64 44 65 76 69 63 65 54 6f 55 73 65 72 28 75 73 65 72 49 6e 64 65 78 2c 20 64 ....AddDeviceToUser(userIndex,.d
14e60 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 evice);.........................
14e80 20 7d 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 0d 0a 20 20 20 .}......................}.......
14ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 20 77 61 73 6e 27 74 .................//.If.it.wasn't
14ec0 20 61 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 63 68 61 6e 67 65 20 65 76 65 6e 74 20 66 72 .a.configuration.change.event.fr
14ee0 6f 6d 20 61 6e 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 74 69 6f 6e 2c 20 67 6f 20 61 6e 64 20 om.an.account.selection,.go.and.
14f00 63 68 65 63 6b 20 77 68 65 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 check.whether...................
14f20 20 20 20 2f 2f 20 74 68 65 72 65 20 77 61 73 20 61 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 63 ...//.there.was.a.user.account.c
14f40 68 61 6e 67 65 20 74 68 61 74 20 68 61 70 70 65 6e 65 64 20 6f 75 74 73 69 64 65 20 74 68 65 20 hange.that.happened.outside.the.
14f60 61 70 70 6c 69 63 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 application.....................
14f80 20 20 69 66 20 28 21 77 61 73 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f ..if.(!wasOngoingAccountSelectio
14fa0 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 n)......................{.......
14fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 75 6c 64 20 62 65 20 70 ...................//.Could.be.p
14fe0 61 69 72 65 64 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 75 73 65 72 73 2e 20 52 65 70 65 61 74 65 aired.to.multiple.users..Repeate
15000 64 6c 79 20 73 65 61 72 63 68 20 69 6e 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 dly.search.in.s_AllPairedDevices
15020 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 75 6e 74 ..........................//.unt
15040 69 6c 20 77 65 20 63 61 6e 27 74 20 66 69 6e 64 20 74 68 65 20 64 65 76 69 63 65 20 61 6e 79 6d il.we.can't.find.the.device.anym
15060 6f 72 65 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 76 61 ore...........................va
15080 72 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 r.deviceIndex.=.ArrayHelpers.Ind
150a0 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 exOfReference(s_AllPairedDevices
150c0 2c 20 64 65 76 69 63 65 2c 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 ,.device,.s_AllPairedDeviceCount
150e0 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 77 68 69 6c );..........................whil
15100 65 20 28 64 65 76 69 63 65 49 6e 64 65 78 20 21 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 e.(deviceIndex.!=.-1)...........
15120 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 ...............{................
15140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 75 73 65 72 2e 20 4d 75 73 74 ..............//.Find.user..Must
15160 20 62 65 20 74 68 65 72 65 20 61 73 20 77 65 20 66 6f 75 6e 64 20 74 68 65 20 64 65 76 69 63 65 .be.there.as.we.found.the.device
15180 20 69 6e 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 .in.s_AllPairedDevices..........
151a0 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 75 73 65 72 49 6e 64 .....................var.userInd
151c0 65 78 20 3d 20 2d 31 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 ex.=.-1;........................
151e0 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 73 5f 41 6c 6c 55 ......for.(var.i.=.0;.i.<.s_AllU
15200 73 65 72 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 20 20 20 20 serCount;.++i)..................
15220 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 ............{...................
15240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 53 74 61 72 74 49 6e ...............var.deviceStartIn
15260 64 65 78 20 3d 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 64 65 76 69 63 65 53 74 61 dex.=.s_AllUserData[i].deviceSta
15280 72 74 49 6e 64 65 78 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 rtIndex;........................
152a0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 3c ..........if.(deviceStartIndex.<
152c0 3d 20 64 65 76 69 63 65 49 6e 64 65 78 20 26 26 20 64 65 76 69 63 65 49 6e 64 65 78 20 3c 20 64 =.deviceIndex.&&.deviceIndex.<.d
152e0 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 20 2b 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b eviceStartIndex.+.s_AllUserData[
15300 69 5d 2e 64 65 76 69 63 65 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 i].deviceCount).................
15320 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 .................{..............
15340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 49 6e 64 65 ........................userInde
15360 78 20 3d 20 69 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 x.=.i;..........................
15380 20 20 20 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 ............break;..............
153a0 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 20 ....................}...........
153c0 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 ...................}............
153e0 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 75 73 65 ....................//.Check.use
15400 72 20 61 63 63 6f 75 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 r.account.......................
15420 20 20 20 20 20 20 20 20 55 70 64 61 74 65 50 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e ........UpdatePlatformUserAccoun
15440 74 28 75 73 65 72 49 6e 64 65 78 2c 20 64 65 76 69 63 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 t(userIndex,.device);...........
15460 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 65 61 72 63 68 20 66 .....................//.Search.f
15480 6f 72 20 61 6e 6f 74 68 65 72 20 75 73 65 72 20 70 61 69 72 65 64 20 74 6f 20 74 68 65 20 73 61 or.another.user.paired.to.the.sa
154a0 6d 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 me.device.......................
154c0 20 20 20 20 20 20 20 20 64 65 76 69 63 65 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 ........deviceIndex.=.ArrayHelpe
154e0 72 73 2e 49 6e 64 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 rs.IndexOfReference(s_AllPairedD
15500 65 76 69 63 65 73 2c 20 64 65 76 69 63 65 2c 20 64 65 76 69 63 65 49 6e 64 65 78 20 2b 20 31 2c evices,.device,.deviceIndex.+.1,
15520 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 .s_AllPairedDeviceCount);.......
15540 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 ...................}............
15560 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 ..........}.....................
15580 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 7d 0d 0a 20 20 20 20 .break;..................}......
155a0 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 ........}..........}............
155c0 2f 2f 20 57 65 20 68 6f 6f 6b 20 74 68 69 73 20 69 6e 74 6f 20 49 6e 70 75 74 53 79 73 74 65 6d //.We.hook.this.into.InputSystem
155e0 2e 6f 6e 45 76 65 6e 74 20 77 68 65 6e 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f 72 20 61 63 74 69 .onEvent.when.listening.for.acti
15600 76 69 74 79 20 6f 6e 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 vity.on.unpaired.devices........
15620 20 20 20 2f 2f 20 57 68 61 74 20 74 68 69 73 20 6d 65 61 6e 73 20 69 73 20 74 68 61 74 20 77 65 ...//.What.this.means.is.that.we
15640 20 67 65 74 20 74 6f 20 72 75 6e 20 2a 62 65 66 6f 72 65 2a 20 73 74 61 74 65 20 72 65 61 63 68 .get.to.run.*before*.state.reach
15660 65 73 20 74 68 65 20 64 65 76 69 63 65 2e 20 54 68 69 73 20 69 6e 20 74 75 72 6e 0d 0a 20 20 20 es.the.device..This.in.turn.....
15680 20 20 20 20 20 2f 2f 20 6d 65 61 6e 73 20 74 68 61 74 20 73 68 6f 75 6c 64 20 74 68 65 20 64 65 .....//.means.that.should.the.de
156a0 76 69 63 65 20 67 65 74 20 70 61 69 72 65 64 20 61 73 20 61 20 72 65 73 75 6c 74 2c 20 61 63 74 vice.get.paired.as.a.result,.act
156c0 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 65 6e 61 62 6c 65 64 20 61 73 20 70 61 72 74 0d 0a 20 ions.that.are.enabled.as.part...
156e0 20 20 20 20 20 20 20 2f 2f 20 6f 66 20 74 68 65 20 70 61 69 72 69 6e 67 20 77 69 6c 6c 20 69 6d .......//.of.the.pairing.will.im
15700 6d 65 64 69 61 74 65 6c 79 20 67 65 74 20 74 72 69 67 67 65 72 65 64 2e 20 54 68 69 73 20 77 6f mediately.get.triggered..This.wo
15720 75 6c 64 20 6e 6f 74 20 62 65 20 74 68 65 20 63 61 73 65 20 69 66 20 77 65 20 68 6f 6f 6b 0d 0a uld.not.be.the.case.if.we.hook..
15740 20 20 20 20 20 20 20 20 2f 2f 20 69 6e 74 6f 20 49 6e 70 75 74 53 74 61 74 65 2e 6f 6e 44 65 76 ........//.into.InputState.onDev
15760 69 63 65 43 68 61 6e 67 65 20 69 6e 73 74 65 61 64 20 77 68 69 63 68 20 6f 6e 6c 79 20 74 72 69 iceChange.instead.which.only.tri
15780 67 67 65 72 73 20 6f 6e 63 65 20 73 74 61 74 65 20 68 61 73 20 62 65 65 6e 20 61 6c 74 65 72 65 ggers.once.state.has.been.altere
157a0 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a d...........//..........//.NOTE:
157c0 20 54 68 69 73 20 61 6c 73 6f 20 6d 65 61 6e 73 20 74 68 61 74 20 75 6e 70 61 69 72 65 64 20 64 .This.also.means.that.unpaired.d
157e0 65 76 69 63 65 20 61 63 74 69 76 69 74 79 20 77 69 6c 6c 20 2a 6f 6e 6c 79 2a 20 62 65 20 64 65 evice.activity.will.*only*.be.de
15800 74 65 63 74 65 64 20 66 72 6f 6d 20 65 76 65 6e 74 73 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 tected.from.events,..........//.
15820 20 20 20 20 20 20 4e 4f 54 20 66 72 6f 6d 20 73 74 61 74 65 20 63 68 61 6e 67 65 73 20 61 70 70 ......NOT.from.state.changes.app
15840 6c 69 65 64 20 64 69 72 65 63 74 6c 79 20 74 68 72 6f 75 67 68 20 49 6e 70 75 74 53 74 61 74 65 lied.directly.through.InputState
15860 2e 43 68 61 6e 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 .Change...........private.static
15880 20 75 6e 73 61 66 65 20 76 6f 69 64 20 4f 6e 45 76 65 6e 74 28 49 6e 70 75 74 45 76 65 6e 74 50 .unsafe.void.OnEvent(InputEventP
158a0 74 72 20 65 76 65 6e 74 50 74 72 2c 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 tr.eventPtr,.InputDevice.device)
158c0 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 ..........{..............Debug.A
158e0 73 73 65 72 74 28 73 5f 4c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 ssert(s_ListenForUnpairedDeviceA
15900 63 74 69 76 69 74 79 20 21 3d 20 30 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 ctivity.!=.0,.................."
15920 54 68 69 73 20 73 68 6f 75 6c 64 20 6f 6e 6c 79 20 62 65 20 63 61 6c 6c 65 64 20 77 68 69 6c 65 This.should.only.be.called.while
15940 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f 72 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 20 61 .listening.for.unpaired.device.a
15960 63 74 69 76 69 74 79 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4c 69 ctivity");..............if.(s_Li
15980 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 63 74 69 76 69 74 79 20 3d 3d stenForUnpairedDeviceActivity.==
159a0 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 72 6e 3b 0d 0a 0d 0a .0)..................return;....
159c0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 61 6e 79 20 73 74 61 74 65 20 ............//.Ignore.any.state.
159e0 63 68 61 6e 67 65 20 6e 6f 74 20 74 72 69 67 67 65 72 65 64 20 66 72 6f 6d 20 61 20 73 74 61 74 change.not.triggered.from.a.stat
15a00 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 6e 74 e.event...............if.(!event
15a20 50 74 72 2e 49 73 41 3c 53 74 61 74 65 45 76 65 6e 74 3e 28 29 20 26 26 20 21 65 76 65 6e 74 50 Ptr.IsA<StateEvent>().&&.!eventP
15a40 74 72 2e 49 73 41 3c 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 3e 28 29 29 0d 0a 20 20 20 20 tr.IsA<DeltaStateEvent>())......
15a60 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ............return;.............
15a80 20 20 20 2f 2f 20 53 65 65 20 69 66 20 69 74 27 73 20 61 20 64 65 76 69 63 65 20 6e 6f 74 20 62 ...//.See.if.it's.a.device.not.b
15aa0 65 6c 6f 6e 67 69 6e 67 20 74 6f 20 61 6e 79 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 elonging.to.any.user............
15ac0 20 20 20 69 66 20 28 41 72 72 61 79 48 65 6c 70 65 72 73 2e 43 6f 6e 74 61 69 6e 73 52 65 66 65 ...if.(ArrayHelpers.ContainsRefe
15ae0 72 65 6e 63 65 28 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 2c 20 73 5f 41 6c 6c 50 rence(s_AllPairedDevices,.s_AllP
15b00 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 2c 20 64 65 76 69 63 65 29 29 0d 0a 20 20 20 20 airedDeviceCount,.device))......
15b20 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 4e 6f ........{..................//.No
15b40 2c 20 69 74 27 73 20 61 20 64 65 76 69 63 65 20 61 6c 72 65 61 64 79 20 70 61 69 72 65 64 20 74 ,.it's.a.device.already.paired.t
15b60 6f 20 61 20 70 6c 61 79 65 72 20 73 6f 20 64 6f 20 6e 6f 74 68 69 6e 67 2e 0d 0a 20 20 20 20 20 o.a.player.so.do.nothing........
15b80 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ...........return;..............
15ba0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 65 72 2e 42 65 67 69 6e 53 }................Profiler.BeginS
15bc0 61 6d 70 6c 65 28 22 49 6e 70 75 74 43 68 65 63 6b 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 ample("InputCheckForUnpairedDevi
15be0 63 65 41 63 74 69 76 69 74 79 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f ceActivity");................///
15c00 2f 54 4f 44 4f 3a 20 61 6c 6c 6f 77 20 66 69 6c 74 65 72 69 6e 67 20 28 65 2e 67 2e 20 62 79 20 /TODO:.allow.filtering.(e.g..by.
15c20 64 65 76 69 63 65 20 72 65 71 75 69 72 65 6d 65 6e 74 73 20 6f 6e 20 75 73 65 72 20 61 63 74 69 device.requirements.on.user.acti
15c40 6f 6e 73 29 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 6f 20 74 68 72 6f 75 67 ons)................//.Go.throug
15c60 68 20 63 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 66 6f 72 20 61 6e 79 20 6f 6e 65 20 74 68 61 74 20 h.controls.and.for.any.one.that.
15c80 69 73 6e 27 74 20 6e 6f 69 73 79 20 6f 72 20 73 79 6e 74 68 65 74 69 63 2c 20 66 69 6e 64 20 6f isn't.noisy.or.synthetic,.find.o
15ca0 75 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 69 66 20 77 65 20 68 61 76 65 20 61 20 ut..............//.if.we.have.a.
15cc0 6d 61 67 6e 69 74 75 64 65 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 7a 65 72 6f 2e 0d 0a 20 20 magnitude.greater.than.zero.....
15ce0 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 64 65 76 69 63 65 2e ..........var.controls.=.device.
15d00 61 6c 6c 43 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 allControls;..............for.(v
15d20 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6e 74 72 6f 6c 73 2e 43 6f 75 6e 74 3b 20 2b 2b ar.i.=.0;.i.<.controls.Count;.++
15d40 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 i)..............{...............
15d60 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 63 6f 6e 74 72 6f 6c 73 5b 69 5d 3b 0d 0a 20 ...var.control.=.controls[i];...
15d80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 6e 6f 69 73 79 ...............if.(control.noisy
15da0 20 7c 7c 20 63 6f 6e 74 72 6f 6c 2e 73 79 6e 74 68 65 74 69 63 29 0d 0a 20 20 20 20 20 20 20 20 .||.control.synthetic)..........
15dc0 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............continue;...........
15de0 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 6e 6f 6e 2d 6c 65 61 66 20 63 6f 6e 74 .........//.Ignore.non-leaf.cont
15e00 72 6f 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 rols...................if.(contr
15e20 6f 6c 2e 63 68 69 6c 64 72 65 6e 2e 43 6f 75 6e 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 ol.children.Count.>.0)..........
15e40 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............continue;...........
15e60 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 63 6f 6e 74 72 6f 6c 73 20 74 68 61 74 .........//.Ignore.controls.that
15e80 20 61 72 65 6e 27 74 20 70 61 72 74 20 6f 66 20 74 68 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 .aren't.part.of.the.event.......
15ea0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 63 6f 6e 74 72 ............var.statePtr.=.contr
15ec0 6f 6c 2e 47 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 65 76 65 ol.GetStatePtrFromStateEvent(eve
15ee0 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 ntPtr);..................if.(sta
15f00 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tePtr.==.null)..................
15f20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....continue;...................
15f40 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 20 43 68 65 .//.Check.for.default.state..Che
15f60 61 70 65 72 20 63 68 65 63 6b 20 74 68 61 6e 20 6d 61 67 6e 69 74 75 64 65 20 65 76 61 6c 75 61 aper.check.than.magnitude.evalua
15f80 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 68 69 63 68 20 6d tion..................//.which.m
15fa0 61 79 20 69 6e 76 6f 6c 76 65 20 73 65 76 65 72 61 6c 20 76 69 72 74 75 61 6c 20 6d 65 74 68 6f ay.involve.several.virtual.metho
15fc0 64 20 63 61 6c 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f d.calls...................if.(co
15fe0 6e 74 72 6f 6c 2e 43 68 65 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c 74 28 73 74 61 74 ntrol.CheckStateIsAtDefault(stat
16000 65 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 ePtr))......................cont
16020 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 6e 64 69 inue;....................//.Endi
16040 6e 67 20 75 70 20 68 65 72 65 20 69 73 20 63 6f 73 74 6c 79 2e 20 57 65 20 6e 6f 77 20 64 6f 20 ng.up.here.is.costly..We.now.do.
16060 70 65 72 2d 63 6f 6e 74 72 6f 6c 20 77 6f 72 6b 20 74 68 61 74 20 6d 61 79 20 69 6e 76 6f 6c 76 per-control.work.that.may.involv
16080 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 61 6c 6b 69 6e 67 20 61 6c e..................//.walking.al
160a0 6c 20 6f 76 65 72 20 74 68 65 20 70 6c 61 63 65 20 69 6e 20 74 68 65 20 49 6e 70 75 74 43 6f 6e l.over.the.place.in.the.InputCon
160c0 74 72 6f 6c 20 6d 61 63 68 69 6e 65 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 trol.machinery..................
160e0 20 2f 2f 0d 0a 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 57 65 .//..................//.NOTE:.We
16100 20 61 6c 72 65 61 64 79 20 6b 6e 6f 77 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 68 61 73 20 6d 6f .already.know.the.control.has.mo
16120 76 65 64 20 61 77 61 79 20 66 72 6f 6d 20 69 74 73 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 0d ved.away.from.its.default.state.
16140 0a 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 73 6f 20 69 6e 20 .................//.......so.in.
16160 63 61 73 65 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 6d 61 67 6e 69 74 75 case.it.does.not.support.magnitu
16180 64 65 73 2c 20 77 65 20 61 73 73 75 6d 65 20 74 68 61 74 20 74 68 65 0d 0a 20 20 20 20 20 20 20 des,.we.assume.that.the.........
161a0 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 20 68 61 73 20 63 68 .........//.......control.has.ch
161c0 61 6e 67 65 64 20 76 61 6c 75 65 2c 20 74 6f 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 anged.value,.too................
161e0 20 20 20 76 61 72 20 6d 61 67 6e 69 74 75 64 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 45 76 61 6c 75 ...var.magnitude.=.control.Evalu
16200 61 74 65 4d 61 67 6e 69 74 75 64 65 28 73 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 ateMagnitude(statePtr);.........
16220 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 67 6e 69 74 75 64 65 20 3e 20 30 20 7c 7c 20 6d 61 .........if.(magnitude.>.0.||.ma
16240 67 6e 69 74 75 64 65 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 gnitude.==.-1)..................
16260 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 59 65 73 2c 20 73 {......................//.Yes,.s
16280 6f 6d 65 74 68 69 6e 67 20 77 61 73 20 61 63 74 75 61 74 65 64 20 6f 6e 20 74 68 65 20 64 65 76 omething.was.actuated.on.the.dev
162a0 69 63 65 2e 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 64 65 ice.......................var.de
162c0 76 69 63 65 48 61 73 42 65 65 6e 50 61 69 72 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 viceHasBeenPaired.=.false;......
162e0 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 6e 20 3d 20 30 3b 20 ................for.(var.n.=.0;.
16300 6e 20 3c 20 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 2e 6c 65 6e 67 74 n.<.s_OnUnpairedDeviceUsed.lengt
16320 68 3b 20 2b 2b 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a h;.++n)......................{..
16340 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 70 61 69 72 ........................var.pair
16360 69 6e 67 53 74 61 74 65 56 65 72 73 69 6f 6e 42 65 66 6f 72 65 20 3d 20 73 5f 50 61 69 72 69 6e ingStateVersionBefore.=.s_Pairin
16380 67 53 74 61 74 65 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 gStateVersion;..................
163a0 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 ..........s_OnUnpairedDeviceUsed
163c0 5b 6e 5d 28 63 6f 6e 74 72 6f 6c 2c 20 65 76 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 [n](control,.eventPtr);.........
163e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 69 72 69 6e 67 53 74 ...................if.(pairingSt
16400 61 74 65 56 65 72 73 69 6f 6e 42 65 66 6f 72 65 20 21 3d 20 73 5f 50 61 69 72 69 6e 67 53 74 61 ateVersionBefore.!=.s_PairingSta
16420 74 65 56 65 72 73 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 teVersion.......................
16440 20 20 20 20 20 20 20 26 26 20 46 69 6e 64 55 73 65 72 50 61 69 72 65 64 54 6f 44 65 76 69 63 65 .......&&.FindUserPairedToDevice
16460 28 64 65 76 69 63 65 29 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 (device).!=.null)...............
16480 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 ...........{....................
164a0 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 48 61 73 42 65 65 6e 50 61 69 72 65 64 20 3d 20 ..........deviceHasBeenPaired.=.
164c0 74 72 75 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 20 true;...........................
164e0 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 20 20 20 20 20 20 ...break;.......................
16500 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 20 7d 0d 0a 0d 0a 20 ...}......................}.....
16520 20 20 20 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 64 65 76 ...................//.If.the.dev
16540 69 63 65 20 77 61 73 20 70 61 69 72 65 64 20 69 6e 20 6f 6e 65 20 6f 66 20 74 68 65 20 63 61 6c ice.was.paired.in.one.of.the.cal
16560 6c 62 61 63 6b 73 2c 20 73 74 6f 70 20 70 72 6f 63 65 73 73 69 6e 67 0d 0a 20 20 20 20 20 20 20 lbacks,.stop.processing.........
16580 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 68 61 6e 67 65 73 20 6f 6e 20 69 74 2e 0d 0a .............//.changes.on.it...
165a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 48 61 ....................if.(deviceHa
165c0 73 42 65 65 6e 50 61 69 72 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sBeenPaired)....................
165e0 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 20 7d 0d ......break;..................}.
16600 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 50 72 .............}................Pr
16620 6f 66 69 6c 65 72 2e 45 6e 64 53 61 6d 70 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ofiler.EndSample();..........}..
16640 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 20 20 20 20 ..........///.<summary>.........
16660 20 2f 2f 2f 20 53 79 6e 74 61 78 20 66 6f 72 20 63 6f 6e 66 69 67 75 72 69 6e 67 20 61 20 63 6f .///.Syntax.for.configuring.a.co
16680 6e 74 72 6f 6c 20 73 63 68 65 6d 65 20 6f 6e 20 61 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 ntrol.scheme.on.a.user..........
166a0 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 70 75 62 6c 69 63 20 .///.</summary>..........public.
166c0 73 74 72 75 63 74 20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 53 79 6e 74 61 78 struct.ControlSchemeChangeSyntax
166e0 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 ..........{..............///.<su
16700 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 65 61 76 65 20 74 68 mmary>..............///.Leave.th
16720 65 20 75 73 65 72 27 73 20 70 61 69 72 65 64 20 64 65 76 69 63 65 73 20 69 6e 20 70 6c 61 63 65 e.user's.paired.devices.in.place
16740 20 62 75 74 20 70 61 69 72 20 61 6e 79 20 61 76 61 69 6c 61 62 6c 65 20 64 65 76 69 63 65 73 0d .but.pair.any.available.devices.
16760 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 61 72 65 20 73 74 69 6c 6c 20 .............///.that.are.still.
16780 72 65 71 75 69 72 65 64 20 62 79 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 73 63 68 65 6d 65 2e 0d required.by.the.control.scheme..
167a0 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>.....
167c0 20 20 20 20 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 .........///.<returns></returns>
167e0 0d 0a 20 20 20 20 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 ..............///.<remarks>.....
16800 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 72 65 20 61 72 65 20 75 6e 70 61 69 72 .........///.If.there.are.unpair
16820 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 2c 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 6d ed.devices.that,.at.the.platform
16840 20 6c 65 76 65 6c 2c 20 61 72 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 .level,.are.associated.with.the.
16860 73 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 65 72 20 61 63 63 6f 75 same..............///.user.accou
16880 6e 74 2c 20 74 68 6f 73 65 20 77 69 6c 6c 20 74 61 6b 65 20 70 72 65 63 65 64 65 6e 63 65 20 6f nt,.those.will.take.precedence.o
168a0 76 65 72 20 6f 74 68 65 72 20 75 6e 70 61 69 72 65 64 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 ver.other.unpaired.devices......
168c0 20 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 20 20 .........///.</remarks>.........
168e0 20 20 20 20 20 70 75 62 6c 69 63 20 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 43 68 61 6e 67 65 53 .....public.ControlSchemeChangeS
16900 79 6e 74 61 78 20 41 6e 64 50 61 69 72 52 65 6d 61 69 6e 69 6e 67 44 65 76 69 63 65 73 28 29 0d yntax.AndPairRemainingDevices().
16920 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 .............{..................
16940 55 70 64 61 74 65 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 28 6d 5f 55 73 65 72 49 UpdateControlSchemeMatch(m_UserI
16960 6e 64 65 78 2c 20 61 75 74 6f 50 61 69 72 4d 69 73 73 69 6e 67 3a 20 74 72 75 65 29 3b 0d 0a 20 ndex,.autoPairMissing:.true);...
16980 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 68 69 73 3b 0d 0a 20 20 20 ...............return.this;.....
169a0 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 69 6e 74 65 72 6e .........}................intern
169c0 61 6c 20 69 6e 74 20 6d 5f 55 73 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a al.int.m_UserIndex;..........}..
169e0 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 75 69 6e 74 20 6d 5f 49 64 3b 0d 0a 0d 0a ..........private.uint.m_Id;....
16a00 20 20 20 20 20 20 20 20 5b 46 6c 61 67 73 5d 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 ........[Flags]..........interna
16a20 6c 20 65 6e 75 6d 20 55 73 65 72 46 6c 61 67 73 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 l.enum.UserFlags..........{.....
16a40 20 20 20 20 20 20 20 20 20 42 69 6e 64 54 6f 41 6c 6c 44 65 76 69 63 65 73 20 3d 20 31 20 3c 3c .........BindToAllDevices.=.1.<<
16a60 20 30 2c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e .0,................///.<summary>
16a80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 74 68 65 72 20 77 65 20 68 61 76 ..............///.Whether.we.hav
16aa0 65 20 69 6e 69 74 69 61 74 65 64 20 61 20 75 73 65 72 20 61 63 63 6f 75 6e 74 20 73 65 6c 65 63 e.initiated.a.user.account.selec
16ac0 74 69 6f 6e 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 tion...............///.</summary
16ae0 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 73 65 72 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 >..............UserAccountSelect
16b00 69 6f 6e 49 6e 50 72 6f 67 72 65 73 73 20 3d 20 31 20 3c 3c 20 31 2c 0d 0a 20 20 20 20 20 20 20 ionInProgress.=.1.<<.1,.........
16b20 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>.....
16b40 20 20 20 20 20 2f 2f 2f 20 44 61 74 61 20 77 65 20 73 74 6f 72 65 20 66 6f 72 20 65 61 63 68 20 .....///.Data.we.store.for.each.
16b60 75 73 65 72 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 0a 20 user...........///.</summary>...
16b80 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 72 75 63 74 20 55 73 65 72 44 61 74 61 0d .......internal.struct.UserData.
16ba0 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d .........{..............///.<sum
16bc0 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 70 6c 61 74 66 mary>..............///.The.platf
16be0 6f 72 6d 20 68 61 6e 64 6c 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 75 orm.handle.associated.with.the.u
16c00 73 65 72 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 ser...............///.</summary>
16c20 0d 0a 20 20 20 20 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 ..............///.<remarks>.....
16c40 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 73 65 74 2c 20 74 68 69 73 20 69 64 65 6e 74 69 .........///.If.set,.this.identi
16c60 66 69 65 73 20 74 68 65 20 75 73 65 72 20 6f 6e 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 2e 20 49 fies.the.user.on.the.platform..I
16c80 74 20 61 6c 73 6f 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65 20 64 65 76 69 63 65 73 0d 0a 20 t.also.means.that.the.devices...
16ca0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 73 73 69 67 6e 65 64 20 74 6f 20 74 68 65 20 75 ...........///.assigned.to.the.u
16cc0 73 65 72 20 6d 61 79 20 62 65 20 70 61 69 72 65 64 20 61 74 20 74 68 65 20 70 6c 61 74 66 6f 72 ser.may.be.paired.at.the.platfor
16ce0 6d 20 6c 65 76 65 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 m.level...............///.</rema
16d00 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 55 73 rks>..............public.InputUs
16d20 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3f 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 erAccountHandle?.platformUserAcc
16d40 6f 75 6e 74 48 61 6e 64 6c 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ountHandle;................///.<
16d60 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 50 6c 61 69 6e 2d summary>..............///.Plain-
16d80 74 65 78 74 20 75 73 65 72 20 6e 61 6d 65 20 61 73 20 72 65 74 75 72 6e 65 64 20 62 79 20 74 68 text.user.name.as.returned.by.th
16da0 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 70 6c 61 74 66 6f 72 6d 2e 20 4e 75 6c 6c 20 69 66 20 6e e.underlying.platform..Null.if.n
16dc0 6f 74 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 75 73 65 72 20 6f 6e 20 70 6c 61 74 66 ot.associated.with.user.on.platf
16de0 6f 72 6d 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 orm...............///.</summary>
16e00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 20 70 6c 61 74 ..............public.string.plat
16e20 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 4e 61 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 formUserAccountName;............
16e40 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 20 20 2f ....///.<summary>............../
16e60 2f 2f 20 50 6c 61 74 66 6f 72 6d 2d 73 70 65 63 69 66 69 63 20 49 44 20 74 68 61 74 20 69 64 65 //.Platform-specific.ID.that.ide
16e80 6e 74 69 66 69 65 73 20 74 68 65 20 75 73 65 72 20 61 63 72 6f 73 73 20 73 65 73 73 69 6f 6e 73 ntifies.the.user.across.sessions
16ea0 20 65 76 65 6e 20 69 66 20 74 68 65 20 75 73 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f .even.if.the.user............../
16ec0 2f 2f 20 6e 61 6d 65 20 63 68 61 6e 67 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f //.name.changes...............//
16ee0 2f 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 2f 2f 2f 20 3c 72 /.</summary>..............///.<r
16f00 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 69 emarks>..............///.This.mi
16f20 67 68 74 20 6e 6f 74 20 62 65 20 61 20 68 75 6d 61 6e 2d 72 65 61 64 61 62 6c 65 20 73 74 72 69 ght.not.be.a.human-readable.stri
16f40 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d ng...............///.</remarks>.
16f60 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 20 70 6c 61 74 66 .............public.string.platf
16f80 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 49 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ormUserAccountId;...............
16fa0 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 20 20 2f 2f 2f 20 .///.<summary>..............///.
16fc0 4e 75 6d 62 65 72 20 6f 66 20 64 65 76 69 63 65 73 20 69 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 Number.of.devices.in.<see.cref="
16fe0 49 6e 70 75 74 55 73 65 72 2e 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 20 InputUser.s_AllPairedDevices"/>.
17000 61 73 73 69 67 6e 65 64 20 74 6f 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 assigned.to.the.user............
17020 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 20 20 20 20 70 ...///.</summary>..............p
17040 75 62 6c 69 63 20 69 6e 74 20 64 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 ublic.int.deviceCount;..........
17060 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 20 ......///.<summary>.............
17080 20 2f 2f 2f 20 49 6e 64 65 78 20 69 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 73 .///.Index.in.<see.cref="InputUs
170a0 65 72 2e 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 73 22 2f 3e 20 77 68 65 72 65 20 74 er.s_AllPairedDevices"/>.where.t
170c0 68 65 20 64 65 76 69 63 65 73 20 66 6f 72 20 74 68 69 73 20 75 73 65 72 20 73 74 61 72 74 2e 20 he.devices.for.this.user.start..
170e0 4f 6e 6c 79 20 76 61 6c 69 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 66 20 3c Only.valid..............///.if.<
17100 73 65 65 20 63 72 65 66 3d 22 64 65 76 69 63 65 43 6f 75 6e 74 22 2f 3e 20 69 73 20 67 72 65 61 see.cref="deviceCount"/>.is.grea
17120 74 65 72 20 74 68 61 6e 20 7a 65 72 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 ter.than.zero...............///.
17140 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 </summary>..............public.i
17160 6e 74 20 64 65 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 nt.deviceStartIndex;............
17180 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 20 20 2f ....///.<summary>............../
171a0 2f 2f 20 49 6e 70 75 74 20 61 63 74 69 6f 6e 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 //.Input.actions.associated.with
171c0 20 74 68 65 20 75 73 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 .the.user...............///.</su
171e0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 49 6e 70 75 mmary>..............public.IInpu
17200 74 41 63 74 69 6f 6e 43 6f 6c 6c 65 63 74 69 6f 6e 20 61 63 74 69 6f 6e 73 3b 0d 0a 0d 0a 20 20 tActionCollection.actions;......
17220 20 20 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 20 20 20 20 ..........///.<summary>.........
17240 20 20 20 20 20 2f 2f 2f 20 43 75 72 72 65 6e 74 6c 79 20 61 63 74 69 76 65 20 63 6f 6e 74 72 6f .....///.Currently.active.contro
17260 6c 20 73 63 68 65 6d 65 20 6f 72 20 6e 75 6c 6c 20 69 66 20 6e 6f 20 63 6f 6e 74 72 6f 6c 20 73 l.scheme.or.null.if.no.control.s
17280 63 68 65 6d 65 20 68 61 73 20 62 65 65 6e 20 73 65 74 20 6f 6e 20 74 68 65 20 75 73 65 72 2e 0d cheme.has.been.set.on.the.user..
172a0 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>.....
172c0 20 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 20 .........///.<remarks>..........
172e0 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 61 6c 73 6f 20 64 69 63 74 61 74 65 73 20 74 68 65 20 62 ....///.This.also.dictates.the.b
17300 69 6e 64 69 6e 67 20 6d 61 73 6b 20 74 68 61 74 20 77 65 27 72 65 20 75 73 69 6e 67 20 77 69 74 inding.mask.that.we're.using.wit
17320 68 20 3c 73 65 65 20 63 72 65 66 3d 22 61 63 74 69 6f 6e 73 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 h.<see.cref="actions"/>.........
17340 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 20 20 20 20 20 ......///.</remarks>............
17360 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 3f 20 63 6f 6e ..public.InputControlScheme?.con
17380 74 72 6f 6c 53 63 68 65 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 trolScheme;................publi
173a0 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 2e 4d 61 74 63 68 52 65 73 75 6c 74 c.InputControlScheme.MatchResult
173c0 20 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 4d 61 74 63 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .controlSchemeMatch;............
173e0 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 6c 6f 73 74 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d ....public.int.lostDeviceCount;.
17400 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 6c 6f 73 74 44 65 ...............public.int.lostDe
17420 76 69 63 65 53 74 61 72 74 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f viceStartIndex;................/
17440 2f 2f 2f 54 4f 44 4f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 49 6e ///TODO..............//public.In
17460 70 75 74 55 73 65 72 53 65 74 74 69 6e 67 73 20 73 65 74 74 69 6e 67 73 3b 0d 0a 0d 0a 20 20 20 putUserSettings.settings;.......
17480 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 55 73 65 72 46 6c 61 67 73 20 66 6c 61 67 73 3b .........public.UserFlags.flags;
174a0 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 20 3c 73 75 6d 6d ..........}............///.<summ
174c0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 6f 6d 70 61 72 65 20 74 77 6f 20 64 65 ary>..........///.Compare.two.de
174e0 76 69 63 65 73 20 66 6f 72 20 62 65 69 6e 67 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 vices.for.being.associated.with.
17500 61 20 73 70 65 63 69 66 69 63 20 70 6c 61 74 66 6f 72 6d 20 75 73 65 72 20 61 63 63 6f 75 6e 74 a.specific.platform.user.account
17520 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 0a 20 20 20 20 20 ...........///.</summary>.......
17540 20 20 20 70 72 69 76 61 74 65 20 73 74 72 75 63 74 20 43 6f 6d 70 61 72 65 44 65 76 69 63 65 73 ...private.struct.CompareDevices
17560 42 79 55 73 65 72 41 63 63 6f 75 6e 74 20 3a 20 49 43 6f 6d 70 61 72 65 72 3c 49 6e 70 75 74 44 ByUserAccount.:.IComparer<InputD
17580 65 76 69 63 65 3e 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 evice>..........{..............p
175a0 75 62 6c 69 63 20 49 6e 70 75 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 70 6c 61 ublic.InputUserAccountHandle.pla
175c0 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 3b 0d 0a 0d 0a 20 20 20 20 20 tformUserAccountHandle;.........
175e0 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 43 6f 6d 70 61 72 65 28 49 6e 70 75 74 44 .......public.int.Compare(InputD
17600 65 76 69 63 65 20 78 2c 20 49 6e 70 75 74 44 65 76 69 63 65 20 79 29 0d 0a 20 20 20 20 20 20 20 evice.x,.InputDevice.y).........
17620 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 66 69 72 73 .....{..................var.firs
17640 74 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 47 65 74 55 73 65 72 41 63 63 6f 75 6e 74 48 tAccountHandle.=.GetUserAccountH
17660 61 6e 64 6c 65 46 6f 72 44 65 76 69 63 65 28 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 andleForDevice(x);..............
17680 20 20 20 20 76 61 72 20 73 65 63 6f 6e 64 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 20 47 65 ....var.secondAccountHandle.=.Ge
176a0 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 46 6f 72 44 65 76 69 63 65 28 78 29 3b 0d tUserAccountHandleForDevice(x);.
176c0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 66 69 72 73 74 41 63 63 6f ...................if.(firstAcco
176e0 75 6e 74 48 61 6e 64 6c 65 20 3d 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 untHandle.==.platformUserAccount
17700 48 61 6e 64 6c 65 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 Handle.&&......................s
17720 65 63 6f 6e 64 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 3d 20 70 6c 61 74 66 6f 72 6d 55 73 econdAccountHandle.==.platformUs
17740 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 erAccountHandle)................
17760 20 20 20 20 20 20 72 65 74 75 72 6e 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ......return.0;.................
17780 20 20 20 69 66 20 28 66 69 72 73 74 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 20 3d 3d 20 70 6c 61 ...if.(firstAccountHandle.==.pla
177a0 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 0d 0a 20 20 20 20 20 20 20 tformUserAccountHandle).........
177c0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 0d 0a 20 20 20 20 20 .............return.-1;.........
177e0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 65 63 6f 6e 64 41 63 63 6f 75 6e 74 48 61 6e 64 ...........if.(secondAccountHand
17800 6c 65 20 3d 3d 20 70 6c 61 74 66 6f 72 6d 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 29 le.==.platformUserAccountHandle)
17820 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 31 3b 0d ......................return.1;.
17840 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 20 30 3b 0d 0a 20 20 ...................return.0;....
17860 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 5b 53 79 73 74 ..........}................[Syst
17880 65 6d 2e 44 69 61 67 6e 6f 73 74 69 63 73 2e 43 6f 64 65 41 6e 61 6c 79 73 69 73 2e 53 75 70 70 em.Diagnostics.CodeAnalysis.Supp
178a0 72 65 73 73 4d 65 73 73 61 67 65 28 22 4d 69 63 72 6f 73 6f 66 74 2e 55 73 61 67 65 22 2c 20 22 ressMessage("Microsoft.Usage",."
178c0 43 41 31 38 30 31 3a 52 65 76 69 65 77 55 6e 75 73 65 64 50 61 72 61 6d 65 74 65 72 73 22 2c 20 CA1801:ReviewUnusedParameters",.
178e0 4d 65 73 73 61 67 65 49 64 20 3d 20 22 64 65 76 69 63 65 22 2c 20 4a 75 73 74 69 66 69 63 61 74 MessageId.=."device",.Justificat
17900 69 6f 6e 20 3d 20 22 4b 65 65 70 20 74 68 69 73 20 66 6f 72 20 66 75 74 75 72 65 20 69 6d 70 6c ion.=."Keep.this.for.future.impl
17920 65 6d 65 6e 74 61 74 69 6f 6e 22 29 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 ementation")]..............priva
17940 74 65 20 73 74 61 74 69 63 20 49 6e 70 75 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 te.static.InputUserAccountHandle
17960 3f 20 47 65 74 55 73 65 72 41 63 63 6f 75 6e 74 48 61 6e 64 6c 65 46 6f 72 44 65 76 69 63 65 28 ?.GetUserAccountHandleForDevice(
17980 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 InputDevice.device).............
179a0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 20 28 6e 65 .{..................////TODO.(ne
179c0 65 64 20 74 6f 20 63 61 63 68 65 20 74 68 69 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ed.to.cache.this)...............
179e0 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 7d 0d 0a ...return.null;..............}..
17a00 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 72 ........}............private.str
17a20 75 63 74 20 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 0d 0a 20 20 20 uct.OngoingAccountSelection.....
17a40 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 .....{..............public.Input
17a60 44 65 76 69 63 65 20 64 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c Device.device;..............publ
17a80 69 63 20 75 69 6e 74 20 75 73 65 72 49 64 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ic.uint.userId;..........}......
17aa0 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 69 6e 74 20 73 5f 50 61 69 72 69 ......private.static.int.s_Pairi
17ac0 6e 67 53 74 61 74 65 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 ngStateVersion;..........private
17ae0 20 73 74 61 74 69 63 20 75 69 6e 74 20 73 5f 4c 61 73 74 55 73 65 72 49 64 3b 0d 0a 20 20 20 20 .static.uint.s_LastUserId;......
17b00 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 69 6e 74 20 73 5f 41 6c 6c 55 73 65 72 ....private.static.int.s_AllUser
17b20 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 69 Count;..........private.static.i
17b40 6e 74 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 nt.s_AllPairedDeviceCount;......
17b60 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 69 6e 74 20 73 5f 41 6c 6c 4c 6f 73 74 ....private.static.int.s_AllLost
17b80 44 65 76 69 63 65 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 DeviceCount;..........private.st
17ba0 61 74 69 63 20 49 6e 70 75 74 55 73 65 72 5b 5d 20 73 5f 41 6c 6c 55 73 65 72 73 3b 0d 0a 20 20 atic.InputUser[].s_AllUsers;....
17bc0 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 55 73 65 72 44 61 74 61 5b 5d 20 ......private.static.UserData[].
17be0 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 s_AllUserData;..........private.
17c00 73 74 61 74 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 5b 5d 20 73 5f 41 6c 6c 50 61 69 72 65 64 static.InputDevice[].s_AllPaired
17c20 44 65 76 69 63 65 73 3b 20 2f 2f 20 57 65 20 6b 65 65 70 20 61 20 73 69 6e 67 6c 65 20 61 72 72 Devices;.//.We.keep.a.single.arr
17c40 61 79 20 74 68 61 74 20 77 65 20 73 6c 69 63 65 20 6f 75 74 20 74 6f 20 65 61 63 68 20 75 73 65 ay.that.we.slice.out.to.each.use
17c60 72 2e 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 49 6e 70 75 74 r...........private.static.Input
17c80 44 65 76 69 63 65 5b 5d 20 73 5f 41 6c 6c 4c 6f 73 74 44 65 76 69 63 65 73 3b 0d 0a 20 20 20 20 Device[].s_AllLostDevices;......
17ca0 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c ....private.static.InlinedArray<
17cc0 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 3e 20 73 5f 4f 6e 67 6f 69 OngoingAccountSelection>.s_Ongoi
17ce0 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 ngAccountSelections;..........pr
17d00 69 76 61 74 65 20 73 74 61 74 69 63 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 41 63 74 69 6f 6e ivate.static.InlinedArray<Action
17d20 3c 49 6e 70 75 74 55 73 65 72 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2c 20 49 6e 70 <InputUser,.InputUserChange,.Inp
17d40 75 74 44 65 76 69 63 65 3e 3e 20 73 5f 4f 6e 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 utDevice>>.s_OnChange;..........
17d60 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 41 63 74 69 private.static.InlinedArray<Acti
17d80 6f 6e 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 3e 3e on<InputControl,.InputEventPtr>>
17da0 20 73 5f 4f 6e 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 55 73 65 64 3b 0d 0a 20 20 20 20 20 20 .s_OnUnpairedDeviceUsed;........
17dc0 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 41 63 74 69 6f 6e 3c 6f 62 6a 65 63 74 2c 20 ..private.static.Action<object,.
17de0 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 3e 20 73 5f 41 63 74 69 6f 6e 43 68 61 6e 67 InputActionChange>.s_ActionChang
17e00 65 44 65 6c 65 67 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 eDelegate;..........private.stat
17e20 69 63 20 41 63 74 69 6f 6e 3c 49 6e 70 75 74 44 65 76 69 63 65 2c 20 49 6e 70 75 74 44 65 76 69 ic.Action<InputDevice,.InputDevi
17e40 63 65 43 68 61 6e 67 65 3e 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 44 65 6c 65 67 61 ceChange>.s_OnDeviceChangeDelega
17e60 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 41 63 74 69 te;..........private.static.Acti
17e80 6f 6e 3c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 2c 20 49 6e 70 75 74 44 65 76 69 63 65 3e 20 73 on<InputEventPtr,.InputDevice>.s
17ea0 5f 4f 6e 45 76 65 6e 74 44 65 6c 65 67 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 _OnEventDelegate;..........priva
17ec0 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 73 5f 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 48 te.static.bool.s_OnActionChangeH
17ee0 6f 6f 6b 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 ooked;..........private.static.b
17f00 6f 6f 6c 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 48 6f 6f 6b 65 64 3b 0d 0a 20 20 20 ool.s_OnDeviceChangeHooked;.....
17f20 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 73 5f 4f 6e 45 76 65 .....private.static.bool.s_OnEve
17f40 6e 74 48 6f 6f 6b 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 ntHooked;..........private.stati
17f60 63 20 69 6e 74 20 73 5f 4c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 65 76 69 63 65 41 c.int.s_ListenForUnpairedDeviceA
17f80 63 74 69 76 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 ctivity;............private.stat
17fa0 69 63 20 76 6f 69 64 20 48 6f 6f 6b 49 6e 74 6f 41 63 74 69 6f 6e 43 68 61 6e 67 65 28 29 0d 0a ic.void.HookIntoActionChange()..
17fc0 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 73 5f 4f 6e 41 ........{..............if.(s_OnA
17fe0 63 74 69 6f 6e 43 68 61 6e 67 65 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ctionChangeHooked)..............
18000 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 41 ....return;..............if.(s_A
18020 63 74 69 6f 6e 43 68 61 6e 67 65 44 65 6c 65 67 61 74 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 ctionChangeDelegate.==.null)....
18040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 63 74 69 6f 6e 43 68 61 6e 67 65 44 65 6c 65 ..............s_ActionChangeDele
18060 67 61 74 65 20 3d 20 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 gate.=.OnActionChange;..........
18080 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 20 2b ....InputSystem.onActionChange.+
180a0 3d 20 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 =.OnActionChange;..............s
180c0 5f 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 48 6f 6f 6b 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 _OnActionChangeHooked.=.true;...
180e0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 .......}............private.stat
18100 69 63 20 76 6f 69 64 20 55 6e 68 6f 6f 6b 46 72 6f 6d 41 63 74 69 6f 6e 43 68 61 6e 67 65 28 29 ic.void.UnhookFromActionChange()
18120 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 21 73 5f ..........{..............if.(!s_
18140 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 OnActionChangeHooked)...........
18160 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 .......return;..............Inpu
18180 74 53 79 73 74 65 6d 2e 6f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 20 2d 3d 20 4f 6e 41 63 74 69 tSystem.onActionChange.-=.OnActi
181a0 6f 6e 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 41 63 74 69 6f onChange;..............s_OnActio
181c0 6e 43 68 61 6e 67 65 48 6f 6f 6b 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d nChangeHooked.=.true;..........}
181e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 ............private.static.void.
18200 48 6f 6f 6b 49 6e 74 6f 44 65 76 69 63 65 43 68 61 6e 67 65 28 29 0d 0a 20 20 20 20 20 20 20 20 HookIntoDeviceChange()..........
18220 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 {..............if.(s_OnDeviceCha
18240 6e 67 65 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 ngeHooked)..................retu
18260 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4f 6e 44 65 76 69 63 65 43 rn;..............if.(s_OnDeviceC
18280 68 61 6e 67 65 44 65 6c 65 67 61 74 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 hangeDelegate.==.null)..........
182a0 20 20 20 20 20 20 20 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 44 65 6c 65 67 61 74 65 ........s_OnDeviceChangeDelegate
182c0 20 3d 20 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .=.OnDeviceChange;..............
182e0 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 20 2b 3d 20 73 5f InputSystem.onDeviceChange.+=.s_
18300 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 44 65 6c 65 67 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 OnDeviceChangeDelegate;.........
18320 20 20 20 20 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 48 6f 6f 6b 65 64 20 3d 20 74 72 .....s_OnDeviceChangeHooked.=.tr
18340 75 65 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 ue;..........}............privat
18360 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 55 6e 68 6f 6f 6b 46 72 6f 6d 44 65 76 69 63 65 43 68 e.static.void.UnhookFromDeviceCh
18380 61 6e 67 65 28 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 ange()..........{..............i
183a0 66 20 28 21 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 f.(!s_OnDeviceChangeHooked).....
183c0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .............return;............
183e0 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 20 2d 3d 20 ..InputSystem.onDeviceChange.-=.
18400 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 44 65 6c 65 67 61 74 65 3b 0d 0a 20 20 20 20 20 s_OnDeviceChangeDelegate;.......
18420 20 20 20 20 20 20 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 48 6f 6f 6b 65 64 20 3d 20 .......s_OnDeviceChangeHooked.=.
18440 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 20 20 20 70 72 69 false;..........}............pri
18460 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 48 6f 6f 6b 49 6e 74 6f 45 76 65 6e 74 73 28 vate.static.void.HookIntoEvents(
18480 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 28 73 5f )..........{..............if.(s_
184a0 4f 6e 45 76 65 6e 74 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 OnEventHooked)..................
184c0 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4f 6e 45 76 65 return;..............if.(s_OnEve
184e0 6e 74 44 65 6c 65 67 61 74 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ntDelegate.==.null).............
18500 20 20 20 20 20 73 5f 4f 6e 45 76 65 6e 74 44 65 6c 65 67 61 74 65 20 3d 20 4f 6e 45 76 65 6e 74 .....s_OnEventDelegate.=.OnEvent
18520 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 45 76 65 ;..............InputSystem.onEve
18540 6e 74 20 2b 3d 20 73 5f 4f 6e 45 76 65 6e 74 44 65 6c 65 67 61 74 65 3b 0d 0a 20 20 20 20 20 20 nt.+=.s_OnEventDelegate;........
18560 20 20 20 20 20 20 73 5f 4f 6e 45 76 65 6e 74 48 6f 6f 6b 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 ......s_OnEventHooked.=.true;...
18580 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 .......}............private.stat
185a0 69 63 20 76 6f 69 64 20 55 6e 68 6f 6f 6b 46 72 6f 6d 44 65 76 69 63 65 53 74 61 74 65 43 68 61 ic.void.UnhookFromDeviceStateCha
185c0 6e 67 65 28 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 nge()..........{..............if
185e0 20 28 21 73 5f 4f 6e 45 76 65 6e 74 48 6f 6f 6b 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .(!s_OnEventHooked).............
18600 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 .....return;..............InputS
18620 79 73 74 65 6d 2e 6f 6e 45 76 65 6e 74 20 2d 3d 20 73 5f 4f 6e 45 76 65 6e 74 44 65 6c 65 67 61 ystem.onEvent.-=.s_OnEventDelega
18640 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 45 76 65 6e 74 48 6f 6f 6b 65 64 te;..............s_OnEventHooked
18660 20 3d 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 20 20 20 .=.false;..........}............
18680 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 73 65 74 47 6c 6f 62 61 6c internal.static.void.ResetGlobal
186a0 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 s()..........{..............//.R
186c0 65 6c 65 61 73 65 20 6e 61 74 69 76 65 20 6d 65 6d 6f 72 79 20 68 65 6c 64 20 62 79 20 63 6f 6e elease.native.memory.held.by.con
186e0 74 72 6f 6c 20 73 63 68 65 6d 65 20 6d 61 74 63 68 20 72 65 73 75 6c 74 73 2e 0d 0a 20 20 20 20 trol.scheme.match.results.......
18700 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 73 5f 41 6c ........for.(var.i.=.0;.i.<.s_Al
18720 6c 55 73 65 72 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 20 20 lUserCount;.++i)................
18740 20 20 73 5f 41 6c 6c 55 73 65 72 44 61 74 61 5b 69 5d 2e 63 6f 6e 74 72 6f 6c 53 63 68 65 6d 65 ..s_AllUserData[i].controlScheme
18760 4d 61 74 63 68 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Match.Dispose();................
18780 2f 2f 20 44 6f 6e 27 74 20 72 65 73 65 74 20 73 5f 4c 61 73 74 55 73 65 72 49 64 20 61 6e 64 20 //.Don't.reset.s_LastUserId.and.
187a0 6a 75 73 74 20 6c 65 74 20 69 74 20 69 6e 63 72 65 6d 65 6e 74 20 69 6e 73 74 65 61 64 20 73 6f just.let.it.increment.instead.so
187c0 20 77 65 20 6e 65 76 65 72 20 67 65 6e 65 72 61 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .we.never.generate..............
187e0 2f 2f 20 74 68 65 20 73 61 6d 65 20 49 44 20 74 77 69 63 65 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 //.the.same.ID.twice............
18800 20 20 20 20 20 73 5f 50 61 69 72 69 6e 67 53 74 61 74 65 56 65 72 73 69 6f 6e 20 3d 20 30 3b 0d .....s_PairingStateVersion.=.0;.
18820 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 43 6f 75 6e 74 20 3d 20 30 3b .............s_AllUserCount.=.0;
18840 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 50 61 69 72 65 64 44 65 76 69 63 65 43 ..............s_AllPairedDeviceC
18860 6f 75 6e 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 ount.=.0;..............s_AllUser
18880 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 55 73 65 72 s.=.null;..............s_AllUser
188a0 44 61 74 61 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 41 6c 6c 50 Data.=.null;..............s_AllP
188c0 61 69 72 65 64 44 65 76 69 63 65 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 airedDevices.=.null;............
188e0 20 20 73 5f 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 6c 65 63 74 69 6f 6e 73 20 3d 20 6e ..s_OngoingAccountSelections.=.n
18900 65 77 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 4f 6e 67 6f 69 6e 67 41 63 63 6f 75 6e 74 53 65 ew.InlinedArray<OngoingAccountSe
18920 6c 65 63 74 69 6f 6e 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 43 68 61 lection>();..............s_OnCha
18940 6e 67 65 20 3d 20 6e 65 77 20 49 6e 6c 69 6e 65 64 41 72 72 61 79 3c 41 63 74 69 6f 6e 3c 49 6e nge.=.new.InlinedArray<Action<In
18960 70 75 74 55 73 65 72 2c 20 49 6e 70 75 74 55 73 65 72 43 68 61 6e 67 65 2c 20 49 6e 70 75 74 44 putUser,.InputUserChange,.InputD
18980 65 76 69 63 65 3e 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 55 6e 70 61 evice>>();..............s_OnUnpa
189a0 69 72 65 64 44 65 76 69 63 65 55 73 65 64 20 3d 20 6e 65 77 20 49 6e 6c 69 6e 65 64 41 72 72 61 iredDeviceUsed.=.new.InlinedArra
189c0 79 3c 41 63 74 69 6f 6e 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e y<Action<InputControl,.InputEven
189e0 74 50 74 72 3e 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 44 65 76 69 63 tPtr>>();..............s_OnDevic
18a00 65 43 68 61 6e 67 65 44 65 6c 65 67 61 74 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 eChangeDelegate.=.null;.........
18a20 20 20 20 20 20 73 5f 4f 6e 45 76 65 6e 74 44 65 6c 65 67 61 74 65 20 3d 20 6e 75 6c 6c 3b 0d 0a .....s_OnEventDelegate.=.null;..
18a40 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 48 6f 6f 6b ............s_OnDeviceChangeHook
18a60 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4f 6e 41 63 74 ed.=.false;..............s_OnAct
18a80 69 6f 6e 43 68 61 6e 67 65 48 6f 6f 6b 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 ionChangeHooked.=.false;........
18aa0 20 20 20 20 20 20 73 5f 4f 6e 45 76 65 6e 74 48 6f 6f 6b 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a ......s_OnEventHooked.=.false;..
18ac0 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4c 69 73 74 65 6e 46 6f 72 55 6e 70 61 69 72 65 64 44 ............s_ListenForUnpairedD
18ae0 65 76 69 63 65 41 63 74 69 76 69 74 79 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 eviceActivity.=.0;..........}...
18b00 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 00 00 00 ...}..}.........................
18b20 09 00 00 00 49 6e 70 75 74 55 73 65 72 00 00 00 00 00 00 00 ....InputUser.......