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
// Copyright Matthew King 2014. | |
// Licensed under the Boost Software License, Version 1.0. | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
/// <summary> | |
/// Extends the System.Windows.Forms.ListView class, removing the focus indicators. | |
/// </summary> |
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
/// <summary> | |
/// A System.Windows.Forms.CreateParams that contains the required creation parameters | |
/// when the handle to the control is created. | |
/// </summary> | |
protected override CreateParams CreateParams | |
{ | |
get | |
{ | |
CreateParams cp = base.CreateParams; | |
cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED |
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.Device.Location; | |
/// <summary> | |
/// Supplies location data that is based on latitude and longitude coordinates. | |
/// </summary> | |
/// <remarks> | |
/// Fixes the dodgy miswired events in Microsoft's base GeoCoordinateWatcher implementation. | |
/// </remarks> | |
class GeoCoordinateWatcherFixed : GeoCoordinateWatcher, IGeoPositionWatcher<GeoCoordinate> |
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
function Get-ApplicationReference([string] $deploymentManifestPath) { | |
[xml]$content = Get-Content $deploymentManifestPath | |
$identity = $content.assembly.assemblyIdentity | |
$codebase = $content.assembly.deployment.deploymentProvider.codebase | |
$appref = '{0}#{1}, Culture={2}, PublicKeyToken={3}, processorArchitecture={4}' -f $codebase, $identity.name, 'neutral', $identity.publicKeyToken, $identity.processorArchitecture | |
return $appref | |
} |
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.Threading.Tasks; | |
using System.Windows.Forms; | |
/// <summary> | |
/// Extension methods for System.Windows.Forms.Form. | |
/// </summary> | |
static class FormExtensions | |
{ | |
/// <summary> |
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
// Adapted from Greg Beech's blog post: | |
// http://gregbee.ch/blog/natural-sort-order-of-strings-and-file | |
// Distributed under the Creative Commons Zero (CC0) license. | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
/// <summary> | |
/// A string comparer that uses the StrCmpLogicalW function for natural string comparisons. |
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
// Copyright Matthew King 2012. | |
// Boost Software License - Version 1.0 - August 17th, 2003 | |
// Permission is hereby granted, free of charge, to any person or organization | |
// obtaining a copy of the software and accompanying documentation covered by | |
// this license (the "Software") to use, reproduce, display, distribute, | |
// execute, and transmit the Software, and to prepare derivative works of the | |
// Software, and to permit third-parties to whom the Software is furnished to | |
// do so, all subject to the following: |
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
/// <summary> | |
/// Determines whether the current object is equal to another object of the same type. | |
/// </summary> | |
/// <param name="other">An object to compare with this object.</param> | |
/// <returns> | |
/// true if the current object is equal to the specified object; otherwise, false. | |
/// </returns> | |
public bool Equals(T other) | |
{ | |
if (Object.ReferenceEquals(other, null)) return false; |
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.Runtime.InteropServices; | |
using System.Windows.Forms; | |
/// <summary> | |
/// Provides methods to (properly) enable and disable double buffering on a ListView control. | |
/// Based on Giovanni Montrone's article on CodeProject at | |
/// <see cref="http://www.codeproject.com/KB/list/listviewxp.aspx"/>, | |
/// and on the StackOverflow answer at | |
/// <see cref="http://stackoverflow.com/a/162770/286936"/>. |
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
// Copyright Matthew King 2011-2013. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See http://www.boost.org/LICENSE_1_0.txt) | |
using System; | |
using System.Globalization; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
/// <summary> |
OlderNewer