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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>NotifiedProperty</Title> | |
<Author>William Wegerson</Author> | |
<Description>Same as the propfull snippet except it adds OnPropertyChanged to the setter. |
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 static class SQLExtensions | |
{ | |
/// <summary> | |
/// Microsoft doesn't handle JSON well, it wants to use XML methods which then retrieve | |
/// the JSON. Sometimes the JSON has characters in it which | |
/// </summary> | |
public static SqlJSONReader ExecuteJsonReader(this SqlCommand cmd) | |
{ | |
var rdr = cmd.ExecuteReader(); | |
return new SqlJSONReader(rdr); |
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
// Add reference Com -> `Microsoft Shell Controls` and `Microsoft Internet Controls` | |
// and System.Windows & PresentationCore for Clipboard | |
foreach (SHDocVw.InternetExplorer window in new SHDocVw.ShellWindows()) | |
{ | |
var filename = Path.GetFileNameWithoutExtension(window.FullName).ToLower(); | |
if (filename.ToLowerInvariant() == "explorer") | |
{ | |
Shell32.FolderItems items = ((Shell32.IShellFolderViewDual2)window.Document).SelectedItems(); | |
foreach (Shell32.FolderItem item in items) | |
{ |
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
SELECT | |
COLUMN_NAME, | |
DATA_TYPE, | |
CHARACTER_MAXIMUM_LENGTH, | |
concat('DECLARE @', COLUMN_NAME, N' ', DATA_TYPE, | |
IIF(CHARACTER_MAXIMUM_LENGTH IS not null | |
, CONCAT(N' (', CHARACTER_MAXIMUM_LENGTH, N')') | |
, N'' | |
) | |
) AS [declare] |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> | |
<xs:complexType name="EventBase"> | |
<xs:annotation> | |
<xs:documentation>***Abstract***</xs:documentation> | |
</xs:annotation> | |
<xs:attribute name="Name"/> | |
</xs:complexType> | |
<xs:element name="Event" type="EventBase"> | |
<xs:annotation><xs:documentation>A generic event derived from abstract.</xs:documentation></xs:annotation> |
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 static bool ValidDate( this string date ) | |
{ | |
bool valid = false; | |
DateTime targetDate; | |
if (valid = DateTime.TryParse( date, out targetDate )) | |
valid = (targetDate >= new DateTime( 1753, 1, 1 )) && | |
(targetDate <= new DateTime( 9999, 12, 31 )); | |
return valid; |
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.Linq; | |
using System.IO; | |
using System.Xml; | |
using System.Diagnostics; | |
using System.Text.RegularExpressions; | |
using System.Xml.Linq; | |
namespace RegexVsXml | |
{ |
NewerOlder