This file contains hidden or 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.Windows; | |
public static class ClipboardHelper | |
{ | |
public static void SetString(string value) | |
{ | |
if (!DataTransferHelper.TrySetString(value)) | |
{ | |
Clipboard.SetDataObject(value); |
This file contains hidden or 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 static class IQueryableExtensions | |
{ | |
private readonly struct HalfList<T> | |
{ | |
private readonly IReadOnlyList<T> _list; | |
private readonly int _startIndex; | |
private HalfList(IReadOnlyList<T> list, int startIndex, int count) | |
{ |
This file contains hidden or 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.IO; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Caching; | |
using System.Web.Hosting; | |
using System.Web.Mvc; | |
namespace NBS.Core.Web.Mvc | |
{ |
This file contains hidden or 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.Data; | |
using System.IO; | |
public static class SqlQueryFormatter | |
{ | |
public static string FormatCommand(this IDbCommand command) | |
{ | |
if (command is null) throw new ArgumentNullException(nameof(command)); | |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; |
NewerOlder