An implementation of ISaveDevice utilizing IsolatedStorage for Windows Phone. Given that this is an ISaveDevice, all of our methods still have a container name for compatibility, but that parameter is simply ignored by the implementation since there is no concept of a container within IsolatedStorage.
상속: IAsyncSaveDevice
예제 #1
0
파일: StorageManager.cs 프로젝트: rc183/igf
        public override void Initialize()
        {
            base.Initialize();

#if WINDOWS || XBOX
            var shared = new SharedSaveDevice();

            shared.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
            shared.DeviceDisconnected     += (s, e) => e.Response = SaveDeviceEventResponse.Force;

            _sharedDevice = shared;
#else
            _sharedDevice = new IsolatedStorageSaveDevice();
#endif

            _playerDevices = new Dictionary <PlayerIndex, IAsyncSaveDevice>();


            for (int i = 0; i < 4; i++)
            {
                var playerIndex = (PlayerIndex)Enum.ToObject(typeof(PlayerIndex), i);

#if WINDOWS || XBOX
                var playerDevice = new PlayerSaveDevice(playerIndex);

                playerDevice.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
                playerDevice.DeviceDisconnected     += (s, e) => e.Response = SaveDeviceEventResponse.Force;
#else
                var playerDevice = new IsolatedStorageSaveDevice();
#endif

                _playerDevices.Add(playerIndex, playerDevice);
            }
        }
예제 #2
0
        public override void Initialize()
        {
            base.Initialize();

#if WINDOWS || XBOX
            var shared = new SharedSaveDevice();

            shared.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
            shared.DeviceDisconnected += (s, e) => e.Response = SaveDeviceEventResponse.Force;

            _sharedDevice = shared;
#else
            _sharedDevice = new IsolatedStorageSaveDevice();
#endif

            _playerDevices = new Dictionary<PlayerIndex, IAsyncSaveDevice>();


            for (int i = 0; i < 4; i++)
            {
                var playerIndex = (PlayerIndex) Enum.ToObject(typeof (PlayerIndex), i);

#if WINDOWS || XBOX
                var playerDevice = new PlayerSaveDevice(playerIndex);
                
                playerDevice.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
                playerDevice.DeviceDisconnected += (s, e) => e.Response = SaveDeviceEventResponse.Force;
#else
                var playerDevice = new IsolatedStorageSaveDevice();
#endif

                _playerDevices.Add(playerIndex, playerDevice);
            }
        }