本文整理汇总了C#中IModule.Process方法的典型用法代码示例。如果您正苦于以下问题:C# IModule.Process方法的具体用法?C# IModule.Process怎么用?C# IModule.Process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModule
的用法示例。
在下文中一共展示了IModule.Process方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateResponse
private void GenerateResponse(IModule module, HttpListenerContext context)
{
// Process the request then close the stream. All logic is delegated
// to the supplied IModule implementer.
module.Process(context.Response.OutputStream, context);
context.Response.Close();
}
示例2: CompressedCacheEntry
public CompressedCacheEntry(IModule destination, HttpListenerContext context)
{
Created = DateTime.Now;
using (MemoryStream memory = new MemoryStream())
{
// Store the raw document.
destination.Process(memory, context);
Content = memory.ToArray();
// Attempt to deflate the document, store if size is reduced.
using (MemoryStream deflateMemory = new MemoryStream())
using (DeflateStream deflate = new DeflateStream(deflateMemory, CompressionLevel.Optimal))
{
deflate.Write(Content, 0, Content.Length);
if (deflateMemory.Length < Content.Length)
{
Deflated = deflateMemory.ToArray();
IsDeflated = true;
}
else
{
IsDeflated = false;
}
}
}
}