Esempio n. 1
0
        void InitializeSession()
        {
            using (var sessionConfig = UIDevice.CurrentDevice.CheckSystemVersion(8, 0)
                                ? NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration(sessionId)
                                : NSUrlSessionConfiguration.BackgroundSessionConfiguration(sessionId)) {
                sessionConfig.AllowsCellularAccess = true;

                sessionConfig.NetworkServiceType = NSUrlRequestNetworkServiceType.Default;

                sessionConfig.HttpMaximumConnectionsPerHost = 2;

                var sessionDelegate = new CustomSessionDownloadDelegate(targetFilename);
                this.session = NSUrlSession.FromConfiguration(sessionConfig, sessionDelegate, null);
            }
        }
		void InitializeSession ()
		{
			using (var sessionConfig = UIDevice.CurrentDevice.CheckSystemVersion (8, 0)
				? NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration (sessionId)
				: NSUrlSessionConfiguration.BackgroundSessionConfiguration (sessionId)) {
				sessionConfig.AllowsCellularAccess = true;

				sessionConfig.NetworkServiceType = NSUrlRequestNetworkServiceType.Default;

				sessionConfig.HttpMaximumConnectionsPerHost = 2;

				var sessionDelegate = new CustomSessionDownloadDelegate (targetFilename);
				this.session = NSUrlSession.FromConfiguration (sessionConfig, sessionDelegate, null);
			}
		}