Format:
Recent snippets matching language of C#
(Korrigieren sie mich, wenn meine Annahme über den aktuellen Stand nicht zutrifft)
4 Views
no comments
/// <summary> /// This method does nothing, avoids compiler warnings. /// </summary> public static void Noop() { // alles fuer den hugo avoids compiler warnings int hugo = 1; hugo = hugo / 1; }
7 Views
no comments
======================== 08-02-2012 ========================= ------------- All Premium Accounts & cookies------------ ======================== 08-02-2012 ========================= [4] Parts : Part 1 : http://adf.ly/5ITNQ
6 Views
no comments
[TestMethod]
public void NA_EC_012_002_Start_Workflow()
{
// get the procInstID from the draft created in step 001
procInstID = UITestHelpers.GetProcInstIDFromWorkflowTitle(workflowTitle);
// verify procInstID exists is NOT deleted and IS in draft
bool isValid = UITestHelpers.VerifyProcessInstanceID(procInstID, false, false, WorkflowStep.Draft);
Assert.IsTrue(isValid == true, "Workflow {0} does not exist or is not an active draft workflow.", procInstID);
4 Views
no comments
// Från: http://codekata.pragprog.com/2007/01/kata_four_data_.html namespace CodeKatas { using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; using Moq;
12 Views
no comments
// Från: http://codekata.pragprog.com/2007/01/kata_four_data_.html namespace CodeKatas { using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; using Moq;
4 Views
no comments
public T Get<T>(string key, Func<T> fallbackFunction, CacheItemPolicy cacheItemPolicy=null) { if (cacheItemPolicy == null) { cacheItemPolicy = new CacheItemPolicy { AbsoluteExpiration = ObjectCache.InfiniteAbsoluteExpiration, Priority = CacheItemPriority.NotRemovable }; }
7 Views
no comments
public sealed class CacheManager : ICacheManager { private static readonly Lazy<CacheManager> lazy = new Lazy<CacheManager>(() => new CacheManager()); public static CacheManager Instance { get { return lazy.Value; } } private CacheManager() { if (_cache == null) {
7 Views
no comments
public sealed class CacheManager { private static readonly Lazy<CacheManager> lazy = new Lazy<CacheManager>(() => new CacheManager()); public static CacheManager Instance { get { return lazy.Value; } } private CacheManager() { if (_cache == null) {
6 Views
no comments
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.IO;
10 Views
no comments
builder.Entity<User>()
.HasMany(u => u.GrantedPermissions)
.WithMany(p => p.GrantedTo)
.Map(m =>
{
m.MapLeftKey("UserID");
m.MapRightKey("PermissionMask");
m.ToTable("GrantedPermissions");
});
11 Views
no comments
public double phi() { ArrayList string1 = new ArrayList(); Random rand = new Random(); double ph11; int f1 = 0, f2 = 0, f3 = 0, f4 = 0, f5 = 0, f6 = 0, s1, s2, n3 = 0, n4 = 0; double n1 = 0, n5 = 0; double n; string str, a1;
11 Views
no comments
public double po() { double k; double pooo = 0; double num = 0; k = 0; for (p1 = 0; p1 < 10; p1++) for (p2 = 0; p2 < 10; p2++) for (p3 = 0; p3 < 10; p3++)
11 Views
no comments
private void PhoneApplicationPage_ManipulationDelta1(object sender, ManipulationDeltaEventArgs e) { MyTransform1.X += e.DeltaManipulation.Translation.X; MyTransform1.Y += e.DeltaManipulation.Translation.Y; Collide(); } private void PhoneApplicationPage_ManipulationDelta2(object sender, ManipulationDeltaEventArgs e) { MyTransform2.X += e.DeltaManipulation.Translation.X;
13 Views
no comments
//Email regex validator Regex regex = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); //Website regex validator Regex regex = new Regex(@"^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$"); //Comments on forum regex validator (max 4000 characters) Regex regex = new Regex(@"^[+_%@:,.'!?"\\\^\&\#\$\*\(\)\-\/a-zA-Z0-9\s]{1,4000}$");
11 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ClassLibrary1 { using Chronic; using NUnit.Framework;
11 Views
no comments
class Program { static event Action eventToHandle; static void Main(string[] args) { int scopeVariable = 5; Action callback = null; callback = () => {
8 Views
no comments
protected override void RequestStartup(IKernel container, Nancy.Bootstrapper.IPipelines pipelines) { pipelines.AfterRequest.AddItemToStartOfPipeline( x => { if (x.Response.ContentType.Contains("text/html")) x.Response.ContentType = "text/html; charset=utf-8"; }); }
16 Views
no comments
protected override void RequestStartup(IKernel container, Nancy.Bootstrapper.IPipelines pipelines) { pipelines.AfterRequest.AddItemToStartOfPipeline( x => { if (x.Response.ContentType.Contains("text/html")) x.Response.ContentType = "text/html; charset=utf-8"; }); }
11 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
