Skip to content

Instantly share code, notes, and snippets.

View mastoj's full-sized avatar

Tomas Jansson mastoj

View GitHub Profile
public class test
{
public void main(string[] args)
{
Console.WriteLine("Hello world!");
Console.ReadLine();
}
}
@mastoj
mastoj / ClientWrapperUsage.cs
Created December 6, 2010 20:05
Generic service client base class for WCF
public class ClientWrapperUsage
{
public static void main(string[] args)
{
using(var clientWrapper = new ServiceClientWrapper<ServiceType>())
{
var response = clientWrapper.Channel.ServiceCall();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CycleGraph
{
public class Node
{
public int Id { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
namespace DynamicTest
{
class Program
{
static void Main(string[] args)
{
@mastoj
mastoj / NavigationObserver.cs
Created September 9, 2011 22:28
WatiN observable browser
public class NavigationObserver
{
private HttpStatusCode _statusCode;
private bool _errorOccured;
public NavigationObserver(IE ie)
{
InternetExplorer internetExplorer = (InternetExplorer)ie.InternetExplorer;
internetExplorer.NavigateError += IeNavigateError;
internetExplorer.NavigateComplete2 += internetExplorer_NavigateComplete2;
@mastoj
mastoj / JpgProcessor.cs
Created October 11, 2011 07:53
WcfWebApi Content-Disposition
public class JpgProcessor : MediaTypeFormatter
{
public JpgProcessor()
{
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/jpg"));
}
protected override object OnReadFromStream(Type type, Stream stream, HttpContentHeaders contentHeaders)
{
throw new NotImplementedException();
}
@mastoj
mastoj / ImplicitDemo
Created May 4, 2012 07:47
Implicit operator demo
class Program
{
static void Main(string[] args)
{
var helloB = new HelloB() {PropB = "PropB"};
Console.WriteLine("HelloB.PropB: " + helloB.PropB);
HelloA helloA = helloB;
Console.WriteLine("HelloA.PropA: " + helloA.PropA);
helloA.PropA = "PropA";
Console.WriteLine("HelloA.PropA: " + helloA.PropA);
@mastoj
mastoj / RavenDBError
Created May 29, 2012 19:11
Trying to reproduce a raven db error
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Raven.Abstractions.Data;
using Raven.Client.Document;
using Raven.Client.Indexes;
@mastoj
mastoj / Program.cs
Created May 30, 2012 08:51
Eksempel på Parallel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ParallellDemo
{
public class Worker
@mastoj
mastoj / gist:2954528
Created June 19, 2012 14:32
Simple generic output formatter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace FileGenerator
{
class Program
{