Exemplo n.º 1
0
        public static IAsyncResult BeginDeletePortMap(this INatDevice device, Mapping mapping, AsyncCallback callback, object asyncState)
        {
            var result = new TaskAsyncResult(device.DeletePortMapAsync(mapping), callback, asyncState);

            result.Task.ContinueWith(t => result.Complete(), TaskScheduler.Default);
            return(result);
        }
Exemplo n.º 2
0
        public static IAsyncResult BeginGetAllMappings(this INatDevice device, AsyncCallback callback, object asyncState)
        {
            var result = new TaskAsyncResult(device.GetAllMappingsAsync(), callback, asyncState);

            result.Task.ContinueWith(t => result.Complete(), TaskScheduler.Default);
            return(result);
        }
Exemplo n.º 3
0
        public static IAsyncResult BeginGetSpecificMapping(this INatDevice device, Protocol protocol, int externalPort, AsyncCallback callback, object asyncState)
        {
            var result = new TaskAsyncResult(device.GetSpecificMappingAsync(protocol, externalPort), callback, asyncState);

            result.Task.ContinueWith(t => result.Complete(), TaskScheduler.Default);
            return(result);
        }