Skip to content

Instantly share code, notes, and snippets.

using System;
namespace LearnEvents
{
// Defining delegate type (similar to System.EventHandler)
delegate void SomeHandler(object sender, EventArgs e);
class Person
{
// Field-like event declared using keyword 'event'
using System;
using Microsoft.VisualStudio.TestTools.WebTesting;
namespace YourAppLoadTesting
{
public class AddCorrelationIdToReportPutRequest: WebTestPlugin
{
public string ApplyToRequestsThatContain { get; set; }
public string BodyStringParam { get; set; }
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace YourSystem.Tests
@andriybuday
andriybuday / Program.cs
Last active August 29, 2015 14:13
Integrating Edge.js into C# project
using System;
using EdgeJs;
namespace LearnEdgeJs
{
class Program
{
public void Start()
{
var func = Edge.Func(@"return require('../edgeEntryPoint.js')");
didSaveRecord: function (record, data) {
if (data) {
this.didSaveRecordForHasManyItems(this, record.constructor, data, record);
}
this._super(record, data);
},
// Fixes introdution in ember-data.1.0.0.beta4 (see method "addUnsavedRecords" in Store)
// assume that "any unsaved records that are
// in a hasMany they won't be in the payload"
@andriybuday
andriybuday / input-chosen-ember-component.js
Last active August 19, 2017 09:08
Integrating Chosen jQuery component with EmberJs and Bootstrap. This code works with Ember 1.2.0, jQuery 2.0.3, TwitterBootstrap 3.0 and Chosen 1.0.0.
App.InputChosenComponent = Ember.Component.extend({
init: function () {
this._super();
},
// settings
labelClass: 'col-sm-2',
label: 'Date',
inputContainerClass: 'col-sm-2',
inputClass: '',