<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Schiøtt&#039;s Blog</title>
	<atom:link href="http://schiott.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://schiott.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 28 Dec 2011 20:03:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='schiott.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Schiøtt&#039;s Blog</title>
		<link>http://schiott.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://schiott.wordpress.com/osd.xml" title="Schiøtt&#039;s Blog" />
	<atom:link rel='hub' href='http://schiott.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Raise Events</title>
		<link>http://schiott.wordpress.com/2011/08/11/raise-events/</link>
		<comments>http://schiott.wordpress.com/2011/08/11/raise-events/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 11:23:38 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=213</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=213&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
public class Time
    {
        //Denne klassen kan du test som følger fra et annet sted..
        //private void simpleButton2_Click(object sender, EventArgs e)
        //{

        //    Time t = new Time();
        //    t.TimeHasChanged += t_TimeHasChanged;
        //    t.ChangeTime();
        //}

        //void t_TimeHasChanged(object sender, TimeHasChangedEventArgs e)
        //{
        //    MessageBox.Show(e.SomeProperty);
        //}


   
        //Delegaten
        public delegate void TimeHasChangedEventHandler(object sender, TimeHasChangedEventArgs e);

        //Eventet
        public event TimeHasChangedEventHandler TimeHasChanged;

        // Metoden man benytter for å raise eventet
        protected virtual void OnTimeHasChanged(TimeHasChangedEventArgs e)
        {
            if (TimeHasChanged!=null)
            {
                //Invoke delegates
                TimeHasChanged(this, e);
            }
        }

        //En testmetode for å kunne raise eventet.
        //Vanligvis vil man raise eventet på de stedene man måtte ønske
        public void ChangeTime()
        {
            this.OnTimeHasChanged(new TimeHasChangedEventArgs() { SomeProperty = &quot;Dette er en test&quot; });
        }

    }

    //EventArgs klassen. Denne vil du normalt utstyre med de properties som du har behov for.
    //Dersom du ikke har behov for å sende spesielle data rundt omkring så kan du bruke EventArgs direkte
    //og ikke gå via en egen klasse som arver EventArgs
    public class TimeHasChangedEventArgs : EventArgs
    {
        public string SomeProperty { get; set; }
    }

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=213&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/08/11/raise-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>Ta tiden på noe</title>
		<link>http://schiott.wordpress.com/2011/08/03/ta-tiden-pa-noe/</link>
		<comments>http://schiott.wordpress.com/2011/08/03/ta-tiden-pa-noe/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 09:33:23 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=208</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=208&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
//Start tid
DateTime startTime = DateTime.Now;

//Gjør noe
Thread.Sleep(2000);

//Stopp tid
DateTime stopTime = DateTime.Now;

//Hvor lang tid tok det.
TimeSpan duration = stopTime - startTime;
MessageBox.Show(duration.ToString());
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=208&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/08/03/ta-tiden-pa-noe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Operators</title>
		<link>http://schiott.wordpress.com/2011/05/24/c-operators/</link>
		<comments>http://schiott.wordpress.com/2011/05/24/c-operators/#comments</comments>
		<pubDate>Tue, 24 May 2011 09:27:03 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=205</guid>
		<description><![CDATA[Null-coalescing (??) // y = x, unless x is null, in which case y = -1. int y = x ?? -1; Conditional operator (?:) condition ? first_expression : second_expression;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=205&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Null-coalescing (??)<br />
// y = x, unless x is null, in which case y = -1.<br />
int y = x ?? -1;</p>
<p>Conditional operator (?:)<br />
condition ? first_expression : second_expression;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=205&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/05/24/c-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>Enable/Disable Resharper</title>
		<link>http://schiott.wordpress.com/2011/05/11/enabledisable-resharper/</link>
		<comments>http://schiott.wordpress.com/2011/05/11/enabledisable-resharper/#comments</comments>
		<pubDate>Wed, 11 May 2011 11:45:21 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=202</guid>
		<description><![CDATA[Du må ikke lete i resharper menyen, men i den ordinære tools menyen. Tools&#8211;&#62;Options&#8211;&#62;Resharper.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=202&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Du må ikke lete i resharper menyen, men i den ordinære tools menyen.<br />
Tools&#8211;&gt;Options&#8211;&gt;Resharper.<br />
<a href="http://schiott.files.wordpress.com/2011/05/resharper.png"><img class="alignnone size-full wp-image-203" title="Resharper" src="http://schiott.files.wordpress.com/2011/05/resharper.png?w=640&#038;h=371" alt="" width="640" height="371" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=202&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/05/11/enabledisable-resharper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>

		<media:content url="http://schiott.files.wordpress.com/2011/05/resharper.png" medium="image">
			<media:title type="html">Resharper</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugger</title>
		<link>http://schiott.wordpress.com/2011/04/14/debugger/</link>
		<comments>http://schiott.wordpress.com/2011/04/14/debugger/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 17:24:58 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=188</guid>
		<description><![CDATA[Resultatet blir da:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=188&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">

List li = new List();
li.Add(new Person { FirstName = &quot;Jeroen&quot;, LastName = &quot;Schiøtt&quot; });
li.Add(new Person { FirstName = &quot;Ronny&quot;, LastName = &quot;Gydar&quot; });

//Vha denne attributten får vi pen informasjon i debugger.
[System.Diagnostics.DebuggerDisplay(&quot;{FirstName} {LastName}&quot;)]
    public class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
</pre></p>
<p>Resultatet blir da:<br />
<a href="http://schiott.files.wordpress.com/2011/04/debugger1.png"><img src="http://schiott.files.wordpress.com/2011/04/debugger1.png?w=640&#038;h=165" alt="" title="Debugger" width="640" height="165" class="alignnone size-full wp-image-193" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=188&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/04/14/debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>

		<media:content url="http://schiott.files.wordpress.com/2011/04/debugger1.png" medium="image">
			<media:title type="html">Debugger</media:title>
		</media:content>
	</item>
		<item>
		<title>List (sortering og where)</title>
		<link>http://schiott.wordpress.com/2011/04/09/sortering-av-list/</link>
		<comments>http://schiott.wordpress.com/2011/04/09/sortering-av-list/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 13:46:37 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=184</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=184&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
[System.Diagnostics.DebuggerDisplay(&quot;{FirstName} {LastName} {Age}&quot;)]
 public class Person
 {
 public string FirstName { get; set; }
 public string LastName { get; set; }
 public int Age { get; set; }

public static void Sortering()
 {
 //Koden for å sortere
 List&lt;Person&gt; Personer = new List&lt;Person&gt;();
 Personer.Add(new Person { FirstName = &quot;Abel&quot;, LastName = &quot;Smith&quot;, Age = 34 });
 Personer.Add(new Person { FirstName = &quot;Tony&quot;, LastName = &quot;Andersen&quot;, Age = 30 });
 Personer.Add(new Person { FirstName = &quot;Chris&quot;, LastName = &quot;Kub&quot;, Age = 10 });

//Sorterer på FirstName
 List&lt;Person&gt; sortedList = Personer.OrderBy(x =&gt; x.FirstName).ToList();

//Sorterer på LastName
 List&lt;Person&gt; sortedList2 = Personer.OrderBy(x =&gt; x.LastName).ToList();

//Sorterer på Age
 List&lt;Person&gt; sortedList3 = Personer.OrderBy(x =&gt; x.Age).ToList();

//Sorterer på Age også på LastName
 List&lt;Person&gt; sortedList4 = Personer.OrderBy(x =&gt; x.Age).ThenBy(x =&gt; x.LastName).ToList();

//Legg merke til at både OrderBy og ThenBy har respektive Descending metoder.
 List&lt;Person&gt; sortedList5 = Personer.OrderByDescending(x =&gt; x.Age).ThenByDescending(x =&gt; x.LastName).ToList();
 }

public static void UseOfWhere()
 {
 List&lt;Person&gt; Personer = new List&lt;Person&gt;();
 Personer.Add(new Person { FirstName = &quot;Abel&quot;, LastName = &quot;Smith&quot;, Age = 34 });
 Personer.Add(new Person { FirstName = &quot;Tony&quot;, LastName = &quot;Andersen&quot;, Age = 30 });
 Personer.Add(new Person { FirstName = &quot;Chris&quot;, LastName = &quot;Kub&quot;, Age = 10 });

List&lt;Person&gt; Under30 = Personer.Where(x =&gt; x.Age &lt; 30).ToList();

//Bruk av funksjon..
 List&lt;Person&gt; someitems = Personer.Where(new Func&lt;Person, bool&gt;(t =&gt;
 {
 //Utav new Func&lt;Person, bool&gt;(t =&gt; kan vi lese
 //Dette er en funksjon som får inn Person i variabelen t
 //Funksjonen skal returnere en bool.

//Vi kan så skrive ordinær kode her..
 if (t.Age==30) return true;
 return false;
 }
 )).ToList();

//Vi kan også skrive dette litt enklere..
 List&lt;Person&gt; someitems2 = Personer.Where(t =&gt;
 {
 //Vi kan så skrive ordinær kode her..
 if (t.Age == 30) return true;
 return false;
 }
 ).ToList();
 }
 }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=184&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/04/09/sortering-av-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>Kul bruk av var</title>
		<link>http://schiott.wordpress.com/2011/04/02/kul-bruk-av-var/</link>
		<comments>http://schiott.wordpress.com/2011/04/02/kul-bruk-av-var/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 14:10:51 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=180</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=180&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
System.Data.DataTable dt = new DataTable();
dt.Columns.Add(&quot;Name&quot;);
System.Data.DataRow r = dt.NewRow();
r[&quot;Name&quot;] = &quot;d&quot;;

dt.Rows.Add(r);

var anon = new { Name = System.Convert.ToString( dt.Rows[0][&quot;Name&quot;]), Age = 34 };
//anon.Name = &quot;Jeroen&quot;;             //Readonly. Dette funker ikke.
//List&lt;anon&gt; l = new List&lt;anon&gt;();  //Dette funker heller ikke.

//Dette funker og man har intellicence.
MessageBox.Show(anon.Name);

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=180&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/04/02/kul-bruk-av-var/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>Winzip from C#</title>
		<link>http://schiott.wordpress.com/2011/01/30/winzip-from-c/</link>
		<comments>http://schiott.wordpress.com/2011/01/30/winzip-from-c/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 08:55:24 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=157</guid>
		<description><![CDATA[http://dotnetzip.codeplex.com Bruk:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=157&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dotnetzip.codeplex.com">http://dotnetzip.codeplex.com</a></p>
<p>Bruk:</p>
<p><pre class="brush: csharp;">
using (ZipFile zip = new ZipFile())
{
//Passord må settes FØR selve filen legges inn.
//Det virker som om man setter et passord pr fil i zip filen.
zip.Password = &quot;p&quot;;
zip.AddFile(&quot;c:\\temp3\\data.txt&quot;,&quot;&quot;);
zip.Save(&quot;c:\\temp3\\ZipByCode.zip&quot;);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=157&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2011/01/30/winzip-from-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2008 Snippets</title>
		<link>http://schiott.wordpress.com/2010/11/25/visual-studio-2008-snippets/</link>
		<comments>http://schiott.wordpress.com/2010/11/25/visual-studio-2008-snippets/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 09:16:50 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=155</guid>
		<description><![CDATA[Last ned en editor : http://snippeteditor.codeplex.com/ Dersom du skal redigere eksisterende snippets og kjører windows 7, start programmet som administrator, ellers får du problemer med skriverettigheter. Dersom du skal lagre egne snippets så lagrer du disse i mappen: [My documents]\visual studio &#8230; <a href="http://schiott.wordpress.com/2010/11/25/visual-studio-2008-snippets/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=155&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last ned en editor : <a href="http://snippeteditor.codeplex.com/">http://snippeteditor.codeplex.com/<br />
</a>Dersom du skal redigere eksisterende snippets og kjører windows 7, start programmet som administrator, ellers får du problemer med skriverettigheter.</p>
<p>Dersom du skal lagre egne snippets så lagrer du disse i mappen:<br />
[My documents]\visual studio 2008\code snippets\visual c#\my code snippets<br />
De må lagres med extension .snippet</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=155&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2010/11/25/visual-studio-2008-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Mod eksempel</title>
		<link>http://schiott.wordpress.com/2010/11/19/c-mod-eksempel/</link>
		<comments>http://schiott.wordpress.com/2010/11/19/c-mod-eksempel/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 09:31:04 +0000</pubDate>
		<dc:creator>jeroenschiott</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://schiott.wordpress.com/?p=149</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=149&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
//Gi brukeren en melding for hver 50 rad.
for (int i = 0; i &lt; 500; i++)
{
    //The modulus operator (%) computes the remainder after
    //dividing its first operand by its second.
    if (i%50==0)
    {
        this.Text=&quot;Antall rader = &quot; + i.ToString();
    }
}

//Brukt i forbindelse med en datatable.
Int32 NrOfRows = this.MyDataTable.Rows.Count;
Int32 RowCounter = 0;
foreach (DataRow MyRow in this.MyDataTable.Rows)
{
    RowCounter += 1;
    //Viser melding for rad 1 også for hver 20 rad og til slutt for den siste raden.
    if (RowCounter % 20 == 0 || RowCounter == NrOfRows || RowCounter==1)
    {
        //Skriver en status melding.
        this.Text = &quot;Rader overført : &quot; + RowCounter.ToString();
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/schiott.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/schiott.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/schiott.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=schiott.wordpress.com&amp;blog=5721947&amp;post=149&amp;subd=schiott&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://schiott.wordpress.com/2010/11/19/c-mod-eksempel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a5ad9abe6ea224137a555b2599c43f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jeroenschiott</media:title>
		</media:content>
	</item>
	</channel>
</rss>
