- MyDownloader_demo.zip
- ffmpeg.exe
- ICSharpCode.SharpZipLib.dll
- MyDownloader.App.exe
- MyDownloader.App.exe.config
- MyDownloader.Core.dll
- MyDownloader.Extension.dll
- MyDownloader.Spider.dll
- pthreadGC2.dll
- TabStrip.dll
- MyDownloader_src.zip
- ICSharpCode.SharpZipLib.dll
- Interop.SHDocVw.dll
- MyDownloader.App
- MyDownloader.Core
- MyDownloader.Extension
- MyDownloader.IEPlugin
- MyDownloader.sln
- MyDownloader.Spider
- MyDownloader.Tests
- TabStrip.dll
|
using System;
using System.Collections.Generic;
using System.Text;
using MyDownloader.Core;
namespace MyDownloader.Extension.SpeedLimit
{
public class ProtocolProviderProxy: IProtocolProvider
{
private IProtocolProvider proxy;
private SpeedLimitExtension speedLimit;
#region IProtocolProvider Members
public void Initialize(Downloader downloader)
{
proxy.Initialize(downloader);
}
public System.IO.Stream CreateStream(ResourceLocation rl, long initialPosition, long endPosition)
{
return new LimitedRateStreamProxy(proxy.CreateStream(rl, initialPosition, endPosition), speedLimit);
}
public RemoteFileInfo GetFileInfo(ResourceLocation rl, out System.IO.Stream stream)
{
RemoteFileInfo result = proxy.GetFileInfo(rl, out stream);
if (stream != null)
{
stream = new LimitedRateStreamProxy(stream, speedLimit);
}
return result;
}
#endregion
public ProtocolProviderProxy(IProtocolProvider proxy, SpeedLimitExtension speedLimit)
{
this.proxy = proxy;
this.speedLimit = speedLimit;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.