예제 #1
0
        public void CheckFreeSlot_Received(CheckFreeSlot freeslot)
        {
            Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot");

            NSUrlSession.GetTasks2((dataTasks, uploadTasks, downloadTasks) => {
                int free = _maxdownloads - downloadTasks.Length;

                Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2");
                Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Maxdownloads : {0}", _maxdownloads);
                Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Length       : {0}", downloadTasks.Length);
                Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Free         : {0}", free);

                _bus.SendAsync <FreeSlot> (new FreeSlot {
                    Free = free
                });
            });
        }
		public void CheckFreeSlot_Received(CheckFreeSlot freeslot) {

			Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot");

			NSUrlSession.GetTasks2((dataTasks, uploadTasks, downloadTasks) => {

				int free = _maxdownloads - downloadTasks.Length;

				Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2");
				Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Maxdownloads : {0}", _maxdownloads);
				Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Length       : {0}", downloadTasks.Length);
				Console.WriteLine("[NSUrlSessionManager] CheckFreeSlot GetTasks2 Free         : {0}", free);

				_bus.SendAsync<FreeSlot> (new FreeSlot {
					Free = free
				});
			});
		}