mirror of https://github.com/SixLabors/ImageSharp
185 changed files with 14105 additions and 2342 deletions
@ -0,0 +1,13 @@ |
|||||
|
Copyright 2012 James South |
||||
|
|
||||
|
Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
you may not use this file except in compliance with the License. |
||||
|
You may obtain a copy of the License at |
||||
|
|
||||
|
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
|
||||
|
Unless required by applicable law or agreed to in writing, software |
||||
|
distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
See the License for the specific language governing permissions and |
||||
|
limitations under the License. |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -1,457 +0,0 @@ |
|||||
// -----------------------------------------------------------------------
|
|
||||
// <copyright file="Cache.cs" company="James South">
|
|
||||
// Copyright (c) James South.
|
|
||||
// Dual licensed under the MIT or GPL Version 2 licenses.
|
|
||||
// </copyright>
|
|
||||
// -----------------------------------------------------------------------
|
|
||||
|
|
||||
namespace ImageProcessor.Web.Caching |
|
||||
{ |
|
||||
#region Using
|
|
||||
using System; |
|
||||
using System.Collections.Concurrent; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Globalization; |
|
||||
using System.IO; |
|
||||
using System.Linq; |
|
||||
using System.Text.RegularExpressions; |
|
||||
using System.Threading.Tasks; |
|
||||
using System.Web; |
|
||||
using System.Web.Hosting; |
|
||||
using ImageProcessor.Helpers.Extensions; |
|
||||
using ImageProcessor.Web.Config; |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The cache.
|
|
||||
/// </summary>
|
|
||||
internal sealed class Cache |
|
||||
{ |
|
||||
#region Fields
|
|
||||
/// <summary>
|
|
||||
/// The maximum number of days to cache files on the system for.
|
|
||||
/// </summary>
|
|
||||
internal static readonly int MaxFileCachedDuration = ImageProcessorConfig.Instance.MaxCacheDays; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The valid sub directory chars. This used in combination with the file limit per folder
|
|
||||
/// allows the storage of 360,000 image files in the cache.
|
|
||||
/// </summary>
|
|
||||
private const string ValidSubDirectoryChars = "abcdefghijklmnopqrstuvwxyz0123456789"; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The maximum number of files allowed in the directory.
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// NTFS directories can handle up to 10,000 files in the directory before slowing down.
|
|
||||
/// This will help us to ensure that don't go over that limit.
|
|
||||
/// <see cref="http://stackoverflow.com/questions/197162/ntfs-performance-and-large-volumes-of-files-and-directories"/>
|
|
||||
/// <see cref="http://stackoverflow.com/questions/115882/how-do-you-deal-with-lots-of-small-files"/>
|
|
||||
/// <see cref="http://stackoverflow.com/questions/1638219/millions-of-small-graphics-files-and-how-to-overcome-slow-file-system-access-on"/>
|
|
||||
/// </remarks>
|
|
||||
private const int MaxFilesCount = 10000; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The regular expression to search strings for file extensions.
|
|
||||
/// </summary>
|
|
||||
private static readonly Regex FormatRegex = new Regex( |
|
||||
@"(jpeg|png|bmp|gif)", RegexOptions.RightToLeft | RegexOptions.Compiled); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The regular expression to search strings for valid subfolder names.
|
|
||||
/// We're specifically not using a shorter regex as we need to be able to iterate through
|
|
||||
/// each match group.
|
|
||||
/// </summary>
|
|
||||
private static readonly Regex SubFolderRegex = |
|
||||
new Regex( |
|
||||
@"(\/(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9)\/)", |
|
||||
RegexOptions.Compiled); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The absolute path to virtual cache path on the server.
|
|
||||
/// </summary>
|
|
||||
private static readonly string AbsoluteCachePath = |
|
||||
HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The concurrent dictionary.
|
|
||||
/// </summary>
|
|
||||
private static ConcurrentDictionary<string, CachedImage> concurrentDictionary = |
|
||||
new ConcurrentDictionary<string, CachedImage>(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The request path for the image.
|
|
||||
/// </summary>
|
|
||||
private string requestPath; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The image name
|
|
||||
/// </summary>
|
|
||||
private string imageName; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Whether the request is for a remote image.
|
|
||||
/// </summary>
|
|
||||
private bool isRemote; |
|
||||
#endregion
|
|
||||
|
|
||||
#region Constructors
|
|
||||
public Cache(string requestPath, string fullPath, string imageName, bool isRemote) |
|
||||
{ |
|
||||
this.requestPath = requestPath; |
|
||||
this.imageName = imageName; |
|
||||
this.isRemote = isRemote; |
|
||||
this.CachedPath = this.GetCachePath(fullPath, imageName); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
#region Properties
|
|
||||
/// <summary>
|
|
||||
/// Gets the cached path.
|
|
||||
/// </summary>
|
|
||||
internal string CachedPath { get; private set; } |
|
||||
#endregion
|
|
||||
|
|
||||
#region Methods
|
|
||||
#region Internal
|
|
||||
/// <summary>
|
|
||||
/// Converts an absolute file path
|
|
||||
/// </summary>
|
|
||||
/// <param name="absolutePath">The absolute path to convert.</param>
|
|
||||
/// <param name="request">The <see cref="T:System.Web.HttpRequest"/>from the current context.</param>
|
|
||||
/// <returns>The virtual path to the file.</returns>
|
|
||||
internal string GetVirtualPath(string absolutePath, HttpRequest request) |
|
||||
{ |
|
||||
string applicationPath = request.PhysicalApplicationPath; |
|
||||
string virtualDir = request.ApplicationPath; |
|
||||
virtualDir = virtualDir == "/" ? virtualDir : (virtualDir + "/"); |
|
||||
|
|
||||
if (applicationPath != null) |
|
||||
{ |
|
||||
return absolutePath.Replace(applicationPath, virtualDir).Replace(@"\", "/"); |
|
||||
} |
|
||||
|
|
||||
throw new InvalidOperationException( |
|
||||
"We can only map an absolute back to a relative path if the application path is available."); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Creates the cache directories for storing images.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// The true if the cache directories are created successfully; otherwise, false.
|
|
||||
/// </returns>
|
|
||||
internal static /*async*/ Task<bool> CreateDirectoriesAsync() |
|
||||
{ |
|
||||
return CreateDirectoriesAsyncTasks().ToTask<bool>(); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Adds an image to the cache.
|
|
||||
/// </summary>
|
|
||||
/// <param name="cachedPath">
|
|
||||
/// The cached path.
|
|
||||
/// </param>
|
|
||||
/// <param name="lastWriteTimeUtc">
|
|
||||
/// The last write time.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The task.
|
|
||||
/// </returns>
|
|
||||
internal Task /*async*/ AddImageToCacheAsync(DateTime lastWriteTimeUtc) |
|
||||
{ |
|
||||
return this.AddImageToCacheAsyncTask(lastWriteTimeUtc).ToTask(); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns a value indicating whether the original file is new or has been updated.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// True if the the original file is new or has been updated; otherwise, false.
|
|
||||
/// </returns>
|
|
||||
internal /*async*/ Task<bool> isNewOrUpdatedFileAsync() |
|
||||
{ |
|
||||
return this.isNewOrUpdatedFileAsyncTask().ToTask<bool>(); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Sets the LastWriteTime of the cached file to match the original file.
|
|
||||
/// </summary>
|
|
||||
/// The <see cref="System.DateTime"/> set to the last write time of the file.
|
|
||||
/// </returns>
|
|
||||
internal /*async*/ Task<DateTime> SetCachedLastWriteTimeAsync() |
|
||||
{ |
|
||||
return this.SetCachedLastWriteTimeAsyncTask().ToTask<DateTime>(); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Purges any files from the file-system cache in the given folders.
|
|
||||
/// </summary>
|
|
||||
internal /*async*/ Task TrimCachedFoldersAsync() |
|
||||
{ |
|
||||
return this.TrimCachedFoldersAsyncTask().ToTask(); |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
#region Private
|
|
||||
/// <summary>
|
|
||||
/// The create directories async tasks.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="IEnumerable{Task}"/>.
|
|
||||
/// </returns>
|
|
||||
private static IEnumerable<Task> CreateDirectoriesAsyncTasks() |
|
||||
{ |
|
||||
bool success = true; |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
Parallel.ForEach( |
|
||||
ValidSubDirectoryChars.ToCharArray(), |
|
||||
(extension, loop) => |
|
||||
{ |
|
||||
string path = Path.Combine(AbsoluteCachePath, extension.ToString(CultureInfo.InvariantCulture)); |
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(path); |
|
||||
|
|
||||
if (!directoryInfo.Exists) |
|
||||
{ |
|
||||
directoryInfo.Create(); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
catch |
|
||||
{ |
|
||||
success = false; |
|
||||
} |
|
||||
|
|
||||
yield return TaskEx.FromResult(success); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Adds an image to the cache.
|
|
||||
/// </summary>
|
|
||||
/// <param name="lastWriteTimeUtc">
|
|
||||
/// The last write time.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="IEnumerable{Task}"/>.
|
|
||||
/// </returns>
|
|
||||
private IEnumerable<Task> AddImageToCacheAsyncTask(DateTime lastWriteTimeUtc) |
|
||||
{ |
|
||||
string key = Path.GetFileNameWithoutExtension(this.CachedPath); |
|
||||
DateTime expires = DateTime.UtcNow.AddDays(MaxFileCachedDuration).ToUniversalTime(); |
|
||||
CachedImage cachedImage = new CachedImage(this.CachedPath, MaxFileCachedDuration, lastWriteTimeUtc, expires); |
|
||||
PersistantDictionary.Instance.Add(key, cachedImage); |
|
||||
|
|
||||
yield break; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns a value indicating whether the original file is new or has been updated.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="IEnumerable{Task}"/>.
|
|
||||
/// </returns>
|
|
||||
private IEnumerable<Task> isNewOrUpdatedFileAsyncTask() |
|
||||
{ |
|
||||
string key = Path.GetFileNameWithoutExtension(this.CachedPath); |
|
||||
CachedImage cachedImage; |
|
||||
bool isUpdated = false; |
|
||||
|
|
||||
if (this.isRemote) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage)) |
|
||||
{ |
|
||||
// Can't check the last write time so check to see if the cached image is set to expire
|
|
||||
// or if the max age is different.
|
|
||||
if (cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) |
|
||||
|| cachedImage.MaxAge != MaxFileCachedDuration) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
isUpdated = true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
// Nothing in the cache so we should return true.
|
|
||||
isUpdated = true; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// Test now for locally requested files.
|
|
||||
if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage)) |
|
||||
{ |
|
||||
FileInfo imageFileInfo = new FileInfo(this.requestPath); |
|
||||
|
|
||||
if (imageFileInfo.Exists) |
|
||||
{ |
|
||||
// Check to see if the last write time is different of whether the
|
|
||||
// cached image is set to expire or if the max age is different.
|
|
||||
if (imageFileInfo.LastWriteTimeUtc != cachedImage.LastWriteTimeUtc |
|
||||
|| cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) |
|
||||
|| cachedImage.MaxAge != MaxFileCachedDuration) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
isUpdated = true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
// Nothing in the cache so we should return true.
|
|
||||
isUpdated = true; |
|
||||
} |
|
||||
|
|
||||
yield return TaskEx.FromResult(isUpdated); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Sets the LastWriteTime of the cached file to match the original file.
|
|
||||
/// </summary>
|
|
||||
/// <param name="imagePath">
|
|
||||
/// The original image path.
|
|
||||
/// </param>
|
|
||||
/// <param name="cachedImagePath">
|
|
||||
/// The cached image path.
|
|
||||
/// </param>
|
|
||||
/// <param name="isRemote">Whether the file is remote.</param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="IEnumerable{Task}"/>.
|
|
||||
/// </returns>
|
|
||||
private IEnumerable<Task> SetCachedLastWriteTimeAsyncTask() |
|
||||
{ |
|
||||
FileInfo cachedFileInfo = new FileInfo(this.CachedPath); |
|
||||
DateTime lastWriteTime = DateTime.MinValue.ToUniversalTime(); |
|
||||
|
|
||||
if (isRemote) |
|
||||
{ |
|
||||
if (cachedFileInfo.Exists) |
|
||||
{ |
|
||||
lastWriteTime = cachedFileInfo.LastWriteTimeUtc; |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
FileInfo imageFileInfo = new FileInfo(this.requestPath); |
|
||||
|
|
||||
if (imageFileInfo.Exists && cachedFileInfo.Exists) |
|
||||
{ |
|
||||
DateTime dateTime = imageFileInfo.LastWriteTimeUtc; |
|
||||
cachedFileInfo.LastWriteTimeUtc = dateTime; |
|
||||
|
|
||||
lastWriteTime = dateTime; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
yield return TaskEx.FromResult(lastWriteTime); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Purges any files from the file-system cache in the given folders.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="IEnumerable{Task}"/>.
|
|
||||
/// </returns>
|
|
||||
private IEnumerable<Task> TrimCachedFoldersAsyncTask() |
|
||||
{ |
|
||||
// Group each cache folder and clear any expired items or any that exeed
|
|
||||
// the maximum allowable count.
|
|
||||
var groups = PersistantDictionary.Instance.ToList() |
|
||||
.GroupBy(x => SubFolderRegex.Match(x.Value.Path).Value) |
|
||||
.Where(g => g.Count() > MaxFilesCount); |
|
||||
|
|
||||
foreach (var group in groups) |
|
||||
{ |
|
||||
int groupCount = group.Count(); |
|
||||
|
|
||||
foreach (KeyValuePair<string, CachedImage> pair in group.OrderBy(x => x.Value.ExpiresUtc)) |
|
||||
{ |
|
||||
// If the group count is equal to the max count minus 1 then we know we
|
|
||||
// are counting down from a full directory not simply clearing out
|
|
||||
// expired items.
|
|
||||
if (groupCount == MaxFilesCount - 1) |
|
||||
{ |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
// Remove from the cache and delete each CachedImage.
|
|
||||
FileInfo fileInfo = new FileInfo(pair.Value.Path); |
|
||||
string key = Path.GetFileNameWithoutExtension(fileInfo.Name); |
|
||||
CachedImage cachedImage; |
|
||||
|
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
fileInfo.Delete(); |
|
||||
groupCount -= 1; |
|
||||
} |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
// Do Nothing, skip to the next.
|
|
||||
// TODO: Should we handle this?
|
|
||||
continue; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
yield break; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Gets the full transformed cached path for the image.
|
|
||||
/// The file names are stored as MD5 encrypted versions of the full request path.
|
|
||||
/// This should make them unique enough to
|
|
||||
/// </summary>
|
|
||||
/// <param name="fullPath">The original image path.</param>
|
|
||||
/// <param name="imageName">The original image name.</param>
|
|
||||
/// <returns>The full cached path for the image.</returns>
|
|
||||
private string GetCachePath(string fullPath, string imageName) |
|
||||
{ |
|
||||
string cachedPath = string.Empty; |
|
||||
|
|
||||
if (AbsoluteCachePath != null) |
|
||||
{ |
|
||||
// Use an md5 hash of the full path including the querystring to create the image name.
|
|
||||
// That name can also be used as a key for the cached image and we should be able to use
|
|
||||
// The first character of that hash as a subfolder.
|
|
||||
string parsedExtension = this.ParseExtension(fullPath); |
|
||||
string fallbackExtension = imageName.Substring(imageName.LastIndexOf(".", StringComparison.Ordinal) + 1); |
|
||||
string encryptedName = fullPath.ToMD5Fingerprint(); |
|
||||
string subpath = encryptedName.Substring(0, 1); |
|
||||
|
|
||||
string cachedFileName = string.Format( |
|
||||
"{0}.{1}", |
|
||||
encryptedName, |
|
||||
!string.IsNullOrWhiteSpace(parsedExtension) ? parsedExtension : fallbackExtension); |
|
||||
|
|
||||
cachedPath = Path.Combine(AbsoluteCachePath, subpath, cachedFileName); |
|
||||
} |
|
||||
|
|
||||
return cachedPath; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns the correct file extension for the given string input
|
|
||||
/// </summary>
|
|
||||
/// <param name="input">
|
|
||||
/// The string to parse.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The correct file extension for the given string input if it can find one; otherwise an empty string.
|
|
||||
/// </returns>
|
|
||||
private string ParseExtension(string input) |
|
||||
{ |
|
||||
Match match = FormatRegex.Match(input); |
|
||||
|
|
||||
return match.Success ? match.Value : string.Empty; |
|
||||
} |
|
||||
#endregion
|
|
||||
#endregion
|
|
||||
} |
|
||||
} |
|
||||
@ -1,346 +0,0 @@ |
|||||
// -----------------------------------------------------------------------
|
|
||||
// <copyright file="DiskCache.cs" company="James South">
|
|
||||
// Copyright (c) James South.
|
|
||||
// Dual licensed under the MIT or GPL Version 2 licenses.
|
|
||||
// </copyright>
|
|
||||
// -----------------------------------------------------------------------
|
|
||||
|
|
||||
namespace ImageProcessor.Web.Caching |
|
||||
{ |
|
||||
#region Using
|
|
||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Globalization; |
|
||||
using System.IO; |
|
||||
using System.Linq; |
|
||||
using System.Text.RegularExpressions; |
|
||||
using System.Threading.Tasks; |
|
||||
using System.Web; |
|
||||
using System.Web.Hosting; |
|
||||
using ImageProcessor.Helpers.Extensions; |
|
||||
using ImageProcessor.Web.Config; |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Encapsulates methods to handle disk caching of images.
|
|
||||
/// </summary>
|
|
||||
internal sealed class DiskCache |
|
||||
{ |
|
||||
#region Fields
|
|
||||
/// <summary>
|
|
||||
/// The maximum number of days to cache files on the system for.
|
|
||||
/// </summary>
|
|
||||
internal static readonly int MaxFileCachedDuration = ImageProcessorConfig.Instance.MaxCacheDays; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The valid sub directory chars. This used in combination with the file limit per folder
|
|
||||
/// allows the storage of 360,000 image files in the cache.
|
|
||||
/// </summary>
|
|
||||
private const string ValidSubDirectoryChars = "abcdefghijklmnopqrstuvwxyz0123456789"; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The maximum number of files allowed in the directory.
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// NTFS directories can handle up to 10,000 files in the directory before slowing down.
|
|
||||
/// This will help us to ensure that don't go over that limit.
|
|
||||
/// <see cref="http://stackoverflow.com/questions/197162/ntfs-performance-and-large-volumes-of-files-and-directories"/>
|
|
||||
/// <see cref="http://stackoverflow.com/questions/115882/how-do-you-deal-with-lots-of-small-files"/>
|
|
||||
/// <see cref="http://stackoverflow.com/questions/1638219/millions-of-small-graphics-files-and-how-to-overcome-slow-file-system-access-on"/>
|
|
||||
/// </remarks>
|
|
||||
private const int MaxFilesCount = 10000; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The regular expression to search strings for file extensions.
|
|
||||
/// </summary>
|
|
||||
private static readonly Regex FormatRegex = new Regex( |
|
||||
@"(jpeg|png|bmp|gif)", RegexOptions.RightToLeft | RegexOptions.Compiled); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The regular expression to search strings for valid subfolder names.
|
|
||||
/// We're specifically not using a shorter regex as we need to be able to iterate through
|
|
||||
/// each match group.
|
|
||||
/// </summary>
|
|
||||
private static readonly Regex SubFolderRegex = new Regex(@"(\/(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9)\/)", RegexOptions.Compiled); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The absolute path to virtual cache path on the server.
|
|
||||
/// </summary>
|
|
||||
private static readonly string AbsoluteCachePath = |
|
||||
HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); |
|
||||
|
|
||||
#endregion
|
|
||||
|
|
||||
#region Methods
|
|
||||
/// <summary>
|
|
||||
/// The create cache paths.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// The true if the cache directories are created successfully; otherwise, false.
|
|
||||
/// </returns>
|
|
||||
internal static bool CreateCacheDirectories() |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
Parallel.ForEach( |
|
||||
ValidSubDirectoryChars.ToCharArray(), |
|
||||
(extension, loop) => |
|
||||
{ |
|
||||
string path = Path.Combine(AbsoluteCachePath, extension.ToString(CultureInfo.InvariantCulture)); |
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(path); |
|
||||
|
|
||||
if (!directoryInfo.Exists) |
|
||||
{ |
|
||||
directoryInfo.Create(); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
catch |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Gets the full transformed cached path for the image.
|
|
||||
/// The file names are stored as MD5 encrypted versions of the full request path.
|
|
||||
/// This should make them unique enough to
|
|
||||
/// </summary>
|
|
||||
/// <param name="imagePath">The original image path.</param>
|
|
||||
/// <param name="imageName">The original image name.</param>
|
|
||||
/// <returns>The full cached path for the image.</returns>
|
|
||||
internal static string GetCachePath(string imagePath, string imageName) |
|
||||
{ |
|
||||
string cachedPath = string.Empty; |
|
||||
|
|
||||
if (AbsoluteCachePath != null) |
|
||||
{ |
|
||||
// Use an md5 hash of the full path including the querystring to create the image name.
|
|
||||
// That name can also be used as a key for the cached image and we should be able to use
|
|
||||
// The first character of that hash as a subfolder.
|
|
||||
string parsedExtension = ParseExtension(imagePath); |
|
||||
string fallbackExtension = imageName.Substring(imageName.LastIndexOf(".", StringComparison.Ordinal) + 1); |
|
||||
string encryptedName = imagePath.ToMD5Fingerprint(); |
|
||||
string subpath = encryptedName.Substring(0, 1); |
|
||||
|
|
||||
string cachedFileName = string.Format( |
|
||||
"{0}.{1}", |
|
||||
encryptedName, |
|
||||
!string.IsNullOrWhiteSpace(parsedExtension) ? parsedExtension : fallbackExtension); |
|
||||
|
|
||||
cachedPath = Path.Combine(AbsoluteCachePath, subpath, cachedFileName); |
|
||||
} |
|
||||
|
|
||||
return cachedPath; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Adds an image to the cache.
|
|
||||
/// </summary>
|
|
||||
/// <param name="cachedPath">
|
|
||||
/// The cached path.
|
|
||||
/// </param>
|
|
||||
/// <param name="lastWriteTimeUtc">
|
|
||||
/// The last write time.
|
|
||||
/// </param>
|
|
||||
internal static void AddImageToCache(string cachedPath, DateTime lastWriteTimeUtc) |
|
||||
{ |
|
||||
string key = Path.GetFileNameWithoutExtension(cachedPath); |
|
||||
DateTime expires = DateTime.UtcNow.AddDays(MaxFileCachedDuration).ToUniversalTime(); |
|
||||
CachedImage cachedImage = new CachedImage(cachedPath, MaxFileCachedDuration, lastWriteTimeUtc, expires); |
|
||||
PersistantDictionary.Instance.Add(key, cachedImage); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Converts an absolute file path
|
|
||||
/// </summary>
|
|
||||
/// <param name="absolutePath">The absolute path to convert.</param>
|
|
||||
/// <param name="request">The <see cref="T:System.Web.HttpRequest"/>from the current context.</param>
|
|
||||
/// <returns>The virtual path to the file.</returns>
|
|
||||
internal static string GetVirtualPath(string absolutePath, HttpRequest request) |
|
||||
{ |
|
||||
string applicationPath = request.PhysicalApplicationPath; |
|
||||
string virtualDir = request.ApplicationPath; |
|
||||
virtualDir = virtualDir == "/" ? virtualDir : (virtualDir + "/"); |
|
||||
|
|
||||
if (applicationPath != null) |
|
||||
{ |
|
||||
return absolutePath.Replace(applicationPath, virtualDir).Replace(@"\", "/"); |
|
||||
} |
|
||||
|
|
||||
throw new InvalidOperationException("We can only map an absolute back to a relative path if the application path is available."); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns a value indicating whether the original file has been updated.
|
|
||||
/// </summary>
|
|
||||
/// <param name="imagePath">The original image path.</param>
|
|
||||
/// <param name="cachedImagePath">The cached image path.</param>
|
|
||||
/// <param name="isRemote">Whether the file is a remote request.</param>
|
|
||||
/// <returns>
|
|
||||
/// True if the the original file has been updated; otherwise, false.
|
|
||||
/// </returns>
|
|
||||
internal static bool IsUpdatedFile(string imagePath, string cachedImagePath, bool isRemote) |
|
||||
{ |
|
||||
string key = Path.GetFileNameWithoutExtension(cachedImagePath); |
|
||||
CachedImage cachedImage; |
|
||||
|
|
||||
if (isRemote) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage)) |
|
||||
{ |
|
||||
// Can't check the last write time so check to see if the cached image is set to expire
|
|
||||
// or if the max age is different.
|
|
||||
if (cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) |
|
||||
|| cachedImage.MaxAge != MaxFileCachedDuration) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
// We can jump out here.
|
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
// Nothing in the cache so we should return true.
|
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
// Test now for locally requested files.
|
|
||||
if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage)) |
|
||||
{ |
|
||||
FileInfo imageFileInfo = new FileInfo(imagePath); |
|
||||
|
|
||||
if (imageFileInfo.Exists) |
|
||||
{ |
|
||||
// Check to see if the last write time is different of whether the
|
|
||||
// cached image is set to expire or if the max age is different.
|
|
||||
if (imageFileInfo.LastWriteTimeUtc != cachedImage.LastWriteTimeUtc |
|
||||
|| cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) |
|
||||
|| cachedImage.MaxAge != MaxFileCachedDuration) |
|
||||
{ |
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
// Nothing in the cache so we should return true.
|
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Sets the LastWriteTime of the cached file to match the original file.
|
|
||||
/// </summary>
|
|
||||
/// <param name="imagePath">
|
|
||||
/// The original image path.
|
|
||||
/// </param>
|
|
||||
/// <param name="cachedImagePath">
|
|
||||
/// The cached image path.
|
|
||||
/// </param>
|
|
||||
/// <param name="isRemote">Whether the file is remote.</param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="System.DateTime"/> set to the last write time of the file.
|
|
||||
/// </returns>
|
|
||||
internal static DateTime SetCachedLastWriteTime(string imagePath, string cachedImagePath, bool isRemote) |
|
||||
{ |
|
||||
FileInfo cachedFileInfo = new FileInfo(cachedImagePath); |
|
||||
|
|
||||
if (isRemote) |
|
||||
{ |
|
||||
if (cachedFileInfo.Exists) |
|
||||
{ |
|
||||
return cachedFileInfo.LastWriteTimeUtc; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
FileInfo imageFileInfo = new FileInfo(imagePath); |
|
||||
|
|
||||
if (imageFileInfo.Exists && cachedFileInfo.Exists) |
|
||||
{ |
|
||||
DateTime dateTime = imageFileInfo.LastWriteTimeUtc; |
|
||||
cachedFileInfo.LastWriteTimeUtc = dateTime; |
|
||||
|
|
||||
return dateTime; |
|
||||
} |
|
||||
|
|
||||
return DateTime.MinValue.ToUniversalTime(); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Purges any files from the file-system cache in the given folders.
|
|
||||
/// </summary>
|
|
||||
internal static void TrimCachedFolders() |
|
||||
{ |
|
||||
// Group each cache folder and clear any expired items or any that exeed
|
|
||||
// the maximum allowable count.
|
|
||||
var groups = PersistantDictionary.Instance.ToList() |
|
||||
.GroupBy(x => SubFolderRegex.Match(x.Value.Path).Value) |
|
||||
.Where(g => g.Count() > MaxFilesCount); |
|
||||
|
|
||||
foreach (var group in groups) |
|
||||
{ |
|
||||
int groupCount = group.Count(); |
|
||||
|
|
||||
foreach (KeyValuePair<string, CachedImage> pair in group.OrderBy(x => x.Value.ExpiresUtc)) |
|
||||
{ |
|
||||
// If the group count is equal to the max count minus 1 then we know we
|
|
||||
// are counting down from a full directory not simply clearing out
|
|
||||
// expired items.
|
|
||||
if (groupCount == MaxFilesCount - 1) |
|
||||
{ |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
try |
|
||||
{ |
|
||||
// Remove from the cache and delete each CachedImage.
|
|
||||
FileInfo fileInfo = new FileInfo(pair.Value.Path); |
|
||||
string key = Path.GetFileNameWithoutExtension(fileInfo.Name); |
|
||||
CachedImage cachedImage; |
|
||||
|
|
||||
if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) |
|
||||
{ |
|
||||
fileInfo.Delete(); |
|
||||
groupCount -= 1; |
|
||||
} |
|
||||
} |
|
||||
catch (Exception) |
|
||||
{ |
|
||||
// Do Nothing, skip to the next.
|
|
||||
// TODO: Should we handle this?
|
|
||||
continue; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns the correct file extension for the given string input
|
|
||||
/// </summary>
|
|
||||
/// <param name="input">
|
|
||||
/// The string to parse.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The correct file extension for the given string input if it can find one; otherwise an empty string.
|
|
||||
/// </returns>
|
|
||||
private static string ParseExtension(string input) |
|
||||
{ |
|
||||
Match match = FormatRegex.Match(input); |
|
||||
|
|
||||
return match.Success ? match.Value : string.Empty; |
|
||||
} |
|
||||
|
|
||||
#endregion
|
|
||||
} |
|
||||
} |
|
||||
@ -1,64 +0,0 @@ |
|||||
// License: CPOL at http://www.codeproject.com/info/cpol10.aspx
|
|
||||
using System.Collections.Generic; |
|
||||
using System.Net; |
|
||||
using System.Threading; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace System.IO |
|
||||
{ |
|
||||
public static class AsyncIoExtensions |
|
||||
{ |
|
||||
public static Task<Stream> GetRequestStreamAsync(this WebRequest webRequest) |
|
||||
{ |
|
||||
return Task.Factory.FromAsync( |
|
||||
webRequest.BeginGetRequestStream, |
|
||||
ar => webRequest.EndGetRequestStream(ar), |
|
||||
null); |
|
||||
} |
|
||||
|
|
||||
public static Task<WebResponse> GetResponseAsync(this WebRequest webRequest) |
|
||||
{ |
|
||||
return Task.Factory.FromAsync( |
|
||||
webRequest.BeginGetResponse, |
|
||||
ar => webRequest.EndGetResponse(ar), |
|
||||
null); |
|
||||
} |
|
||||
|
|
||||
public static Task<int> ReadAsync(this Stream input, Byte[] buffer, int offset, int count) |
|
||||
{ |
|
||||
return Task.Factory.FromAsync( |
|
||||
input.BeginRead, |
|
||||
(Func<IAsyncResult, int>)input.EndRead, |
|
||||
buffer, offset, count, |
|
||||
null); |
|
||||
} |
|
||||
|
|
||||
public static Task WriteAsync(this Stream input, Byte[] buffer, int offset, int count) |
|
||||
{ |
|
||||
return Task.Factory.FromAsync( |
|
||||
input.BeginWrite, |
|
||||
input.EndWrite, |
|
||||
buffer, offset, count, |
|
||||
null); |
|
||||
} |
|
||||
|
|
||||
public static /*async*/ Task CopyToAsync(this Stream input, Stream output, CancellationToken cancellationToken = default(CancellationToken)) |
|
||||
{ |
|
||||
return CopyToAsyncTasks(input, output, cancellationToken).ToTask(); |
|
||||
} |
|
||||
private static IEnumerable<Task> CopyToAsyncTasks(Stream input, Stream output, CancellationToken cancellationToken) |
|
||||
{ |
|
||||
byte[] buffer = new byte[0x1000]; // 4 KiB
|
|
||||
while (true) |
|
||||
{ |
|
||||
cancellationToken.ThrowIfCancellationRequested(); |
|
||||
var readTask = input.ReadAsync(buffer, 0, buffer.Length); |
|
||||
yield return readTask; |
|
||||
if (readTask.Result == 0) break; |
|
||||
|
|
||||
cancellationToken.ThrowIfCancellationRequested(); |
|
||||
yield return output.WriteAsync(buffer, 0, readTask.Result); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,347 +0,0 @@ |
|||||
// -----------------------------------------------------------------------
|
|
||||
// <copyright file="RemoteFile.cs" company="James South">
|
|
||||
// Copyright (c) James South.
|
|
||||
// Dual licensed under the MIT or GPL Version 2 licenses.
|
|
||||
// </copyright>
|
|
||||
// -----------------------------------------------------------------------
|
|
||||
|
|
||||
namespace ImageProcessor.Web.Helpers |
|
||||
{ |
|
||||
#region Using
|
|
||||
using System; |
|
||||
using System.Diagnostics.Contracts; |
|
||||
using System.Globalization; |
|
||||
using System.IO; |
|
||||
using System.Linq; |
|
||||
using System.Net; |
|
||||
using System.Security; |
|
||||
using System.Text; |
|
||||
using ImageProcessor.Web.Config; |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Encapsulates methods used to download files from a website address.
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// <para>
|
|
||||
/// The purpose of this class is so there's one core way of downloading remote files with url[s] that are from
|
|
||||
/// outside users. There's various areas in application where an attacker could supply an external url to the server
|
|
||||
/// and tie up resources.
|
|
||||
/// </para>
|
|
||||
/// For example, the ImageProcessingModule accepts off-server addresses as a path. An attacker could, for instance, pass the url
|
|
||||
/// to a file that's a few gigs in size, causing the server to get out-of-memory exceptions or some other errors. An attacker
|
|
||||
/// could also use this same method to use one application instance to hammer another site by, again, passing an off-server
|
|
||||
/// address of the victims site to the ImageProcessingModule.
|
|
||||
/// This class will not throw an exception if the Uri supplied points to a resource local to the running application instance.
|
|
||||
/// <para>
|
|
||||
/// There shouldn't be any security issues there, as the internal WebRequest instance is still calling it remotely.
|
|
||||
/// Any local files that shouldn't be accessed by this won't be allowed by the remote call.
|
|
||||
/// </para>
|
|
||||
/// Adapted from <see cref="http://blogengine.codeplex.com">BlogEngine.Net</see>
|
|
||||
/// </remarks>
|
|
||||
internal sealed class RemoteFile |
|
||||
{ |
|
||||
#region Fields
|
|
||||
/// <summary>
|
|
||||
/// The white-list of url[s] from which to download remote files.
|
|
||||
/// </summary>
|
|
||||
private static readonly Uri[] RemoteFileWhiteList = ImageProcessorConfig.Instance.RemoteFileWhiteList; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The length of time, in milliseconds, that a remote file download attempt can last before timing out.
|
|
||||
/// </summary>
|
|
||||
private static readonly int TimeoutMilliseconds = ImageProcessorConfig.Instance.Timeout; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The maximum size, in bytes, that a remote file download attempt can download.
|
|
||||
/// </summary>
|
|
||||
private static readonly int MaxBytes = ImageProcessorConfig.Instance.MaxBytes; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Whether to allow remote downloads.
|
|
||||
/// </summary>
|
|
||||
private static readonly bool AllowRemoteDownloads = ImageProcessorConfig.Instance.AllowRemoteDownloads; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Whether this RemoteFile instance is ignoring remote download rules set in the current application
|
|
||||
/// instance.
|
|
||||
/// </summary>
|
|
||||
private readonly bool ignoreRemoteDownloadSettings; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The <see cref="T:System.Uri">Uri</see> of the remote file being downloaded.
|
|
||||
/// </summary>
|
|
||||
private readonly Uri url; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The maximum allowable download size in bytes.
|
|
||||
/// </summary>
|
|
||||
private readonly int maxDownloadSize; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The length of time, in milliseconds, that a remote file download attempt can last before timing out.
|
|
||||
/// </summary>
|
|
||||
private int timeoutLength; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The <see cref="T:System.Net.WebResponse">WebResponse</see> object used internally for this RemoteFile instance.
|
|
||||
/// </summary>
|
|
||||
private WebRequest webRequest; |
|
||||
#endregion
|
|
||||
|
|
||||
#region Constructors
|
|
||||
/// <summary>
|
|
||||
/// Initializes a new instance of the <see cref="T:ImageProcessor.Web.Helpers.RemoteFile">RemoteFile</see> class.
|
|
||||
/// </summary>
|
|
||||
/// <param name="filePath">The url of the file to be downloaded.</param>
|
|
||||
/// <param name="ignoreRemoteDownloadSettings">
|
|
||||
/// If set to <see langword="true"/>, then RemoteFile should ignore the current the applications instance's remote download settings; otherwise,<see langword="false"/>.
|
|
||||
/// </param>
|
|
||||
internal RemoteFile(Uri filePath, bool ignoreRemoteDownloadSettings) |
|
||||
{ |
|
||||
Contract.Requires(filePath != null); |
|
||||
|
|
||||
this.url = filePath; |
|
||||
this.ignoreRemoteDownloadSettings = ignoreRemoteDownloadSettings; |
|
||||
this.timeoutLength = TimeoutMilliseconds; |
|
||||
this.maxDownloadSize = MaxBytes; |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
#region Properties
|
|
||||
/// <summary>
|
|
||||
/// Gets a value indicating whether this RemoteFile instance is ignoring remote download rules set in the
|
|
||||
/// current application instance.
|
|
||||
/// <remarks>
|
|
||||
/// This should only be set to true if the supplied url is a verified resource. Use at your own risk.
|
|
||||
/// </remarks>
|
|
||||
/// </summary>
|
|
||||
/// <value>
|
|
||||
/// <see langword="true"/> if this RemoteFile instance is ignoring remote download rules set in the current
|
|
||||
/// application instance; otherwise, <see langword="false"/>.
|
|
||||
/// </value>
|
|
||||
public bool IgnoreRemoteDownloadSettings |
|
||||
{ |
|
||||
get |
|
||||
{ |
|
||||
return this.ignoreRemoteDownloadSettings; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Gets the Uri of the remote file being downloaded.
|
|
||||
/// </summary>
|
|
||||
public Uri Uri |
|
||||
{ |
|
||||
get |
|
||||
{ |
|
||||
return this.url; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Gets or sets the length of time, in milliseconds, that a remote file download attempt can
|
|
||||
/// last before timing out.
|
|
||||
/// <remarks>
|
|
||||
/// <para>
|
|
||||
/// This value can only be set if the instance is supposed to ignore the remote download settings set
|
|
||||
/// in the current application instance.
|
|
||||
/// </para>
|
|
||||
/// <para>
|
|
||||
/// Set this value to 0 if there should be no timeout.
|
|
||||
/// </para>
|
|
||||
/// </remarks>
|
|
||||
/// </summary>
|
|
||||
public int TimeoutLength |
|
||||
{ |
|
||||
get |
|
||||
{ |
|
||||
return this.IgnoreRemoteDownloadSettings ? this.timeoutLength : TimeoutMilliseconds; |
|
||||
} |
|
||||
|
|
||||
set |
|
||||
{ |
|
||||
if (!this.IgnoreRemoteDownloadSettings) |
|
||||
{ |
|
||||
throw new SecurityException("Timeout length can not be adjusted on remote files that are abiding by remote download rules"); |
|
||||
} |
|
||||
|
|
||||
if (value < 0) |
|
||||
{ |
|
||||
throw new ArgumentOutOfRangeException("TimeoutLength"); |
|
||||
} |
|
||||
|
|
||||
this.timeoutLength = value; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Gets or sets the maximum download size, in bytes, that a remote file download attempt can be.
|
|
||||
/// <remarks>
|
|
||||
/// <para>
|
|
||||
/// This value can only be set if the instance is supposed to ignore the remote download settings set
|
|
||||
/// in the current application instance.
|
|
||||
/// </para>
|
|
||||
/// <para>
|
|
||||
/// Set this value to 0 if there should be no timeout.
|
|
||||
/// </para>
|
|
||||
/// </remarks>
|
|
||||
/// </summary>
|
|
||||
public int MaxDownloadSize |
|
||||
{ |
|
||||
get |
|
||||
{ |
|
||||
return this.IgnoreRemoteDownloadSettings ? this.maxDownloadSize : MaxBytes; |
|
||||
} |
|
||||
|
|
||||
set |
|
||||
{ |
|
||||
if (!this.IgnoreRemoteDownloadSettings) |
|
||||
{ |
|
||||
throw new SecurityException("Max Download Size can not be adjusted on remote files that are abiding by remote download rules"); |
|
||||
} |
|
||||
|
|
||||
if (value < 0) |
|
||||
{ |
|
||||
throw new ArgumentOutOfRangeException("MaxDownloadSize"); |
|
||||
} |
|
||||
|
|
||||
this.timeoutLength = value; |
|
||||
} |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
#region Methods
|
|
||||
#region Public
|
|
||||
/// <summary>
|
|
||||
/// Returns the <see cref="T:System.Net.WebResponse">WebResponse</see> used to download this file.
|
|
||||
/// <remarks>
|
|
||||
/// <para>
|
|
||||
/// This method is meant for outside users who need specific access to the WebResponse this class
|
|
||||
/// generates. They're responsible for disposing of it.
|
|
||||
/// </para>
|
|
||||
/// </remarks>
|
|
||||
/// </summary>
|
|
||||
/// <returns>The <see cref="T:System.Net.WebResponse">WebResponse</see> used to download this file.</returns>
|
|
||||
public WebResponse GetWebResponse() |
|
||||
{ |
|
||||
WebResponse response = this.GetWebRequest().GetResponse(); |
|
||||
|
|
||||
long contentLength = response.ContentLength; |
|
||||
|
|
||||
// WebResponse.ContentLength doesn't always know the value, it returns -1 in this case.
|
|
||||
if (contentLength == -1) |
|
||||
{ |
|
||||
// Response headers may still have the Content-Length inside of it.
|
|
||||
string headerContentLength = response.Headers["Content-Length"]; |
|
||||
|
|
||||
if (!string.IsNullOrWhiteSpace(headerContentLength)) |
|
||||
{ |
|
||||
contentLength = long.Parse(headerContentLength, CultureInfo.InvariantCulture); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// We don't need to check the url here since any external urls are available only from the web.config.
|
|
||||
if ((this.MaxDownloadSize > 0) && (contentLength > this.MaxDownloadSize)) |
|
||||
{ |
|
||||
response.Close(); |
|
||||
throw new SecurityException("An attempt to download a remote file has been halted because the file is larger than allowed."); |
|
||||
} |
|
||||
|
|
||||
return response; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns the remote file as a String.
|
|
||||
/// <remarks>
|
|
||||
/// This returns the resulting stream as a string as passed through a StreamReader.
|
|
||||
/// </remarks>
|
|
||||
/// </summary>
|
|
||||
/// <returns>The remote file as a String.</returns>
|
|
||||
public string GetFileAsString() |
|
||||
{ |
|
||||
using (WebResponse response = this.GetWebResponse()) |
|
||||
{ |
|
||||
Stream responseStream = response.GetResponseStream(); |
|
||||
|
|
||||
if (responseStream != null) |
|
||||
{ |
|
||||
// Pipe the stream to a stream reader with the required encoding format.
|
|
||||
using (StreamReader reader = new StreamReader(responseStream, Encoding.UTF8)) |
|
||||
{ |
|
||||
return reader.ReadToEnd(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
return string.Empty; |
|
||||
} |
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
#region Private
|
|
||||
/// <summary>
|
|
||||
/// Performs a check to see whether the application is able to download remote files.
|
|
||||
/// </summary>
|
|
||||
private void CheckCanDownload() |
|
||||
{ |
|
||||
if (!this.IgnoreRemoteDownloadSettings && !AllowRemoteDownloads) |
|
||||
{ |
|
||||
throw new SecurityException("application is not configured to allow remote file downloads."); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Creates the WebRequest object used internally for this RemoteFile instance.
|
|
||||
/// </summary>
|
|
||||
/// <returns>
|
|
||||
/// <para>
|
|
||||
/// The WebRequest should not be passed outside of this instance, as it will allow tampering. Anyone
|
|
||||
/// that needs more fine control over the downloading process should probably be using the WebRequest
|
|
||||
/// class on its own.
|
|
||||
/// </para>
|
|
||||
/// </returns>
|
|
||||
private WebRequest GetWebRequest() |
|
||||
{ |
|
||||
// Check downloads are allowed.
|
|
||||
this.CheckCanDownload(); |
|
||||
|
|
||||
// Check the url is from a whitelisted location.
|
|
||||
this.CheckSafeUrlLocation(); |
|
||||
|
|
||||
if (this.webRequest == null) |
|
||||
{ |
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(this.Uri); |
|
||||
request.Headers["Accept-Encoding"] = "gzip"; |
|
||||
request.Headers["Accept-Language"] = "en-us"; |
|
||||
request.Credentials = CredentialCache.DefaultNetworkCredentials; |
|
||||
request.AutomaticDecompression = DecompressionMethods.GZip; |
|
||||
|
|
||||
if (this.TimeoutLength > 0) |
|
||||
{ |
|
||||
request.Timeout = this.TimeoutLength; |
|
||||
} |
|
||||
|
|
||||
this.webRequest = request; |
|
||||
} |
|
||||
|
|
||||
return this.webRequest; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Returns a value indicating whether the current url is in a list of safe download locations.
|
|
||||
/// </summary>
|
|
||||
private void CheckSafeUrlLocation() |
|
||||
{ |
|
||||
bool validUrl = RemoteFileWhiteList.Any(item => item.Host.ToUpperInvariant().Equals(this.url.Host.ToUpperInvariant())); |
|
||||
|
|
||||
if (!validUrl) |
|
||||
{ |
|
||||
throw new SecurityException("application is not configured to allow remote file downloads from this domain."); |
|
||||
} |
|
||||
} |
|
||||
#endregion
|
|
||||
#endregion
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,52 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
|
|
||||
namespace ImageProcessor.Web.Helpers |
|
||||
{ |
|
||||
using System.Linq.Expressions; |
|
||||
using System.Reflection; |
|
||||
|
|
||||
public class ObjectFactory |
|
||||
{ |
|
||||
public delegate T ObjectActivator<out T>(params object[] args); |
|
||||
|
|
||||
public static ObjectActivator<T> GetActivator<T>(ConstructorInfo ctor) |
|
||||
{ |
|
||||
Type type = ctor.DeclaringType; |
|
||||
ParameterInfo[] paramsInfo = ctor.GetParameters(); |
|
||||
|
|
||||
// Create a single param of type object[]
|
|
||||
ParameterExpression param = Expression.Parameter(typeof(object[]), "args"); |
|
||||
|
|
||||
Expression[] argsExp = new Expression[paramsInfo.Length]; |
|
||||
|
|
||||
// Pick each arg from the params array
|
|
||||
// and create a typed expression for them
|
|
||||
for (int i = 0; i < paramsInfo.Length; i++) |
|
||||
{ |
|
||||
Expression index = Expression.Constant(i); |
|
||||
Type paramType = paramsInfo[i].ParameterType; |
|
||||
|
|
||||
Expression paramAccessorExp = Expression.ArrayIndex(param, index); |
|
||||
|
|
||||
Expression paramCastExp = Expression.Convert(paramAccessorExp, paramType); |
|
||||
|
|
||||
argsExp[i] = paramCastExp; |
|
||||
} |
|
||||
|
|
||||
// Make a NewExpression that calls the
|
|
||||
// ctor with the args we just created
|
|
||||
NewExpression newExp = Expression.New(ctor, argsExp); |
|
||||
|
|
||||
// Create a lambda with the New
|
|
||||
// Expression as body and our param object[] as arg
|
|
||||
LambdaExpression lambda = Expression.Lambda(typeof(ObjectActivator<T>), newExp, param); |
|
||||
|
|
||||
// Compile it
|
|
||||
ObjectActivator<T> compiled = (ObjectActivator<T>)lambda.Compile(); |
|
||||
return compiled; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,20 +0,0 @@ |
|||||
|
|
||||
|
|
||||
namespace ImageProcessor.Web.Helpers |
|
||||
{ |
|
||||
using System; |
|
||||
using System.Linq.Expressions; |
|
||||
using ImageProcessor.Processors; |
|
||||
|
|
||||
public static class ProcessorFactory |
|
||||
{ |
|
||||
public static T New<T>() where T:IGraphicsProcessor |
|
||||
{ |
|
||||
Type t = typeof(T); |
|
||||
Func<T> method = Expression.Lambda<Func<T>>(Expression.Block(t, new Expression[] { Expression.New(t) })).Compile(); |
|
||||
|
|
||||
return method(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,174 +0,0 @@ |
|||||
// License: CPOL at http://www.codeproject.com/info/cpol10.aspx
|
|
||||
|
|
||||
|
|
||||
namespace System.Threading.Tasks |
|
||||
{ |
|
||||
using System.Collections.Generic; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Extensions related to the <see cref="Task"/> classes.
|
|
||||
/// Supports implementing "async"-style methods in C#4 using iterators.
|
|
||||
/// </summary>
|
|
||||
/// <remarks>
|
|
||||
/// I would call this TaskExtensions, except that clients must name the class to use methods like <see cref="FromResult{T}(T)"/>.
|
|
||||
/// Based on work from Await Tasks in C#4 using Iterators by Keith L Robertson.
|
|
||||
/// <see cref="http://www.codeproject.com/Articles/504197/Await-Tasks-in-Csharp4-using-Iterators"/>
|
|
||||
/// </remarks>
|
|
||||
public static class TaskEx |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// Return a Completed <see cref="Task{TResult}"/> with a specific <see cref="Task{TResult}.Result"/> value.
|
|
||||
/// </summary>
|
|
||||
/// <typeparam name="TResult">
|
|
||||
/// The result
|
|
||||
/// </typeparam>
|
|
||||
/// <param name="resultValue">
|
|
||||
/// The result Value.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="Task"/>.
|
|
||||
/// </returns>
|
|
||||
public static Task<TResult> FromResult<TResult>(TResult resultValue) |
|
||||
{ |
|
||||
var completionSource = new TaskCompletionSource<TResult>(); |
|
||||
completionSource.SetResult(resultValue); |
|
||||
return completionSource.Task; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Transform an enumeration of <see cref="Task"/> into a single non-Result <see cref="Task"/>.
|
|
||||
/// </summary>
|
|
||||
/// <param name="tasks">
|
|
||||
/// The tasks.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="Task"/>.
|
|
||||
/// </returns>
|
|
||||
public static Task ToTask(this IEnumerable<Task> tasks) |
|
||||
{ |
|
||||
return ToTask<VoidResult>(tasks); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Transform an enumeration of <see cref="Task"/> into a single <see cref="Task{TResult}"/>.
|
|
||||
/// The final <see cref="Task"/> in <paramref name="tasks"/> must be a <see cref="Task{TResult}"/>.
|
|
||||
/// </summary>
|
|
||||
/// <typeparam name="TResult">
|
|
||||
/// The task results
|
|
||||
/// </typeparam>
|
|
||||
/// <param name="tasks">
|
|
||||
/// The tasks.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The <see cref="Task"/>.
|
|
||||
/// </returns>
|
|
||||
public static Task<TResult> ToTask<TResult>(this IEnumerable<Task> tasks) |
|
||||
{ |
|
||||
var taskScheduler = |
|
||||
SynchronizationContext.Current == null |
|
||||
? TaskScheduler.Default : TaskScheduler.FromCurrentSynchronizationContext(); |
|
||||
var taskEnumerator = tasks.GetEnumerator(); |
|
||||
var completionSource = new TaskCompletionSource<TResult>(); |
|
||||
|
|
||||
// Clean up the enumerator when the task completes.
|
|
||||
completionSource.Task.ContinueWith(t => taskEnumerator.Dispose(), taskScheduler); |
|
||||
|
|
||||
ToTaskDoOneStep(taskEnumerator, taskScheduler, completionSource, null); |
|
||||
return completionSource.Task; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// If the previous task Canceled or Faulted, complete the master task with the same <see cref="Task.Status"/>.
|
|
||||
/// Obtain the next <see cref="Task"/> from the <paramref name="taskEnumerator"/>.
|
|
||||
/// If none, complete the master task, possibly with the <see cref="Task{T}.Result"/> of the last task.
|
|
||||
/// Otherwise, set up the task with a continuation to come do this again when it completes.
|
|
||||
/// </summary>
|
|
||||
private static void ToTaskDoOneStep<TResult>( |
|
||||
IEnumerator<Task> taskEnumerator, TaskScheduler taskScheduler, |
|
||||
TaskCompletionSource<TResult> completionSource, Task completedTask) |
|
||||
{ |
|
||||
// Check status of previous nested task (if any), and stop if Canceled or Faulted.
|
|
||||
TaskStatus status; |
|
||||
if (completedTask == null) |
|
||||
{ |
|
||||
// This is the first task from the iterator; skip status check.
|
|
||||
} |
|
||||
else if ((status = completedTask.Status) == TaskStatus.Canceled) |
|
||||
{ |
|
||||
completionSource.SetCanceled(); |
|
||||
return; |
|
||||
} |
|
||||
else if (status == TaskStatus.Faulted) |
|
||||
{ |
|
||||
completionSource.SetException(completedTask.Exception); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
// Check for cancellation before looking for the next task.
|
|
||||
// This causes a problem where the ultimate Task does not complete and fire any continuations; I don't know why.
|
|
||||
// So cancellation from the Token must be handled within the iterator itself.
|
|
||||
//if (cancellationToken.IsCancellationRequested) {
|
|
||||
// completionSource.SetCanceled();
|
|
||||
// return;
|
|
||||
//}
|
|
||||
|
|
||||
// Find the next Task in the iterator; handle cancellation and other exceptions.
|
|
||||
Boolean haveMore; |
|
||||
try |
|
||||
{ |
|
||||
haveMore = taskEnumerator.MoveNext(); |
|
||||
|
|
||||
} |
|
||||
catch (OperationCanceledException cancExc) |
|
||||
{ |
|
||||
//if (cancExc.CancellationToken == cancellationToken) completionSource.SetCanceled();
|
|
||||
//else completionSource.SetException(cancExc);
|
|
||||
completionSource.SetCanceled(); |
|
||||
return; |
|
||||
} |
|
||||
catch (Exception exc) |
|
||||
{ |
|
||||
completionSource.SetException(exc); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
if (!haveMore) |
|
||||
{ |
|
||||
// No more tasks; set the result from the last completed task (if any, unless no result is requested).
|
|
||||
// We know it's not Canceled or Faulted because we checked at the start of this method.
|
|
||||
if (typeof(TResult) == typeof(VoidResult)) |
|
||||
{ // No result
|
|
||||
completionSource.SetResult(default(TResult)); |
|
||||
} |
|
||||
else if (!(completedTask is Task<TResult>)) |
|
||||
{ // Wrong result
|
|
||||
completionSource.SetException(new InvalidOperationException( |
|
||||
"Asynchronous iterator " + taskEnumerator + |
|
||||
" requires a final result task of type " + typeof(Task<TResult>).FullName + |
|
||||
(completedTask == null ? ", but none was provided." : |
|
||||
"; the actual task type was " + completedTask.GetType().FullName))); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
completionSource.SetResult(((Task<TResult>)completedTask).Result); |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
// When the nested task completes, continue by performing this function again.
|
|
||||
// Note: This is NOT a recursive call; the current method activation will complete
|
|
||||
// almost immediately and independently of the lambda continuation.
|
|
||||
taskEnumerator.Current.ContinueWith( |
|
||||
nextTask => ToTaskDoOneStep(taskEnumerator, taskScheduler, completionSource, nextTask), |
|
||||
taskScheduler); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Internal marker type for using <see cref="ToTask{T}"/> to implement <see cref="ToTask"/>.
|
|
||||
/// </summary>
|
|
||||
private abstract class VoidResult |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,52 @@ |
|||||
|
// -----------------------------------------------------------------------
|
||||
|
// <copyright file="TaskHelpers.cs" company="James South">
|
||||
|
// Copyright (c) James South.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
// -----------------------------------------------------------------------
|
||||
|
|
||||
|
namespace ImageProcessor.Web.Helpers |
||||
|
{ |
||||
|
#region Using
|
||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
#endregion
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Provides some syntactic sugar to run tasks.
|
||||
|
/// </summary>
|
||||
|
public sealed class TaskHelpers |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Queues the specified work to run on the ThreadPool and returns a Task handle for that work.
|
||||
|
/// </summary>
|
||||
|
/// <param name="action">The work to execute asynchronously</param>
|
||||
|
/// <returns>A Task that represents the work queued to execute in the ThreadPool.</returns>
|
||||
|
/// <exception cref="T:System.ArgumentNullException">
|
||||
|
/// The <paramref name="action"/> parameter was null.
|
||||
|
/// </exception>
|
||||
|
public static Task Run(Action action) |
||||
|
{ |
||||
|
Task task = new Task(action); |
||||
|
task.Start(); |
||||
|
return task; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Queues the specified work to run on the ThreadPool and returns a proxy for the
|
||||
|
/// Task(TResult) returned by <paramref name="function"/>.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TResult">The type of the result returned by the proxy Task.</typeparam>
|
||||
|
/// <param name="function">The work to execute asynchronously</param>
|
||||
|
/// <returns>A Task(TResult) that represents a proxy for the Task(TResult) returned by <paramref name="function"/>.</returns>
|
||||
|
/// <exception cref="T:System.ArgumentNullException">
|
||||
|
/// The <paramref name="function"/> parameter was null.
|
||||
|
/// </exception>
|
||||
|
public static Task<TResult> Run<TResult>(Func<TResult> function) |
||||
|
{ |
||||
|
Task<TResult> task = new Task<TResult>(function); |
||||
|
task.Start(); |
||||
|
return task; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,342 +0,0 @@ |
|||||
// -----------------------------------------------------------------------
|
|
||||
// <copyright file="ImageProcessingModule.cs" company="James South">
|
|
||||
// Copyright (c) James South.
|
|
||||
// Dual licensed under the MIT or GPL Version 2 licenses.
|
|
||||
// </copyright>
|
|
||||
// -----------------------------------------------------------------------
|
|
||||
|
|
||||
namespace ImageProcessor.Web.HttpModules |
|
||||
{ |
|
||||
#region Using
|
|
||||
using System; |
|
||||
using System.IO; |
|
||||
using System.Net; |
|
||||
using System.Reflection; |
|
||||
using System.Web; |
|
||||
using System.Web.Hosting; |
|
||||
using ImageProcessor.Helpers.Extensions; |
|
||||
using ImageProcessor.Imaging; |
|
||||
using ImageProcessor.Web.Caching; |
|
||||
using ImageProcessor.Web.Config; |
|
||||
using ImageProcessor.Web.Helpers; |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Processes any image requests within the web application.
|
|
||||
/// </summary>
|
|
||||
public class ImageProcessingModule : IHttpModule |
|
||||
{ |
|
||||
#region Fields
|
|
||||
/// <summary>
|
|
||||
/// The key for storing the response type of the current image.
|
|
||||
/// </summary>
|
|
||||
private const string CachedResponseTypeKey = "CACHED_IMAGE_RESPONSE_TYPE"; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The value to prefix any remote image requests with to ensure they get captured.
|
|
||||
/// </summary>
|
|
||||
private static readonly string RemotePrefix = ImageProcessorConfig.Instance.RemotePrefix; |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The object to lock against.
|
|
||||
/// </summary>
|
|
||||
private static readonly object SyncRoot = new object(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The assembly version.
|
|
||||
/// </summary>
|
|
||||
private static readonly string AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// A value indicating whether the application has started.
|
|
||||
/// </summary>
|
|
||||
private static bool hasModuleInitialized; |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The delegate void representing the ProcessImage method.
|
|
||||
/// </summary>
|
|
||||
/// <param name="context">
|
|
||||
/// the <see cref="T:System.Web.HttpContext">HttpContext</see> object that provides
|
|
||||
/// references to the intrinsic server objects
|
|
||||
/// </param>
|
|
||||
private delegate void ProcessImageDelegate(HttpContext context); |
|
||||
|
|
||||
#region IHttpModule Members
|
|
||||
/// <summary>
|
|
||||
/// Initializes a module and prepares it to handle requests.
|
|
||||
/// </summary>
|
|
||||
/// <param name="context">
|
|
||||
/// An <see cref="T:System.Web.HttpApplication"/> that provides
|
|
||||
/// access to the methods, properties, and events common to all
|
|
||||
/// application objects within an ASP.NET application
|
|
||||
/// </param>
|
|
||||
public void Init(HttpApplication context) |
|
||||
{ |
|
||||
if (!hasModuleInitialized) |
|
||||
{ |
|
||||
lock (SyncRoot) |
|
||||
{ |
|
||||
if (!hasModuleInitialized) |
|
||||
{ |
|
||||
DiskCache.CreateCacheDirectories(); |
|
||||
hasModuleInitialized = true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
context.AddOnBeginRequestAsync(this.OnBeginAsync, this.OnEndAsync); |
|
||||
context.PreSendRequestHeaders += this.ContextPreSendRequestHeaders; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule"/>.
|
|
||||
/// </summary>
|
|
||||
public void Dispose() |
|
||||
{ |
|
||||
// Nothing to dispose.
|
|
||||
} |
|
||||
#endregion
|
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The <see cref="T:System.Web.BeginEventHandler"/> that starts asynchronous processing
|
|
||||
/// of the <see cref="System.Web.HttpApplication.BeginRequest"/>.
|
|
||||
/// </summary>
|
|
||||
/// <param name="sender">The source of the event.</param>
|
|
||||
/// <param name="e">
|
|
||||
/// An <see cref="T:System.EventArgs">EventArgs</see> that contains
|
|
||||
/// the event data.
|
|
||||
/// </param>
|
|
||||
/// <param name="callBack">
|
|
||||
/// The delegate to call when the asynchronous method call is complete.
|
|
||||
/// If the callback is null, the delegate is not called.
|
|
||||
/// </param>
|
|
||||
/// <param name="state">
|
|
||||
/// Any additional data needed to process the request.
|
|
||||
/// </param>
|
|
||||
/// <returns>
|
|
||||
/// The status of the asynchronous operation.
|
|
||||
/// </returns>
|
|
||||
private IAsyncResult OnBeginAsync(object sender, EventArgs e, AsyncCallback callBack, object state) |
|
||||
{ |
|
||||
HttpContext context = ((HttpApplication)sender).Context; |
|
||||
|
|
||||
ProcessImageDelegate processImage = this.ProcessImage; |
|
||||
|
|
||||
return processImage.BeginInvoke(context, callBack, state); |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The method that handles asynchronous events such as application events.
|
|
||||
/// </summary>
|
|
||||
/// <param name="result">
|
|
||||
/// The <see cref="T:System.IAsyncResult"/> that is the result of the
|
|
||||
/// <see cref="T:System.Web.BeginEventHandler"/> operation.
|
|
||||
/// </param>
|
|
||||
private void OnEndAsync(IAsyncResult result) |
|
||||
{ |
|
||||
// Ensure our ProcessImage has completed in the background.
|
|
||||
while (!result.IsCompleted) |
|
||||
{ |
|
||||
System.Threading.Thread.Sleep(1); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// Occurs just before ASP.NET send HttpHeaders to the client.
|
|
||||
/// </summary>
|
|
||||
/// <param name="sender">The source of the event.</param>
|
|
||||
/// <param name="e">An <see cref="T:System.EventArgs">EventArgs</see> that contains the event data.</param>
|
|
||||
private void ContextPreSendRequestHeaders(object sender, EventArgs e) |
|
||||
{ |
|
||||
HttpContext context = ((HttpApplication)sender).Context; |
|
||||
|
|
||||
object responseTypeObject = context.Items[CachedResponseTypeKey]; |
|
||||
|
|
||||
if (responseTypeObject != null) |
|
||||
{ |
|
||||
string responseType = (string)responseTypeObject; |
|
||||
|
|
||||
// Set the headers
|
|
||||
this.SetHeaders(context, responseType); |
|
||||
|
|
||||
context.Items[CachedResponseTypeKey] = null; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
#region Private
|
|
||||
/// <summary>
|
|
||||
/// Processes the image.
|
|
||||
/// </summary>
|
|
||||
/// <param name="context">
|
|
||||
/// the <see cref="T:System.Web.HttpContext">HttpContext</see> object that provides
|
|
||||
/// references to the intrinsic server objects
|
|
||||
/// </param>
|
|
||||
private void ProcessImage(HttpContext context) |
|
||||
{ |
|
||||
// Is this a remote file.
|
|
||||
bool isRemote = context.Request.Path.Equals(RemotePrefix, StringComparison.OrdinalIgnoreCase); |
|
||||
string path = string.Empty; |
|
||||
string queryString = string.Empty; |
|
||||
|
|
||||
if (isRemote) |
|
||||
{ |
|
||||
// We need to split the querystring to get the actual values we want.
|
|
||||
string urlDecode = HttpUtility.UrlDecode(context.Request.QueryString.ToString()); |
|
||||
|
|
||||
if (urlDecode != null) |
|
||||
{ |
|
||||
string[] paths = urlDecode.Split('?'); |
|
||||
|
|
||||
path = paths[0]; |
|
||||
|
|
||||
if (paths.Length > 1) |
|
||||
{ |
|
||||
queryString = paths[1]; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
path = HostingEnvironment.MapPath(context.Request.Path); |
|
||||
queryString = HttpUtility.UrlDecode(context.Request.QueryString.ToString()); |
|
||||
} |
|
||||
|
|
||||
// Only process requests that pass our sanitizing filter.
|
|
||||
if (ImageUtils.IsValidImageExtension(path) && !string.IsNullOrWhiteSpace(queryString)) |
|
||||
{ |
|
||||
if (this.FileExists(path, isRemote)) |
|
||||
{ |
|
||||
string fullPath = string.Format("{0}?{1}", path, queryString); |
|
||||
string imageName = Path.GetFileName(path); |
|
||||
string cachedPath = DiskCache.GetCachePath(fullPath, imageName); |
|
||||
bool isUpdated = DiskCache.IsUpdatedFile(path, cachedPath, isRemote); |
|
||||
|
|
||||
// Only process if the file has been updated.
|
|
||||
if (isUpdated) |
|
||||
{ |
|
||||
// Process the image.
|
|
||||
using (ImageFactory imageFactory = new ImageFactory()) |
|
||||
{ |
|
||||
if (isRemote) |
|
||||
{ |
|
||||
Uri uri = new Uri(path); |
|
||||
RemoteFile remoteFile = new RemoteFile(uri, false); |
|
||||
|
|
||||
using (MemoryStream memoryStream = new MemoryStream()) |
|
||||
{ |
|
||||
using (Stream responseStream = remoteFile.GetWebResponse().GetResponseStream()) |
|
||||
{ |
|
||||
if (responseStream != null) |
|
||||
{ |
|
||||
//lock (SyncRoot)
|
|
||||
//{
|
|
||||
// Trim the cache.
|
|
||||
DiskCache.TrimCachedFolders(); |
|
||||
|
|
||||
responseStream.CopyTo(memoryStream); |
|
||||
|
|
||||
imageFactory.Load(memoryStream) |
|
||||
.AddQueryString(queryString) |
|
||||
.Format(ImageUtils.GetImageFormat(imageName)) |
|
||||
.AutoProcess().Save(cachedPath); |
|
||||
|
|
||||
// Ensure that the LastWriteTime property of the source and cached file match.
|
|
||||
DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, true); |
|
||||
|
|
||||
// Add to the cache.
|
|
||||
DiskCache.AddImageToCache(cachedPath, dateTime); |
|
||||
//}
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
//lock (SyncRoot)
|
|
||||
//{
|
|
||||
// Trim the cache.
|
|
||||
DiskCache.TrimCachedFolders(); |
|
||||
|
|
||||
imageFactory.Load(fullPath).AutoProcess().Save(cachedPath); |
|
||||
|
|
||||
// Ensure that the LastWriteTime property of the source and cached file match.
|
|
||||
DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, false); |
|
||||
|
|
||||
// Add to the cache.
|
|
||||
DiskCache.AddImageToCache(cachedPath, dateTime); |
|
||||
//}
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
context.Items[CachedResponseTypeKey] = ImageUtils.GetResponseType(imageName).ToDescription(); |
|
||||
|
|
||||
// The cached file is valid so just rewrite the path.
|
|
||||
context.RewritePath(DiskCache.GetVirtualPath(cachedPath, context.Request), false); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// returns a value indicating whether a file exists.
|
|
||||
/// </summary>
|
|
||||
/// <param name="path">The path to the file to check.</param>
|
|
||||
/// <param name="isRemote">Whether the file is remote.</param>
|
|
||||
/// <returns>True if the file exists, otherwise false.</returns>
|
|
||||
/// <remarks>If the file is remote the method will always return true.</remarks>
|
|
||||
private bool FileExists(string path, bool isRemote) |
|
||||
{ |
|
||||
if (isRemote) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
FileInfo fileInfo = new FileInfo(path); |
|
||||
return fileInfo.Exists; |
|
||||
} |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// This will make the browser and server keep the output
|
|
||||
/// in its cache and thereby improve performance.
|
|
||||
/// See http://en.wikipedia.org/wiki/HTTP_ETag
|
|
||||
/// </summary>
|
|
||||
/// <param name="context">
|
|
||||
/// the <see cref="T:System.Web.HttpContext">HttpContext</see> object that provides
|
|
||||
/// references to the intrinsic server objects
|
|
||||
/// </param>
|
|
||||
/// <param name="responseType">The HTTP MIME type to to send.</param>
|
|
||||
private void SetHeaders(HttpContext context, string responseType) |
|
||||
{ |
|
||||
HttpResponse response = context.Response; |
|
||||
|
|
||||
response.ContentType = responseType; |
|
||||
|
|
||||
response.AddHeader("Image-Served-By", "ImageProcessor/" + AssemblyVersion); |
|
||||
|
|
||||
HttpCachePolicy cache = response.Cache; |
|
||||
|
|
||||
cache.VaryByHeaders["Accept-Encoding"] = true; |
|
||||
|
|
||||
int maxDays = DiskCache.MaxFileCachedDuration; |
|
||||
|
|
||||
cache.SetExpires(DateTime.Now.ToUniversalTime().AddDays(maxDays)); |
|
||||
cache.SetMaxAge(new TimeSpan(maxDays, 0, 0, 0)); |
|
||||
cache.SetRevalidation(HttpCacheRevalidation.AllCaches); |
|
||||
|
|
||||
string incomingEtag = context.Request.Headers["If-None-Match"]; |
|
||||
|
|
||||
cache.SetCacheability(HttpCacheability.Public); |
|
||||
|
|
||||
if (incomingEtag == null) |
|
||||
{ |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
response.Clear(); |
|
||||
response.StatusCode = (int)HttpStatusCode.NotModified; |
|
||||
response.SuppressContent = true; |
|
||||
} |
|
||||
#endregion
|
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -1,4 +1,7 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
<packages> |
||||
|
<package id="Microsoft.Bcl" version="1.0.16-rc" targetFramework="net40" /> |
||||
|
<package id="Microsoft.Bcl.Async" version="1.0.14-rc" targetFramework="net40" /> |
||||
|
<package id="Microsoft.Bcl.Build" version="1.0.0-rc" targetFramework="net40" /> |
||||
<package id="System.Data.SQLite.x86" version="1.0.84.0" targetFramework="net40" /> |
<package id="System.Data.SQLite.x86" version="1.0.84.0" targetFramework="net40" /> |
||||
</packages> |
</packages> |
||||
@ -1 +1 @@ |
|||||
8f290942360078af430fc9ce5d6e746500d21d74 |
df51932368e72ec3c9b9897d29e27dcf20af7395 |
||||
@ -0,0 +1 @@ |
|||||
|
30ff7aa1ad2a7eedde4972dee464f229d4459439 |
||||
@ -0,0 +1 @@ |
|||||
|
168ac0ce88f1c4eeb97a4ad4665e4f0f3bfc4fd6 |
||||
@ -0,0 +1,44 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> |
||||
|
<metadata> |
||||
|
<id>Microsoft.Bcl</id> |
||||
|
<version>1.0.16-rc</version> |
||||
|
<title>BCL Portability Pack for .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5</title> |
||||
|
<authors>Microsoft</authors> |
||||
|
<owners>Microsoft</owners> |
||||
|
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261998&clcid=0x409</licenseUrl> |
||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance> |
||||
|
<description>This packages enables projects targeting .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5 (including any portable library combinations) to use new types from later versions of .NET including: |
||||
|
|
||||
|
CallerMemberNameAttribute |
||||
|
CallerLineNumberAttribute |
||||
|
CallerFilePathAttribute |
||||
|
Tuple<T1, T2, ...> |
||||
|
IProgress<T> |
||||
|
IStructuralComparable |
||||
|
IStructuralEquatable |
||||
|
Task |
||||
|
|
||||
|
These types are "unified" to their later version equivalent. For example, when running on .NET Framework 4.5, IProgress<T> from this package will be seen by the runtime as the same type as the one already in the platform. |
||||
|
|
||||
|
This package is not required for projects targeting .NET Framework 4.5 or .NET for Windows Store apps. For known issues, please see: http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx.</description> |
||||
|
<summary>Adds support for types from later versions to .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5.</summary> |
||||
|
<copyright>Copyright © Microsoft Corporation</copyright> |
||||
|
<tags>BCL Microsoft System Task IProgress</tags> |
||||
|
<dependencies> |
||||
|
<group> |
||||
|
<dependency id="Microsoft.Bcl.Build" version="1.0.0-rc" /> |
||||
|
</group> |
||||
|
<group targetFramework="Silverlight4.0" /> |
||||
|
<group targetFramework=".NETFramework4.5" /> |
||||
|
<group targetFramework="Windows8.0" /> |
||||
|
<group targetFramework="WindowsPhone8.0" /> |
||||
|
<group targetFramework=".NETPortable0.0-net45+win80+wp80" /> |
||||
|
</dependencies> |
||||
|
<references> |
||||
|
<reference file="System.Runtime.dll" /> |
||||
|
<reference file="System.Threading.Tasks.dll" /> |
||||
|
<reference file="_._" /> |
||||
|
</references> |
||||
|
</metadata> |
||||
|
</package> |
||||
@ -0,0 +1,24 @@ |
|||||
|
Changes in 1.0.16-rc |
||||
|
- Fixed: Adding empty content to .NET 4.5, Windows Phone 8, Windows 8 and portable combinations, so that app.config transforms |
||||
|
are not applied to projects targeting them. |
||||
|
|
||||
|
Changes in 1.0.15-rc |
||||
|
|
||||
|
- Fixed: System.Runtime is missing a type forward for Tuple<T1, T2> |
||||
|
|
||||
|
Changes in 1.0.14-rc |
||||
|
|
||||
|
- Fixed: System.Runtime now has a fixed version for Phone 7.x due to the lack of a way to redirect them to a later version. |
||||
|
|
||||
|
Changes in 1.0.13-rc |
||||
|
|
||||
|
- Fixed: First-chance exceptions when running on Phone 7.x |
||||
|
|
||||
|
Changes in 1.0.12-rc |
||||
|
|
||||
|
- Fixed: Microsoft.Bcl.targets are not imported when using NuGet 2.0 to install Microsoft.Bcl |
||||
|
- Changed: Pulled build targets into a separate package (Microsoft.Bcl.Build) so other BCL packages can depend on it. |
||||
|
|
||||
|
Changes in 1.0.11-beta |
||||
|
|
||||
|
- Initial release |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-2.5.16.0" newVersion="2.5.16.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns:bcl="urn:schemas-microsoft-com:bcl" xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly bcl:name="System.Runtime"> |
||||
|
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
<dependentAssembly bcl:name="System.Threading.Tasks"> |
||||
|
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
Binary file not shown.
@ -0,0 +1,56 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<doc> |
||||
|
<assembly> |
||||
|
<name>System.Runtime</name> |
||||
|
</assembly> |
||||
|
<members> |
||||
|
<member name="T:System.IProgress`1"> |
||||
|
<summary>Defines a provider for progress updates.</summary> |
||||
|
<typeparam name="T">The type of progress update value.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.IProgress`1.Report(`0)"> |
||||
|
<summary>Reports a progress update.</summary> |
||||
|
<param name="value">The value of the updated progress.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncStateMachineAttribute"> |
||||
|
<summary>Identities the async state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.StateMachineAttribute"> |
||||
|
<summary>Identities the state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.StateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.StateMachineAttribute.StateMachineType"> |
||||
|
<summary>Gets the type that implements the state machine.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerMemberNameAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the method or property name of the caller to the method. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerLineNumberAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the line number in the source file at which the method is called. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerFilePathAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the full path of the source file that contains the caller. |
||||
|
This is the file path at the time of compile. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.IteratorStateMachineAttribute"> |
||||
|
<summary>Identities the iterator state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.IteratorStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
</members> |
||||
|
</doc> |
||||
Binary file not shown.
@ -0,0 +1,475 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<doc> |
||||
|
<assembly> |
||||
|
<name>System.Threading.Tasks</name> |
||||
|
</assembly> |
||||
|
<members> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncMethodBuilderCore"> |
||||
|
<summary>Holds state related to the builder's IAsyncStateMachine.</summary> |
||||
|
<remarks>This is a mutable struct. Be very delicate with it.</remarks> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodBuilderCore.m_stateMachine"> |
||||
|
<summary>A reference to the heap-allocated state machine object associated with this builder.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start``1(``0@)"> |
||||
|
<summary>Initiates the builder's execution with the associated state machine.</summary> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="stateMachine">The state machine instance, passed by reference.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)"> |
||||
|
<summary>Associates the builder with the state machine it represents.</summary> |
||||
|
<param name="stateMachine">The heap-allocated state machine object.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument was null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is incorrectly initialized.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.GetCompletionAction``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Gets the Action to use with an awaiter's OnCompleted or UnsafeOnCompleted method. |
||||
|
On first invocation, the supplied state machine will be boxed. |
||||
|
</summary> |
||||
|
<typeparam name="TMethodBuilder">Specifies the type of the method builder used.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine used.</typeparam> |
||||
|
<param name="builder">The builder.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
<returns>An Action to provide to the awaiter.</returns> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner"> |
||||
|
<summary>Provides the ability to invoke a state machine's MoveNext method under a supplied ExecutionContext.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.m_context"> |
||||
|
<summary>The context with which to run MoveNext.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.m_stateMachine"> |
||||
|
<summary>The state machine whose MoveNext method should be invoked.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.#ctor(System.ExecutionContextLightup)"> |
||||
|
<summary>Initializes the runner.</summary> |
||||
|
<param name="context">The context with which to run MoveNext.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run"> |
||||
|
<summary>Invokes MoveNext under the provided context.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.s_invokeMoveNext"> |
||||
|
<summary>Cached delegate used with ExecutionContext.Run.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(System.Object)"> |
||||
|
<summary>Invokes the MoveNext method on the supplied IAsyncStateMachine.</summary> |
||||
|
<param name="stateMachine">The IAsyncStateMachine machine instance.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncMethodTaskCache`1"> |
||||
|
<summary>Provides a base class used to cache tasks of a specific return type.</summary> |
||||
|
<typeparam name="TResult">Specifies the type of results the cached tasks return.</typeparam> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.Singleton"> |
||||
|
<summary> |
||||
|
A singleton cache for this result type. |
||||
|
This may be null if there are no cached tasks for this TResult. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.CreateCompleted(`0)"> |
||||
|
<summary>Creates a non-disposable task.</summary> |
||||
|
<param name="result">The result for the task.</param> |
||||
|
<returns>The cacheable task.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.CreateCache"> |
||||
|
<summary>Creates a cache.</summary> |
||||
|
<returns>A task cache for this result type.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.FromResult(`0)"> |
||||
|
<summary>Gets a cached task if one exists.</summary> |
||||
|
<param name="result">The result for which we want a cached task.</param> |
||||
|
<returns>A cached task if one exists; otherwise, null.</returns> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodBooleanTaskCache"> |
||||
|
<summary>Provides a cache for Boolean tasks.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodBooleanTaskCache.m_true"> |
||||
|
<summary>A true task.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodBooleanTaskCache.m_false"> |
||||
|
<summary>A false task.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodBooleanTaskCache.FromResult(System.Boolean)"> |
||||
|
<summary>Gets a cached task for the Boolean result.</summary> |
||||
|
<param name="result">true or false</param> |
||||
|
<returns>A cached task for the Boolean result.</returns> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache"> |
||||
|
<summary>Provides a cache for zero Int32 tasks.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache.INCLUSIVE_INT32_MIN"> |
||||
|
<summary>The minimum value, inclusive, for which we want a cached task.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache.EXCLUSIVE_INT32_MAX"> |
||||
|
<summary>The maximum value, exclusive, for which we want a cached task.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache.Int32Tasks"> |
||||
|
<summary>The cache of Task{Int32}.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache.CreateInt32Tasks"> |
||||
|
<summary>Creates an array of cached tasks for the values in the range [INCLUSIVE_MIN,EXCLUSIVE_MAX).</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncMethodTaskCache`1.AsyncMethodInt32TaskCache.FromResult(System.Int32)"> |
||||
|
<summary>Gets a cached task for the zero Int32 result.</summary> |
||||
|
<param name="result">The integer value</param> |
||||
|
<returns>A cached task for the Int32 result or null if not cached.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncServices.ThrowAsync(System.Exception,System.Threading.SynchronizationContext)"> |
||||
|
<summary>Throws the exception on the ThreadPool.</summary> |
||||
|
<param name="exception">The exception to propagate.</param> |
||||
|
<param name="targetContext">The target context on which to propagate the exception. Null to use the ThreadPool.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncServices.PrepareExceptionForRethrow(System.Exception)"> |
||||
|
<summary>Copies the exception's stack trace so its stack trace isn't overwritten.</summary> |
||||
|
<param name="exc">The exception to prepare.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder"> |
||||
|
<summary> |
||||
|
Provides a builder for asynchronous methods that return <see cref="T:System.Threading.Tasks.Task"/>. |
||||
|
This type is intended for compiler use only. |
||||
|
</summary> |
||||
|
<remarks> |
||||
|
AsyncTaskMethodBuilder is a value type, and thus it is copied by value. |
||||
|
Prior to being copied, one of its Task, SetResult, or SetException members must be accessed, |
||||
|
or else the copies may end up building distinct Task instances. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.IAsyncMethodBuilder"> |
||||
|
<summary>Represents an asynchronous method builder.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.s_cachedCompleted"> |
||||
|
<summary>A cached VoidTaskResult task used for builders that complete synchronously.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.m_builder"> |
||||
|
<summary>The generic builder object to which this non-generic instance delegates.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Create"> |
||||
|
<summary>Initializes a new <see cref="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder"/>.</summary> |
||||
|
<returns>The initialized <see cref="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder"/>.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start``1(``0@)"> |
||||
|
<summary>Initiates the builder's execution with the associated state machine.</summary> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="stateMachine">The state machine instance, passed by reference.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)"> |
||||
|
<summary>Associates the builder with the state machine it represents.</summary> |
||||
|
<param name="stateMachine">The heap-allocated state machine object.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument was null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is incorrectly initialized.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.System#Runtime#CompilerServices#IAsyncMethodBuilder#PreBoxInitialization"> |
||||
|
<summary>Perform any initialization necessary prior to lifting the builder to the heap.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult"> |
||||
|
<summary> |
||||
|
Completes the <see cref="T:System.Threading.Tasks.Task"/> in the |
||||
|
<see cref="T:System.Threading.Tasks.TaskStatus">RanToCompletion</see> state. |
||||
|
</summary> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is not initialized.</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The task has already completed.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)"> |
||||
|
<summary> |
||||
|
Completes the <see cref="T:System.Threading.Tasks.Task"/> in the |
||||
|
<see cref="T:System.Threading.Tasks.TaskStatus">Faulted</see> state with the specified exception. |
||||
|
</summary> |
||||
|
<param name="exception">The <see cref="T:System.Exception"/> to use to fault the task.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="exception"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is not initialized.</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The task has already completed.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetNotificationForWaitCompletion(System.Boolean)"> |
||||
|
<summary> |
||||
|
Called by the debugger to request notification when the first wait operation |
||||
|
(await, Wait, Result, etc.) on this builder's task completes. |
||||
|
</summary> |
||||
|
<param name="enabled"> |
||||
|
true to enable notification; false to disable a previously set notification. |
||||
|
</param> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Task"> |
||||
|
<summary>Gets the <see cref="T:System.Threading.Tasks.Task"/> for this builder.</summary> |
||||
|
<returns>The <see cref="T:System.Threading.Tasks.Task"/> representing the builder's asynchronous operation.</returns> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is not initialized.</exception> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncTaskMethodBuilder.ObjectIdForDebugger"> |
||||
|
<summary> |
||||
|
Gets an object that may be used to uniquely identify this builder to the debugger. |
||||
|
</summary> |
||||
|
<remarks> |
||||
|
This property lazily instantiates the ID in a non-thread-safe manner. |
||||
|
It must only be used by the debugger, and only in a single-threaded manner |
||||
|
when no other threads are in the middle of accessing this property or this.Task. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1"> |
||||
|
<summary> |
||||
|
Provides a builder for asynchronous methods that return <see cref="T:System.Threading.Tasks.Task`1"/>. |
||||
|
This type is intended for compiler use only. |
||||
|
</summary> |
||||
|
<remarks> |
||||
|
AsyncTaskMethodBuilder{TResult} is a value type, and thus it is copied by value. |
||||
|
Prior to being copied, one of its Task, SetResult, or SetException members must be accessed, |
||||
|
or else the copies may end up building distinct Task instances. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.s_defaultResultTask"> |
||||
|
<summary>A cached task for default(TResult).</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.m_coreState"> |
||||
|
<summary>State related to the IAsyncStateMachine.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.m_task"> |
||||
|
<summary>The lazily-initialized task.</summary> |
||||
|
<remarks>Must be named m_task for debugger step-over to work correctly.</remarks> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.m_taskCompletionSource"> |
||||
|
<summary>The lazily-initialized task completion source.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.#cctor"> |
||||
|
<summary>Temporary support for disabling crashing if tasks go unobserved.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Create"> |
||||
|
<summary>Initializes a new <see cref="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder"/>.</summary> |
||||
|
<returns>The initialized <see cref="T:System.Runtime.CompilerServices.AsyncTaskMethodBuilder"/>.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start``1(``0@)"> |
||||
|
<summary>Initiates the builder's execution with the associated state machine.</summary> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="stateMachine">The state machine instance, passed by reference.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)"> |
||||
|
<summary>Associates the builder with the state machine it represents.</summary> |
||||
|
<param name="stateMachine">The heap-allocated state machine object.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument was null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is incorrectly initialized.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.System#Runtime#CompilerServices#IAsyncMethodBuilder#PreBoxInitialization"> |
||||
|
<summary>Perform any initialization necessary prior to lifting the builder to the heap.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AwaitOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AwaitUnsafeOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(`0)"> |
||||
|
<summary> |
||||
|
Completes the <see cref="T:System.Threading.Tasks.Task`1"/> in the |
||||
|
<see cref="T:System.Threading.Tasks.TaskStatus">RanToCompletion</see> state with the specified result. |
||||
|
</summary> |
||||
|
<param name="result">The result to use to complete the task.</param> |
||||
|
<exception cref="T:System.InvalidOperationException">The task has already completed.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(System.Threading.Tasks.TaskCompletionSource{`0})"> |
||||
|
<summary> |
||||
|
Completes the builder by using either the supplied completed task, or by completing |
||||
|
the builder's previously accessed task using default(TResult). |
||||
|
</summary> |
||||
|
<param name="completedTask">A task already completed with the value default(TResult).</param> |
||||
|
<exception cref="T:System.InvalidOperationException">The task has already completed.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(System.Exception)"> |
||||
|
<summary> |
||||
|
Completes the <see cref="T:System.Threading.Tasks.Task`1"/> in the |
||||
|
<see cref="T:System.Threading.Tasks.TaskStatus">Faulted</see> state with the specified exception. |
||||
|
</summary> |
||||
|
<param name="exception">The <see cref="T:System.Exception"/> to use to fault the task.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="exception"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The task has already completed.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetNotificationForWaitCompletion(System.Boolean)"> |
||||
|
<summary> |
||||
|
Called by the debugger to request notification when the first wait operation |
||||
|
(await, Wait, Result, etc.) on this builder's task completes. |
||||
|
</summary> |
||||
|
<param name="enabled"> |
||||
|
true to enable notification; false to disable a previously set notification. |
||||
|
</param> |
||||
|
<remarks> |
||||
|
This should only be invoked from within an asynchronous method, |
||||
|
and only by the debugger. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.GetTaskForResult(`0)"> |
||||
|
<summary> |
||||
|
Gets a task for the specified result. This will either |
||||
|
be a cached or new task, never null. |
||||
|
</summary> |
||||
|
<param name="result">The result for which we need a task.</param> |
||||
|
<returns>The completed task containing the result.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.CompletionSource"> |
||||
|
<summary>Gets the lazily-initialized TaskCompletionSource.</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Task"> |
||||
|
<summary>Gets the <see cref="T:System.Threading.Tasks.Task`1"/> for this builder.</summary> |
||||
|
<returns>The <see cref="T:System.Threading.Tasks.Task`1"/> representing the builder's asynchronous operation.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.ObjectIdForDebugger"> |
||||
|
<summary> |
||||
|
Gets an object that may be used to uniquely identify this builder to the debugger. |
||||
|
</summary> |
||||
|
<remarks> |
||||
|
This property lazily instantiates the ID in a non-thread-safe manner. |
||||
|
It must only be used by the debugger, and only in a single-threaded manner |
||||
|
when no other threads are in the middle of accessing this property or this.Task. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncVoidMethodBuilder"> |
||||
|
<summary> |
||||
|
Provides a builder for asynchronous methods that return void. |
||||
|
This type is intended for compiler use only. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.m_synchronizationContext"> |
||||
|
<summary>The synchronization context associated with this operation.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.m_coreState"> |
||||
|
<summary>State related to the IAsyncStateMachine.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.m_objectIdForDebugger"> |
||||
|
<summary>An object used by the debugger to uniquely identify this builder. Lazily initialized.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.#cctor"> |
||||
|
<summary>Temporary support for disabling crashing if tasks go unobserved.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.PreventUnobservedTaskExceptions"> |
||||
|
<summary>Registers with UnobservedTaskException to suppress exception crashing.</summary> |
||||
|
</member> |
||||
|
<member name="F:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.s_preventUnobservedTaskExceptionsInvoked"> |
||||
|
<summary>Non-zero if PreventUnobservedTaskExceptions has already been invoked.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Create"> |
||||
|
<summary>Initializes a new <see cref="T:System.Runtime.CompilerServices.AsyncVoidMethodBuilder"/>.</summary> |
||||
|
<returns>The initialized <see cref="T:System.Runtime.CompilerServices.AsyncVoidMethodBuilder"/>.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.#ctor(System.Threading.SynchronizationContext)"> |
||||
|
<summary>Initializes the <see cref="T:System.Runtime.CompilerServices.AsyncVoidMethodBuilder"/>.</summary> |
||||
|
<param name="synchronizationContext">The synchronizationContext associated with this operation. This may be null.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start``1(``0@)"> |
||||
|
<summary>Initiates the builder's execution with the associated state machine.</summary> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="stateMachine">The state machine instance, passed by reference.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument was null (Nothing in Visual Basic).</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)"> |
||||
|
<summary>Associates the builder with the state machine it represents.</summary> |
||||
|
<param name="stateMachine">The heap-allocated state machine object.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="stateMachine"/> argument was null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is incorrectly initialized.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.System#Runtime#CompilerServices#IAsyncMethodBuilder#PreBoxInitialization"> |
||||
|
<summary>Perform any initialization necessary prior to lifting the builder to the heap.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.AwaitUnsafeOnCompleted``2(``0@,``1@)"> |
||||
|
<summary> |
||||
|
Schedules the specified state machine to be pushed forward when the specified awaiter completes. |
||||
|
</summary> |
||||
|
<typeparam name="TAwaiter">Specifies the type of the awaiter.</typeparam> |
||||
|
<typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam> |
||||
|
<param name="awaiter">The awaiter.</param> |
||||
|
<param name="stateMachine">The state machine.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetResult"> |
||||
|
<summary>Completes the method builder successfully.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetException(System.Exception)"> |
||||
|
<summary>Faults the method builder with an exception.</summary> |
||||
|
<param name="exception">The exception that is the cause of this fault.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="exception"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
<exception cref="T:System.InvalidOperationException">The builder is not initialized.</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.NotifySynchronizationContextOfCompletion"> |
||||
|
<summary>Notifies the current synchronization context that the operation completed.</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.AsyncVoidMethodBuilder.ObjectIdForDebugger"> |
||||
|
<summary> |
||||
|
Gets an object that may be used to uniquely identify this builder to the debugger. |
||||
|
</summary> |
||||
|
<remarks> |
||||
|
This property lazily instantiates the ID in a non-thread-safe manner. |
||||
|
It must only be used by the debugger and only in a single-threaded manner. |
||||
|
</remarks> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.IAsyncStateMachine"> |
||||
|
<summary> |
||||
|
Represents state machines generated for asynchronous methods. |
||||
|
This type is intended for compiler use only. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext"> |
||||
|
<summary>Moves the state machine to its next state.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.IAsyncStateMachine.SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)"> |
||||
|
<summary>Configures the state machine with a heap-allocated replica.</summary> |
||||
|
<param name="stateMachine">The heap-allocated replica.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.ICriticalNotifyCompletion"> |
||||
|
<summary> |
||||
|
Represents an awaiter used to schedule continuations when an await operation completes. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.INotifyCompletion"> |
||||
|
<summary> |
||||
|
Represents an operation that will schedule continuations when the operation completes. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.INotifyCompletion.OnCompleted(System.Action)"> |
||||
|
<summary>Schedules the continuation action to be invoked when the instance completes.</summary> |
||||
|
<param name="continuation">The action to invoke when the operation completes.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.ICriticalNotifyCompletion.UnsafeOnCompleted(System.Action)"> |
||||
|
<summary>Schedules the continuation action to be invoked when the instance completes.</summary> |
||||
|
<param name="continuation">The action to invoke when the operation completes.</param> |
||||
|
<exception cref="T:System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception> |
||||
|
<remarks>Unlike OnCompleted, UnsafeOnCompleted need not propagate ExecutionContext information.</remarks> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.VoidTaskResult"> |
||||
|
<summary>Used with Task(of void)</summary> |
||||
|
</member> |
||||
|
</members> |
||||
|
</doc> |
||||
Binary file not shown.
@ -0,0 +1,860 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<doc> |
||||
|
<assembly> |
||||
|
<name>System.Runtime</name> |
||||
|
</assembly> |
||||
|
<members> |
||||
|
<member name="T:System.Strings"> |
||||
|
<summary> |
||||
|
A strongly-typed resource class, for looking up localized strings, etc. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Strings.ResourceManager"> |
||||
|
<summary> |
||||
|
Returns the cached ResourceManager instance used by this class. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Strings.Culture"> |
||||
|
<summary> |
||||
|
Overrides the current thread's CurrentUICulture property for all |
||||
|
resource lookups using this strongly typed resource class. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Strings.ArgumentException_TupleIncorrectType"> |
||||
|
<summary> |
||||
|
Looks up a localized string similar to Argument must be of type {0}.. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:System.Strings.ArgumentException_TupleLastArgumentNotATuple"> |
||||
|
<summary> |
||||
|
Looks up a localized string similar to The last element of an eight element tuple must be a Tuple.. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Collections.IStructuralEquatable"> |
||||
|
<summary> |
||||
|
Defines methods to support the comparison of objects for structural equality. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer)"> |
||||
|
<summary> |
||||
|
Determines whether an object is structurally equal to the current instance. |
||||
|
</summary> |
||||
|
<param name="other">The object to compare with the current instance.</param> |
||||
|
<param name="comparer">An object that determines whether the current instance and other are equal. </param> |
||||
|
<returns>true if the two objects are equal; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer)"> |
||||
|
<summary> |
||||
|
Returns a hash code for the current instance. |
||||
|
</summary> |
||||
|
<param name="comparer">An object that computes the hash code of the current object.</param> |
||||
|
<returns>The hash code for the current instance.</returns> |
||||
|
</member> |
||||
|
<member name="T:System.Collections.IStructuralComparable"> |
||||
|
<summary> |
||||
|
Supports the structural comparison of collection objects. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer)"> |
||||
|
<summary> |
||||
|
Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order. |
||||
|
</summary> |
||||
|
<param name="other">The object to compare with the current instance.</param> |
||||
|
<param name="comparer">An object that compares members of the current collection object with the corresponding members of other.</param> |
||||
|
<returns>An integer that indicates the relationship of the current collection object to other.</returns> |
||||
|
<exception cref="T:System.ArgumentException"> |
||||
|
This instance and other are not the same type. |
||||
|
</exception> |
||||
|
</member> |
||||
|
<member name="T:System.Func`6"> |
||||
|
<summary> |
||||
|
Encapsulates a method that has five parameters and returns a value of the type specified by the TResult parameter. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam> |
||||
|
<typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam> |
||||
|
<typeparam name="T3">The type of the third parameter of the method that this delegate encapsulates.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth parameter of the method that this delegate encapsulates.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth parameter of the method that this delegate encapsulates.</typeparam> |
||||
|
<typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam> |
||||
|
<param name="arg1">The first parameter of the method that this delegate encapsulates.</param> |
||||
|
<param name="arg2">The second parameter of the method that this delegate encapsulates.</param> |
||||
|
<param name="arg3">The third parameter of the method that this delegate encapsulates.</param> |
||||
|
<param name="arg4">The fourth parameter of the method that this delegate encapsulates.</param> |
||||
|
<param name="arg5">The fifth parameter of the method that this delegate encapsulates.</param> |
||||
|
<returns>The return value of the method that this delegate encapsulates.</returns> |
||||
|
</member> |
||||
|
<member name="T:System.IProgress`1"> |
||||
|
<summary>Defines a provider for progress updates.</summary> |
||||
|
<typeparam name="T">The type of progress update value.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.IProgress`1.Report(`0)"> |
||||
|
<summary>Reports a progress update.</summary> |
||||
|
<param name="value">The value of the updated progress.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncStateMachineAttribute"> |
||||
|
<summary>Identities the async state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.StateMachineAttribute"> |
||||
|
<summary>Identities the state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.StateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.StateMachineAttribute.StateMachineType"> |
||||
|
<summary>Gets the type that implements the state machine.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerMemberNameAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the method or property name of the caller to the method. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerLineNumberAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the line number in the source file at which the method is called. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerFilePathAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the full path of the source file that contains the caller. |
||||
|
This is the file path at the time of compile. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.IteratorStateMachineAttribute"> |
||||
|
<summary>Identities the iterator state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.IteratorStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="T:System.ITuple"> |
||||
|
<summary> |
||||
|
Helper so we can call some tuple methods recursively without knowing the underlying types. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple"> |
||||
|
<summary> |
||||
|
Provides static methods for creating tuple objects. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``1(``0)"> |
||||
|
<summary> |
||||
|
Creates a new 1-tuple, or singleton. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the only component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the only component of the tuple.</param> |
||||
|
<returns>A tuple whose value is (item1).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``2(``0,``1)"> |
||||
|
<summary> |
||||
|
Creates a new 3-tuple, or pair. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<returns>An 2-tuple (pair) whose value is (item1, item2).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``3(``0,``1,``2)"> |
||||
|
<summary> |
||||
|
Creates a new 3-tuple, or triple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<returns>An 3-tuple (triple) whose value is (item1, item2, item3).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``4(``0,``1,``2,``3)"> |
||||
|
<summary> |
||||
|
Creates a new 4-tuple, or quadruple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<returns>An 4-tuple (quadruple) whose value is (item1, item2, item3, item4).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``5(``0,``1,``2,``3,``4)"> |
||||
|
<summary> |
||||
|
Creates a new 5-tuple, or quintuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<returns>An 5-tuple (quintuple) whose value is (item1, item2, item3, item4, item5).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``6(``0,``1,``2,``3,``4,``5)"> |
||||
|
<summary> |
||||
|
Creates a new 6-tuple, or sextuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
<returns>An 6-tuple (sextuple) whose value is (item1, item2, item3, item4, item5, item6).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``7(``0,``1,``2,``3,``4,``5,``6)"> |
||||
|
<summary> |
||||
|
Creates a new 7-tuple, or septuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
<typeparam name="T7">The type of the seventh component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
<param name="item7">The value of the seventh component of the tuple.</param> |
||||
|
<returns>An 7-tuple (septuple) whose value is (item1, item2, item3, item4, item5, item6, item7).</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple.Create``8(``0,``1,``2,``3,``4,``5,``6,``7)"> |
||||
|
<summary> |
||||
|
Creates a new 8-tuple, or octuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
<typeparam name="T7">The type of the seventh component of the tuple.</typeparam> |
||||
|
<typeparam name="T8">The type of the eighth component of the tuple.</typeparam> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
<param name="item7">The value of the seventh component of the tuple.</param> |
||||
|
<param name="item8">The value of the eighth component of the tuple.</param> |
||||
|
<returns>An 8-tuple (octuple) whose value is (item1, item2, item3, item4, item5, item6, item7, item8).</returns> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`1"> |
||||
|
<summary> |
||||
|
Represents a 1-tuple, or singleton. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the tuple's only component.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`1.#ctor(`0)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`1"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the current tuple object's single component.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`1.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`1.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`1.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`1.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the tuple object's single component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's single component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`2"> |
||||
|
<summary> |
||||
|
Represents an 2-tuple, or pair. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`2.#ctor(`0,`1)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`2"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`2.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`2.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`2.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`2.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`2.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`3"> |
||||
|
<summary> |
||||
|
Represents an 3-tuple, or triple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`3.#ctor(`0,`1,`2)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`3"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`3.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`3.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`3.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`3.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`3.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`3.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`4"> |
||||
|
<summary> |
||||
|
Represents an 4-tuple, or quadruple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`4.#ctor(`0,`1,`2,`3)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`4"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`4.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`4.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`4.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`4.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`4.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`4.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`4.Item4"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fourth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fourth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`5"> |
||||
|
<summary> |
||||
|
Represents an 5-tuple, or quintuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`5.#ctor(`0,`1,`2,`3,`4)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`5"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`5.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`5.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`5.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`5.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`5.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`5.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`5.Item4"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fourth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fourth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`5.Item5"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fifth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fifth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`6"> |
||||
|
<summary> |
||||
|
Represents an 6-tuple, or sextuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`6.#ctor(`0,`1,`2,`3,`4,`5)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`6"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`6.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`6.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`6.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item4"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fourth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fourth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item5"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fifth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fifth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`6.Item6"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's sixth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's sixth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`7"> |
||||
|
<summary> |
||||
|
Represents an 7-tuple, or septuple. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
<typeparam name="T7">The type of the seventh component of the tuple.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`7.#ctor(`0,`1,`2,`3,`4,`5,`6)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`7"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
<param name="item7">The value of the seventh component of the tuple.</param> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`7.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`7.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`7.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item4"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fourth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fourth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item5"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fifth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fifth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item6"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's sixth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's sixth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`7.Item7"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's seventh component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's seventh component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="T:System.Tuple`8"> |
||||
|
<summary> |
||||
|
Represents an n-tuple, where n is 8 or greater. |
||||
|
</summary> |
||||
|
<typeparam name="T1">The type of the first component of the tuple.</typeparam> |
||||
|
<typeparam name="T2">The type of the second component of the tuple.</typeparam> |
||||
|
<typeparam name="T3">The type of the third component of the tuple.</typeparam> |
||||
|
<typeparam name="T4">The type of the fourth component of the tuple.</typeparam> |
||||
|
<typeparam name="T5">The type of the fifth component of the tuple.</typeparam> |
||||
|
<typeparam name="T6">The type of the sixth component of the tuple.</typeparam> |
||||
|
<typeparam name="T7">The type of the seventh component of the tuple.</typeparam> |
||||
|
<typeparam name="TRest">Any generic Tuple object that defines the types of the tuple's remaining components.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`8.#ctor(`0,`1,`2,`3,`4,`5,`6,`7)"> |
||||
|
<summary> |
||||
|
Initializes a new instance of the <see cref="T:System.Tuple`8"/> class. |
||||
|
</summary> |
||||
|
<param name="item1">The value of the first component of the tuple.</param> |
||||
|
<param name="item2">The value of the second component of the tuple.</param> |
||||
|
<param name="item3">The value of the third component of the tuple.</param> |
||||
|
<param name="item4">The value of the fourth component of the tuple.</param> |
||||
|
<param name="item5">The value of the fifth component of the tuple.</param> |
||||
|
<param name="item6">The value of the sixth component of the tuple.</param> |
||||
|
<param name="item7">The value of the seventh component of the tuple.</param> |
||||
|
<param name="rest">Any generic Tuple object that contains the values of the tuple's remaining components.</param> |
||||
|
<exception cref="T:System.ArgumentException"> |
||||
|
rest is not a generic Tuple object. |
||||
|
</exception> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`8.Equals(System.Object)"> |
||||
|
<summary> |
||||
|
Returns a value that indicates whether the current tuple object is equal to a specified object. |
||||
|
</summary> |
||||
|
<param name="obj">The object to compare with this instance.</param> |
||||
|
<returns>true if the current instance is equal to the specified object; otherwise, false.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`8.GetHashCode"> |
||||
|
<summary> |
||||
|
Calculates the hash code for the current tuple object. |
||||
|
</summary> |
||||
|
<returns>A 32-bit signed integer hash code.</returns> |
||||
|
</member> |
||||
|
<member name="M:System.Tuple`8.ToString"> |
||||
|
<summary> |
||||
|
Returns a string that represents the value of this tuple instance. |
||||
|
</summary> |
||||
|
<returns>The string representation of this tuple object.</returns> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item1"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's first component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's first component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item2"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's second component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's second component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item3"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's third component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's third component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item4"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fourth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fourth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item5"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's fifth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's fifth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item6"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's sixth component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's sixth component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Item7"> |
||||
|
<summary> |
||||
|
Gets the value of the current tuple object's seventh component. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's seventh component. |
||||
|
</value> |
||||
|
</member> |
||||
|
<member name="P:System.Tuple`8.Rest"> |
||||
|
<summary> |
||||
|
Gets the current tuple object's remaining components. |
||||
|
</summary> |
||||
|
<value> |
||||
|
The value of the current tuple object's remaining components. |
||||
|
</value> |
||||
|
</member> |
||||
|
</members> |
||||
|
</doc> |
||||
@ -0,0 +1 @@ |
|||||
|
9962594785f41f62455059efef8b8007e719a054 |
||||
@ -0,0 +1 @@ |
|||||
|
6c770122e85766385d4408b770fac43f117b065a |
||||
Binary file not shown.
@ -0,0 +1,56 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<doc> |
||||
|
<assembly> |
||||
|
<name>System.Runtime</name> |
||||
|
</assembly> |
||||
|
<members> |
||||
|
<member name="T:System.IProgress`1"> |
||||
|
<summary>Defines a provider for progress updates.</summary> |
||||
|
<typeparam name="T">The type of progress update value.</typeparam> |
||||
|
</member> |
||||
|
<member name="M:System.IProgress`1.Report(`0)"> |
||||
|
<summary>Reports a progress update.</summary> |
||||
|
<param name="value">The value of the updated progress.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.AsyncStateMachineAttribute"> |
||||
|
<summary>Identities the async state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.StateMachineAttribute"> |
||||
|
<summary>Identities the state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.StateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="P:System.Runtime.CompilerServices.StateMachineAttribute.StateMachineType"> |
||||
|
<summary>Gets the type that implements the state machine.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.AsyncStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerMemberNameAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the method or property name of the caller to the method. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerLineNumberAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the line number in the source file at which the method is called. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.CallerFilePathAttribute"> |
||||
|
<summary> |
||||
|
Allows you to obtain the full path of the source file that contains the caller. |
||||
|
This is the file path at the time of compile. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:System.Runtime.CompilerServices.IteratorStateMachineAttribute"> |
||||
|
<summary>Identities the iterator state machine type for this method.</summary> |
||||
|
</member> |
||||
|
<member name="M:System.Runtime.CompilerServices.IteratorStateMachineAttribute.#ctor(System.Type)"> |
||||
|
<summary>Initializes the attribute.</summary> |
||||
|
<param name="stateMachineType">The type that implements the state machine.</param> |
||||
|
</member> |
||||
|
</members> |
||||
|
</doc> |
||||
@ -0,0 +1 @@ |
|||||
|
9962594785f41f62455059efef8b8007e719a054 |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue