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 void DisplayNameAndTitle(Person p) | |
{ | |
Contract.Requires(p != null, "Person cannot be null"); | |
Contract.Requires(p.GivenName != null, "Person's given name must be specified"); | |
Console.WriteLine("{0} {1} {2}", p.Title, p.GivenName, p.FamilyName); | |
} |
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
require 'albacore' | |
require 'fileutils' | |
PROJECT_NAME = "Your Project Here" | |
DOT_NET_PATH = "C:/Windows/Microsoft.NET/Framework/v4.0.30319/" | |
NUNIT_PATH = "Tools/nunit/" | |
MSPEC_PATH = "Tools/mspec/" | |
PROJECT_CONFIG = (ENV['PROJECT_CONFIG'] == nil) ? "Debug" : ENV['PROJECT_CONFIG'] | |
COMPANY_NAME = "Your Company Here" | |
BUILD_NUMBER = (ENV['BUILD_NUMBER'] == nil) ? "1.0.0.0" : ENV['BUILD_NUMBER'] |
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
$('#saveChanges').click(function () { | |
var rules = new Array(); | |
$('#assignedRules table.ruleTable tbody tr').each(function (i) { | |
var subRuleCode = $('#subRuleCode', this).val(); | |
var productGroupId = $('#productGroupId', this).val(); | |
rules.push(new Rule(subRuleCode, productGroupId)); | |
}); | |
var postData = JSON.stringify(rules); ; |
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
function Rule(subRuleCode, productGroupId) { | |
this.SubRule = subRuleCode; | |
this.ProductGroupId = productGroupId; | |
} |
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
[AcceptVerbs(HttpVerbs.Post)] | |
public JsonResult SaveUserRules(List<Rule> usersRules) | |
{ | |
// do something with the userRules list | |
} |
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 override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) | |
{ | |
if (!IsJSONRequest(controllerContext)) | |
{ | |
return base.BindModel(controllerContext, bindingContext); | |
} | |
// get the JSON data that's been posted | |
var request = controllerContext.HttpContext.Request; | |
var jsonStringData = new StreamReader(request.InputStream).ReadToEnd(); |
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
ModelBinders.Binders.DefaultBinder = new JsonModelBinder(); |
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
#region | |
using System; | |
using System.Threading; | |
using System.Windows.Forms; | |
using QlikView; | |
using Application = QlikView.Application; | |
#endregion |
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
protected override async Task RunAsync(CancellationToken cancelServicePartitionReplica) | |
{ | |
// TODO: Replace the following sample code with your own logic. | |
// Gets (or creates) a replicated dictionary called "myDictionary" in this partition. | |
var myDictionary = await this.StateManager.GetOrAddAsync<IReliableDictionary<string, long>>("myDictionary"); | |
// This partition's replica continues processing until the replica is terminated. | |
while (!cancelServicePartitionReplica.IsCancellationRequested) | |
{ |
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
var client = QueueClient.CreateFromConnectionString(connectionString, "send-email-queue"); | |
var sendEmailCommand = new SendEmailCommand { | |
Subject = "Email from contact us page", | |
Body = "Hi, please can you send me more details about the super email sender", | |
CustomerEmail = "jon@azureinsights.net" | |
}; | |
client.Send(new BrokeredMessage(sendEmailCommand)); |
OlderNewer