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.IO; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading; | |
internal static class RawPrinterHelper | |
{ | |
[StructLayout(LayoutKind.Sequential)] |
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 AnonymousComparer | |
{ | |
private static class DefaultComparerCache | |
{ | |
private static readonly ConcurrentDictionary<Type, Expression> Cache = new ConcurrentDictionary<Type, Expression>(); | |
private static Expression GetDefaultComparerCore(Type propertyType) | |
{ | |
var genericTypeDefinition = typeof(Comparer<>); | |
var comparerType = genericTypeDefinition.MakeGenericType(propertyType); |
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 NBS.Core.Collections.Generic | |
{ | |
public static class ComparerExtensions | |
{ | |
private sealed class ReverseComparer<T> : IComparer<T> | |
{ | |
public readonly IComparer<T> Original; |
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.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. |
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
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 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
/* | |
* 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; |
NewerOlder