Skip to content

Instantly share code, notes, and snippets.

View EnumJsonConverter.cs
public class EnumJsonConverter<TEnum, T> : JsonConverter<Enum<TEnum, T>>
where TEnum : Enum<TEnum, T>
{
public override void WriteJson(JsonWriter writer, Enum<TEnum, T> value, JsonSerializer serializer)
{
if (value == null)
{
writer.WriteNull();
}
else
View BulkInsertDataReader.cs
public abstract class BulkInsertDataReader<T> : IDataReader
{
private readonly IReadOnlyCollection<SqlBulkCopyColumnMapping> _columnMappings;
private readonly IEnumerator<T> _enumerator;
protected T Current { get; private set; }
public int Depth { get; private set; }
public bool IsClosed { get; private set; }
public int RecordsAffected { get; private set; }
View mimeTypeLookup.js
(function () {
'use strict';
/**
* @constructor
*/
ttBase.MimeTypeLookup = function () {
this.getMimeType = function (fileName) {
if (!angular.isString(fileName)) {
View ttBaseInit.js
(function () {
'use strict';
window.ttBase = window.ttBase || {};
ttBase.module = angular.module('ttBase', []);
})();
View MimeTypeLookup.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
namespace Thinktecture.Helpers
{
public class MimeTypeLookup
{
View ttValidationDefinition.js
(function () {
'use strict';
/**
* @constructor
*/
function TtValidationDefinitionProvider() {
var lookup = {};
this.register = function (key, validationDefinition) {
View appInit.js
app = {};
app.module = angular.module('app', []);
View ttValidate.js
(function () {
'use strict';
/**
* @param $scope
*/
function TtValidateController($scope) {
var validationKey = 'ttValidate-validate';
$scope.ngModel = null;
View ttValidation.js
(function () {
'use strict';
/**
* @param $scope
* @param $parse
*/
function TtValidationController($scope, $parse) {
var context = null;
var controls = [];