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
// | |
// datasource | |
private static Dictionary<string,object> sourceData = new Dictionary<string,object>{ | |
{"test1", "Joe"}, | |
{"test2", DateTime.Now}, | |
{"test3", 5} | |
}; | |
// | |
// target object | |
class Foo |
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
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>region</Title> | |
<Author>Ken Courville</Author> | |
<Shortcut>try</Shortcut> | |
<Description>Code snippet for a region statement</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> |
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
@model object | |
@{ | |
ViewBag.Title = "Object Information"; | |
} | |
@if(!Model.GetType().Name.Contains("Anonymous")){ | |
} | |
@foreach (var prop in Model.GetType().GetProperties()) |
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.ComponentModel.DataAnnotations; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System; | |
public interface ISelectiveDisplay { | |
bool IsVisible { get; set; } | |
ICollection<string> PropertiesToHide { get; } | |
} |
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
void Main() | |
{ | |
var contact = new Contact{ | |
FirstName = "John", | |
LastName = "Smith" | |
}; | |
var sourceXml = ToXml(contact); | |
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
void Main() | |
{ | |
var contact = new Contact{ | |
FirstName = "John", | |
LastName = "Smith", | |
HomePhone = new Phone{ | |
Number = "303-123-1234" | |
} | |
}; |
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
$('table.arrow-nav').keydown(function(e){ | |
var $table = $(this); | |
var $active = $('input:focus,select:focus',$table); | |
var $next = null; | |
var focusableQuery = 'input:visible,select:visible,textarea:visible'; | |
var position = parseInt( $active.closest('td').index()) + 1; | |
console.log('position :',position); | |
switch(e.keyCode){ | |
case 37: // <Left> | |
$next = $active.parent('td').prev().find(focusableQuery); |
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
const int iterations = 10; | |
const int inserts = 1000000; | |
const string mongodbname = "perftest"; | |
private SqlConnection sqlConnection; | |
private MongoDatabase mongoDb; | |
private List<Result> allresults = new List<Result>(); | |
#region setup-teardown | |
private void Setup(){ | |
sqlConnection = new SqlConnection(Connection.ConnectionString); |
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" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<connectionStrings> | |
<add name="mongolog" connectionString="{mymongoconnectionstring}"/> | |
</connectionStrings> | |
<appSettings> |
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
const string myprop = "myprop"; | |
const string myvalue = "myvalue"; | |
var manager = new Manager(new System.IO.DirectoryInfo(@"C:\temp\cbldb"), ManagerOptions.Default); | |
var db = manager.GetDatabase("test"); | |
var newdoc = db.CreateDocument(); | |
var props = new Dictionary<string, object> | |
{ | |
{myprop, myvalue } |
OlderNewer