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);
        }
        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);
        }
        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);
        }