This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* An RSS feed formatter which supports parsing v0.91 format feeds. | |
* | |
* Based on: | |
* http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static class SafeNativeMethods | |
{ | |
[DllImport("dwmapi", SetLastError = true)] | |
private static extern int DwmIsCompositionEnabled([MarshalAs(UnmanagedType.Bool)] out bool isEnabled); | |
public static bool SafeDwmIsCompositionEnabled() | |
{ | |
bool result = false; | |
if (Environment.OSVersion.Version.Major >= 6) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace NBS.Core.Collections.Generic | |
{ | |
public static class ComparerExtensions | |
{ | |
private sealed class ReverseComparer<T> : IComparer<T> | |
{ | |
public readonly IComparer<T> Original; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public sealed class Throttle | |
{ | |
private readonly Queue<TaskCompletionSource<IDisposable>> _waiters = new Queue<TaskCompletionSource<IDisposable>>(); | |
private readonly WaitCallback _releaseCoreCallback; | |
private readonly Task<IDisposable> _releaserTask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Morris | |
{ | |
public sealed class MorrisList : IEnumerable<byte> | |
{ | |
private sealed class MorrisNode | |
{ | |
public const int Size = 80000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.AspNetCore.Mvc.Rendering; | |
using Microsoft.AspNetCore.Mvc.ViewFeatures; | |
using Microsoft.AspNetCore.Razor.TagHelpers; | |
namespace AspNetCore.Helpers | |
{ | |
[HtmlTargetElement(Attributes = ViewBagKeyAttributeName)] | |
public class HtmlElementAttributeTagHelper : TagHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class AsIsBundleOrderer : IBundleOrderer | |
{ | |
private AsIsBundleOrderer() | |
{ | |
} | |
public static IBundleOrderer Instance { get; } = new AsIsBundleOrderer(); | |
public IEnumerable<BundleFile> OrderFiles(BundleContext context, IEnumerable<BundleFile> files) => files; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace System.Xml.Linq | |
{ | |
public static class XmlDefaultNamespaceExtensions | |
{ | |
public static IEnumerable<XElement> DescendantsNs(this XElement container, string name) | |
=> container.Descendants(container.Name.Namespace + name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using System.Net.Mail; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public static class SmtpClientExtensions | |
{ | |
/// <summary> | |
/// Sends the specified message to an SMTP server for delivery as an asynchronous operation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
namespace Trinet.Core | |
{ | |
/// <summary> | |
/// Represents the time of sunrise and sunset for a date and location. | |
/// </summary> | |
/// <remarks> | |
/// <para>The calculated times have a precision of approximately three mintes. |
OlderNewer