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
private static readonly StringBuilder Sb = new StringBuilder(); | |
private static void ShowResults() | |
{ | |
const string outputFile = "output.txt"; | |
File.WriteAllText(outputFile, Sb.ToString()); | |
Process.Start("notepad", outputFile); | |
} |
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 attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:element name="Lead"> | |
<xs:complexType> | |
<xs:sequence> | |
<xs:element name="Name" type="TName" /> | |
<xs:element name="Interested" type="TBool" /> | |
</xs:sequence> | |
</xs:complexType> | |
</xs:element> |
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 EomApp1.Formss.AB2.Model; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Linq; | |
namespace TestProject6 | |
{ | |
/// <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
public static string ToCurrencyString(this decimal amount, string currency) | |
{ | |
var map = new Dictionary<string, string> | |
{ | |
{"USD", "en-us"}, | |
{"GBP", "en-gb"}, | |
{"EUR", "de-de"}, | |
{"AUD", "en-AU"}, | |
{"CAD", "en-us"} | |
}; |
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.Remoting.Activation; | |
using System.Runtime.Remoting.Contexts; | |
using System.Runtime.Remoting.Messaging; | |
using DirectTrack; | |
using System.Linq; | |
namespace AOP | |
{ | |
/// <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
$d = "C:\db\backup" | |
$today = get-date -uformat "%Y_%m_%d" | |
$log = "C:\db\backup\" + "Purge_" + $today + ".log" | |
$a = Get-ChildItem $d -recurse | |
foreach($x in $a) | |
{ | |
$y = ((Get-Date) - $x.CreationTime).Days | |
if ($y -gt 3 -and $x.PsISContainer -ne $True) | |
{ | |
$deleted = "Deleting - " + $x.fullname + " - Last Write Time - " + $x.LastWriteTime |
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
$d = "C:\db\backup" | |
$today = get-date -uformat "%Y_%m_%d" | |
$log = "C:\db\backup\" + "Purge_" + $today + ".log" | |
$a = Get-ChildItem $d -recurse | |
foreach($x in $a) | |
{ | |
$y = ((Get-Date) - $x.CreationTime).Days | |
if ($y -gt 3 -and $x.PsISContainer -ne $True) | |
{ | |
$deleted = "Deleting - " + $x.fullname + " - Last Write Time - " + $x.LastWriteTime |
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.Data.Entity; | |
namespace EFCodeFirst | |
{ | |
public class Thing | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} |
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 ObjectSetExtensions | |
{ | |
public static int IdByName<T>(this ObjectSet<T> set, string name) where T : class | |
{ | |
int id = set.ToList() | |
.Where(c => c.MemberValue<string>("name") == name) | |
.Select(c => c.MemberValue<int>("id")) | |
.FirstOrDefault(); | |
if (id != default(int)) |
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 ReflectionExtensions | |
{ | |
public static Type UnderlyingType(this MemberInfo member) | |
{ | |
Type type; | |
switch (member.MemberType) | |
{ | |
case MemberTypes.Field: | |
type = ((FieldInfo)member).FieldType; | |
break; |
OlderNewer