<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0YNRnc6cSp7ImA9WhBVGUk.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887</id><updated>2013-04-25T20:53:17.919-05:00</updated><category term="sharepoint 2010" /><category term="reflection" /><category term="performance" /><category term="sharepoint" /><category term="api" /><title>Paul Kotlyar's .NET Adventures</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://unclepaul84.blogspot.com/" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PaulKotlyarsnetAdventures" /><feedburner:info uri="paulkotlyarsnetadventures" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0MGRX88eSp7ImA9WhNQFUw.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-8161882175807973364</id><published>2012-11-21T10:30:00.001-06:00</published><updated>2012-11-21T10:30:24.171-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-21T10:30:24.171-06:00</app:edited><title>FIX message Debug Visualizer for Visual Studio</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Recently I had the opportunity to work on an order management system which&amp;nbsp;utilized&amp;nbsp;&lt;a href="http://www.quickfixn.org/" target="_blank"&gt;QuickFIX/n&lt;/a&gt;&amp;nbsp;as the FIX Engine. As anyone who has worked with FIX probably knows, reading raw FIX message strings is not for the faint of heart. &amp;nbsp;After struggling with it for a while, I decided to put in the time to build a &lt;a href="https://github.com/unclepaul84/fixmessagevisualizer" target="_blank"&gt;Debug Visualizer.&lt;/a&gt;&amp;nbsp;Overall, I like how far I have gotten with it. &amp;nbsp;Please check it out on GitHub.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #990000;"&gt;GitHub&lt;/span&gt;&lt;/b&gt;:&amp;nbsp;&lt;a href="https://github.com/unclepaul84/fixmessagevisualizer" target="_blank"&gt;https://github.com/unclepaul84/fixmessagevisualizer&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-MqM8qneJMXA/UK0AfT68u2I/AAAAAAAAIQ0/8JYy3c9QIHI/s1600/FixVisulizer2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="500" src="http://1.bp.blogspot.com/-MqM8qneJMXA/UK0AfT68u2I/AAAAAAAAIQ0/8JYy3c9QIHI/s640/FixVisulizer2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/Olu_Ivemk2o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/8161882175807973364/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=8161882175807973364" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/8161882175807973364?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/8161882175807973364?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/Olu_Ivemk2o/fix-message-debug-visualizer-for-visual.html" title="FIX message Debug Visualizer for Visual Studio" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-MqM8qneJMXA/UK0AfT68u2I/AAAAAAAAIQ0/8JYy3c9QIHI/s72-c/FixVisulizer2.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2012/11/fix-message-debug-visualizer-for-visual.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08HSXo8fCp7ImA9WhJaF08.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-5820039839267015752</id><published>2012-10-08T13:32:00.000-05:00</published><updated>2012-10-08T13:43:58.474-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-08T13:43:58.474-05:00</app:edited><title>.NET equivalent of xslproc</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div&gt;
Recently I had to install&amp;nbsp;xslproc tool on windows &amp;nbsp;for an &lt;a href="https://github.com/connamara/quickfixn" target="_blank"&gt;open source projec&lt;/a&gt;t i'm contributing to. &amp;nbsp;All I can say is - annoying. &amp;nbsp;I decided to use the power of .Net to write a drop-in replacement. The main goal was not to change any of the scripts that call this tool and not to have any dependencies besides .NET Framework. My code is below. Not counting the error handling code, core logic is only 4 lines long. The miracle worker here is the&amp;nbsp;&lt;span style="color: #2b91af; font-family: Consolas; font-size: 13px;"&gt;&lt;a href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCIQFjAA&amp;amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.xml.xsl.xslcompiledtransform.aspx&amp;amp;ei=ohpzUPDKBeWqywGbmoHgDg&amp;amp;usg=AFQjCNEo6D_M60Shtoa5x8mjt_iiFvqxcQ&amp;amp;sig2=8EzNStEe8RijKFUWfqDMkw" target="_blank"&gt;XslCompiledTransform&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 13px;"&gt;&lt;a href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCIQFjAA&amp;amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.xml.xsl.xslcompiledtransform.aspx&amp;amp;ei=ohpzUPDKBeWqywGbmoHgDg&amp;amp;usg=AFQjCNEo6D_M60Shtoa5x8mjt_iiFvqxcQ&amp;amp;sig2=8EzNStEe8RijKFUWfqDMkw" target="_blank"&gt;&amp;nbsp;&lt;/a&gt;class.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Please note that it only supports limited subset of parameters of the original tool. Use at your own risk.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a href="https://skydrive.live.com/redir.aspx?cid=3d1aa7b9ba4b05fd&amp;amp;page=self&amp;amp;resid=3D1AA7B9BA4B05FD!243&amp;amp;parid=3D1AA7B9BA4B05FD!151&amp;amp;authkey=!AkPwMTUxEOokC_k&amp;amp;Bpub=SDX.SkyDrive&amp;amp;Bsrc=Share" target="_blank"&gt;Download Code&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;"&gt;&lt;pre style="background-position: initial initial; background-repeat: initial initial; font-family: Consolas;"&gt;&lt;/pre&gt;
&lt;pre style="background-position: initial initial; background-repeat: initial initial; font-family: Consolas;"&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;nbsp;Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[]&amp;nbsp;args)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&amp;nbsp;(args&amp;nbsp;==&amp;nbsp;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&amp;nbsp;||&amp;nbsp;args.Length&amp;nbsp;!=&amp;nbsp;4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Error.WriteLine(&lt;span style="color: #a31515;"&gt;"Invalid&amp;nbsp;arguments&amp;nbsp;provided!"&lt;/span&gt;&amp;nbsp;+&amp;nbsp;args.Length);
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;-1;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;outFile&amp;nbsp;=&amp;nbsp;args[1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;styleSheet&amp;nbsp;=&amp;nbsp;args[2];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;inputFile&amp;nbsp;=&amp;nbsp;args[3];
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;try&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XslCompiledTransform&lt;/span&gt;&amp;nbsp;myXslTransform&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XslCompiledTransform&lt;/span&gt;();
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myXslTransform.Load(&lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.Combine(&lt;span style="color: #2b91af;"&gt;Environment&lt;/span&gt;.CurrentDirectory,&amp;nbsp;styleSheet));
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myXslTransform.Transform(&lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.Combine(&lt;span style="color: #2b91af;"&gt;Environment&lt;/span&gt;.CurrentDirectory,&amp;nbsp;inputFile),&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.Combine(&lt;span style="color: #2b91af;"&gt;Environment&lt;/span&gt;.CurrentDirectory,&amp;nbsp;outFile));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;&amp;nbsp;ex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.Error.WriteLine(&lt;span style="color: #a31515;"&gt;"Error&amp;nbsp;during&amp;nbsp;transform:&amp;nbsp;"&lt;/span&gt;&amp;nbsp;+&amp;nbsp;ex.ToString());
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;-1;
 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="background-position: initial initial; background-repeat: initial initial; font-family: Consolas;"&gt;&lt;/pre&gt;
&lt;pre style="background-position: initial initial; background-repeat: initial initial; font-family: Consolas;"&gt;&lt;/pre&gt;
&lt;pre style="background-position: initial initial; background-repeat: initial initial; font-family: Consolas;"&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/cfJSPHAnprg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/5820039839267015752/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=5820039839267015752" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/5820039839267015752?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/5820039839267015752?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/cfJSPHAnprg/net-equivalent-of-xslproc.html" title=".NET equivalent of xslproc" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2012/10/net-equivalent-of-xslproc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ANQX4yfip7ImA9WhdTFkg.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-7879231238525604313</id><published>2011-07-14T11:09:00.000-05:00</published><updated>2011-07-14T11:09:50.096-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T11:09:50.096-05:00</app:edited><title>Testing for existence of key in a .NET 4 Dynamic Dictionary</title><content type="html">Recently I had to implement a component that recieves a dictionary filled with user settings. I decided to use C# 4's new dynamic keyword to enhance access to the dictionary. After some googling i found&amp;nbsp;a basic implementation of &lt;a href="http://haacked.com/archive/2009/08/26/method-missing-csharp-4.aspx"&gt;DynamicDictionary&lt;/a&gt; (Thanks to &lt;a href="http://haacked.com/articles/AboutHaacked.aspx" title="About Me"&gt;Phil Haack&lt;/a&gt; ). &lt;br /&gt;
&lt;br /&gt;
The one flaw in the implementation can be observed by looking at the code below. If key&amp;nbsp;"CustomerName" is not in the dictionary an exception will be thrown. &lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: 8pt;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;dynamic dic&lt;/span&gt; = &lt;span class="kwrd"&gt;new&lt;/span&gt; DynamicDictionary();

&lt;span class="kwrd"&gt;string&lt;/span&gt; customerName = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
            
customerName = dic.CustomerName; &lt;span class="rem"&gt;// Potential BinderException Here &lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
I wanted a clean approach to testing for existence of a key in my DynamicDictionary like in the code below:&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;div class="csharpcode"&gt;
dynamic dic = &lt;span class="kwrd"&gt;new&lt;/span&gt; DynamicDictionary();&lt;/div&gt;
&lt;div class="csharpcode"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;
&lt;span class="kwrd"&gt;string &lt;/span&gt;customerName = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;&lt;/div&gt;
&lt;div class="csharpcode"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;
&lt;span class="kwrd"&gt;if&lt;/span&gt; (dic.&lt;strong&gt;&lt;span style="background-color: orange;"&gt;HasCustomerName&lt;/span&gt;&lt;/strong&gt;())&lt;/div&gt;
&lt;div class="csharpcode"&gt;
&amp;nbsp; customerName = dic.CustomerName; &lt;/div&gt;
&lt;br /&gt;
I extended Phil's DynamicDictionary code to support a function&amp;nbsp;with signature&amp;nbsp;of&amp;nbsp;&amp;nbsp;"bool Has[Key]()". To implement this I had to&amp;nbsp;override&amp;nbsp; TryInvokeMember method of the DynamicObject class,&amp;nbsp;in which&amp;nbsp;I strip&amp;nbsp;out the "Has" part and simply call ContainsKey([Key]) on the dictionary.&lt;br /&gt;
Here is the complete code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DynamicDictionary : DynamicObject
    {
        Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;
          _dictionary = &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;();

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; TrySetMember(SetMemberBinder binder, &lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
        {
            _dictionary[binder.Name] = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; TryGetMember(GetMemberBinder binder,
            &lt;span class="kwrd"&gt;out&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; result)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; _dictionary.TryGetValue(binder.Name, &lt;span class="kwrd"&gt;out&lt;/span&gt; result);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; TryInvokeMember(InvokeMemberBinder binder, &lt;span class="kwrd"&gt;object&lt;/span&gt;[] args, &lt;span class="kwrd"&gt;out&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; result)
        {
            result = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

            &lt;span class="kwrd"&gt;if&lt;/span&gt; (binder.Name.StartsWith(&lt;span class="str"&gt;"Has"&lt;/span&gt;))
            {

                var propName = binder.Name.Substring(3, binder.Name.Length - 3);

                result = _dictionary.ContainsKey(propName);

                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            }



            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;

        }
    }&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/Z7m2cFWnHjo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/7879231238525604313/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=7879231238525604313" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/7879231238525604313?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/7879231238525604313?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/Z7m2cFWnHjo/testing-for-existence-of-key-in-net-4.html" title="Testing for existence of key in a .NET 4 Dynamic Dictionary" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2011/07/testing-for-existence-of-key-in-net-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQNR3o5eSp7ImA9WxFVF00.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-2834325478597192713</id><published>2010-06-16T11:39:00.000-05:00</published><updated>2010-06-16T11:39:56.421-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-16T11:39:56.421-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint 2010" /><title>"The SPPersistedObject, XXXXXXXXXXX, could not be updated because the current user is not a Farm Administrator" craziness in Sharepoint 2010</title><content type="html">After upgrading from SharePoint 2007 to 2010 we noticed that our custom job scheduler web part started throwing the following error:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;b&gt;"The SPPersistedObject, Microsoft.SharePoint.Administration.SPJobDefinition, could not be updated because the current user is not a Farm Administrator". &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Since we were running the &lt;strong&gt;SPJobDefinition.Update()&lt;/strong&gt; and related code under &lt;strong&gt;SPSecurity.RunWithElevatedPrivileges()&lt;/strong&gt;&amp;nbsp;I was under the impression that the code already ran as Farm Admin. After banging my head against the wall for a couple hours with no solution I decided to whip out my most trusted tool - Red Gate's Reflector - it never failed me before. &lt;br /&gt;
&lt;br /&gt;
Upon detailed investigation of &lt;strong&gt;Microsoft.SharePoint.&lt;/strong&gt;&lt;strong&gt;dll&lt;/strong&gt;&amp;nbsp;&amp;nbsp;I discovered that SharePoint guys added a new security feature to all objects&amp;nbsp;inheriting from&amp;nbsp;SPPersistedObject in the Microsoft.SharePoint.Administration namespace. This feature&amp;nbsp;explicitly&amp;nbsp;disallows modification of the above stated objects from content web applications, which is where our web part is running. The error message thrown is therefore very misleading. After some more tracing through the code I found a property in SharePoint API which&amp;nbsp;controls this behavior:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Microsoft.SharePoint.Administration.SPWebService.ContentService.RemoteAdministratorAccessDenied&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
After setting this property from PowerShell the issue went away with no code changes. The script I used is attached to this post.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-3d1aa7b9ba4b05fd.office.live.com/embedicon.aspx/Public/Set-RemoteAdministratorAccessDenied-False.ps1" style="background-color: #fcfcfc; height: 115px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/pjiErq1Ypgw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/2834325478597192713/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=2834325478597192713" title="14 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/2834325478597192713?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/2834325478597192713?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/pjiErq1Ypgw/sppersistedobject-xxxxxxxxxxx-could-not.html" title="&quot;The SPPersistedObject, XXXXXXXXXXX, could not be updated because the current user is not a Farm Administrator&quot; craziness in Sharepoint 2010" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>14</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkINQHgyeSp7ImA9WxBTE0o.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-717861447683410761</id><published>2009-12-08T11:29:00.004-06:00</published><updated>2009-12-09T10:03:11.691-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-09T10:03:11.691-06:00</app:edited><title>Starting SharePoint 2010 Site Workflows from code</title><content type="html">&lt;h4&gt;
Background&lt;/h4&gt;
One of the cool new features of&amp;nbsp; SharePoint 2010 is Site Workflows. As you probably know, in SharePoint 2007 a workflow can only be associated with a list or a document library. While this functionality is useful, sometimes a “site wide” workflow is called for. This leads to us developers getting creative and producing&amp;nbsp; approaches such as creating a list called “Site Workflows” and creating items in it that have “start on create” workflows attached to them. In SharePoint 2010 Site Workflows provide an elegant solution for this common scenario.&lt;br /&gt;
&lt;h4&gt;
The Code&lt;/h4&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:41c409c6-e8e7-4379-b7ba-b53e17967c98" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;pre style="background-color: white; font-family: Tahoma; font-size: 9px; overflow: auto;"&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="color: black;"&gt; (SPSite site &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; SPSite(&lt;a href="http://moss2010beta/"&gt;"http://moss2010beta"&lt;/a&gt;)) &lt;/span&gt;&lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;span style="color: green;"&gt;get the site&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;     {

           &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="color: black;"&gt; (SPWeb web &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; site.OpenWeb()) &lt;/span&gt;&lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;span style="color: green;"&gt; get the web&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;                  {
                        &lt;/span&gt;&lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;span style="color: green;"&gt;find workflow to start&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;                        var assoc &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; web.WorkflowAssociations.GetAssociationByName(&lt;/span&gt;&lt;span style="color: maroon;"&gt;"&lt;/span&gt;&lt;span style="color: maroon;"&gt;Demo Site Workflow&lt;/span&gt;&lt;span style="color: maroon;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, CultureInfo.InvariantCulture);

                        &lt;/span&gt;&lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;span style="color: green;"&gt;this is the call to start the workflow&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;                        var result &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; site.WorkflowManager.StartWorkflow(&lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;, assoc, &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;.Empty, SPWorkflowRunOptions.Synchronous);

                 }
    }    &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
As you probably have noticed, the API call to start a site workflow is not much different form the call to start a list workflow. A new overload was added to &lt;a href="http://msdn.microsoft.com/en-us/library/ee559331(office.14).aspx" target="_blank"&gt;SPWorkflowManager.StartWorkflow()&lt;/a&gt; method. This is the method we call to programmatically start our site workflow. One new parameter of this overloaded method which deserves a mention is the runOptions parameter, which expects a &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowrunoptions(office.14).aspx" target="_blank"&gt;SPWorkflowRunOptions&lt;/a&gt; enumerator. See &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowrunoptions(office.14).aspx" target="_blank"&gt;MSDN page&lt;/a&gt; for details. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Possible uses of the code&lt;/h4&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe that Site Workflows in SharePoint 2010 bring even more flexibility to an already powerful workflow infrastructure that the platform currently offers. There are many examples I can think of where one would use site workflows, but one specific one is on the top of my list. Say you have an application built on top of SharePoint 2010, which, when installed, adds whole bunch of custom lists, event handlers and workflows to the site. Now imagine if some of the major “events” or “states” of that application are implemented as site workflows created in SharePoint Designer 2010, which at any given point are started from event handlers or other custom code. Say that one such site workflow is run by the application when a document of a specific content type is checked in to the system by a user in a specific SharePoint group. The default site workflow is set to notify the content steward by email. If one of the SharePoint Designer 2010 savvy users wants to change that to create a whole review process or create a task or a list item in another list, they can. The point is,&amp;nbsp; Site Workflows can be used to add extensibility points to an application build on top of SharePoint, which require only SharePoint Designer power user to take advantage of.&amp;nbsp; In conclusion, I hope that this article will help someone out there build smarter solutions to common business problems on top of the upcoming&amp;nbsp; SharePoint release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample Code Download: &lt;a href="http://cid-3d1aa7b9ba4b05fd.skydrive.live.com/self.aspx/Public/SiteWorkflowStarter.zip" target="_blank" title="Site Workflow Starter"&gt;SiteWorkflowStarter.zip&lt;/a&gt;&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/8ewnygwujf8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/717861447683410761/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=717861447683410761" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/717861447683410761?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/717861447683410761?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/8ewnygwujf8/starting-sharepoint-2010-site-workflows.html" title="Starting SharePoint 2010 Site Workflows from code" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2009/12/starting-sharepoint-2010-site-workflows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEERnczcCp7ImA9WxNbFEQ.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-7835009822564420164</id><published>2009-11-17T15:46:00.002-06:00</published><updated>2009-11-17T15:50:07.988-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-17T15:50:07.988-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint" /><title>Useful SharePoint Designer Activities and SharePoint Designer 2010</title><content type="html">It did not come as a surprise that Microsoft has added functionality into SPD 2010 that some of the activities created as a part of &lt;a href="http://spdactivities.codeplex.com/" target="_blank"&gt;my open source project&lt;/a&gt; on CodePlex accomplished. At this year’s SharePoint Conference in Las Vegas I made it a point to go and check out some of the SPD 2010 sessions. I was pleasantly surprised by the new functionality that was added to SPD and you got to love the ribbon interface. On a sad note the most popular set of activities on the CodePlex project, the Permission Activities, are now available out of the box. There was a moment during one of the SPD 2010 demos when the guy said “and now we are going to set permissions on this item” I thought to myself “Oh, well, I’m just going to have to find another niche for the open source project”. From what I saw not all of the functionality provided by my project is in SPD 2010. For instance, “Start another workflow” is not part of the new functionality. Once I get my hands on a stable Beta of WSS and SPD 2010 I will create a roadmap for the still needed custom activities that may be implemented in the next version of the Useful SharePoint Designer Activities Project. Stay Tuned. &lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/vfyl_qxP7NA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/7835009822564420164/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=7835009822564420164" title="29 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/7835009822564420164?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/7835009822564420164?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/vfyl_qxP7NA/useful-sharepoint-designer-activities.html" title="Useful SharePoint Designer Activities and SharePoint Designer 2010" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>29</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2009/11/useful-sharepoint-designer-activities.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8CQ3k9fCp7ImA9WxNQFkg.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-3606292986572623735</id><published>2009-09-22T17:16:00.002-05:00</published><updated>2009-09-22T17:17:42.764-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-22T17:17:42.764-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint" /><title>SharePoint List Query performance gotcha</title><content type="html">As i recently discovered, there is BIG difference between calling SPList.GetItemById() and SPList.Items.GetItemById(). The latter causes all items to be loaded into memory and then filtered. This can cause severe performance issues for lists with large number of items.&lt;br /&gt;
Below is the code that takes 5 hours to run on a dual core box when run against a list with 5500 items.&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;SPList theList = GetList(); &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;List&amp;lt;&lt;span class="kwrd"&gt;int&lt;/span&gt;&amp;gt; itemIds = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;int&lt;/span&gt;&amp;gt;();  &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt;(SPListItem item &lt;span class="kwrd"&gt;in&lt;/span&gt; theList.Items)   &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{  &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt; itemIds.Add(item.ID);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;} &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt;(&lt;span class="kwrd"&gt;int&lt;/span&gt; itemId &lt;span class="kwrd"&gt;in&lt;/span&gt; itemIds)  &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;{ &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;  SPListItem theItem =  theList.&lt;strong&gt;&lt;span style="color: red;"&gt;Items&lt;/span&gt;&lt;/strong&gt;.GetItemById(itemId); &lt;span class="rem"&gt;//this will cause severe performance issues for large lists&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
To fix this issue we need to change the code in line 13 to:&lt;br /&gt;
&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;SPListItem theItem =  theList.GetItemById(itemId);&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Now the above code will run in minutes.&lt;br /&gt;
&lt;br /&gt;
I wish MSDN documentation on this topic was more clear. That would save me from putting in a couple of late nights at the office. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/xRf6I9cljNo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/3606292986572623735/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=3606292986572623735" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/3606292986572623735?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/3606292986572623735?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/xRf6I9cljNo/sharepoint-list-query-performance.html" title="SharePoint List Query performance gotcha" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2009/09/sharepoint-list-query-performance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0INRns-cCp7ImA9WB9VF08.&quot;"><id>tag:blogger.com,1999:blog-8755729291410145887.post-6598878433851269204</id><published>2007-12-03T16:08:00.000-06:00</published><updated>2007-12-03T17:46:37.558-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-12-03T17:46:37.558-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="reflection" /><category scheme="http://www.blogger.com/atom/ns#" term="api" /><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint" /><title>Disable event firing in SharePoint when updating a list item outside of an event handler</title><content type="html">&lt;p&gt;&lt;span style="font-family:arial;"&gt;As you probably know, when developing Event Handlers for SharePoint you have the option turning off event firing. This functionality is exposed through &lt;/span&gt;&lt;a onmousedown="return clk(this.href,'','','res','1','&amp;amp;sig2=gixItCmXO1p_k-UeaKW1ig')" href="http://msdn2.microsoft.com/en-US/library/microsoft.sharepoint.speventreceiverbase.disableeventfiring.aspx"&gt;&lt;span style="font-family:arial;"&gt;SPEventReceiverBase.DisableEventFiring() Method &lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. This is very useful when you are updating the item from within the event handler and do not want an infinite loop to occur. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;During my last project i discovered that you cannot disable event firing from code that is not part of an event handler, because DisableEventFiring() is an internal instance method. Still, i was determined to find a solution. So i whipped out &lt;/span&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;&lt;span style="font-family:arial;"&gt;Reflector&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; and started investigating. Upon disassembling Microsoft.Sharepoint.dll, I discovered that the above mentioned method actually sets a static, thread-specific, property of SPEventManager class called EventFiringDisabled. SPEventManager class is responsible for instantiating event handlers and delivering events to them. Because this class is marked "internal", it is not intended for use by SharePoint API consumers . But what is a good solution without some HACKS? :) I used reflection to set EventFiringDisabled property.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Below, you will find my solution neatly wrapped in a class. Please use at your own risk.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;&lt;span style="color:black;"&gt;System&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;using &lt;/span&gt;&lt;span style="color:black;"&gt;System.Collections.Generic&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;using &lt;/span&gt;&lt;span style="color:black;"&gt;System.Text&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;using &lt;/span&gt;&lt;span style="color:black;"&gt;System.Reflection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;using &lt;/span&gt;&lt;span style="color:black;"&gt;Microsoft.SharePoint&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;br /&gt;/// provides access to the internal Microsoft.SharePoint.SPEventManager class by using reflection&lt;br /&gt;&lt;br /&gt;/// sample usage:&lt;br /&gt;&lt;br /&gt;/// SPEventManagerWrapper.DisableEventFiring();&lt;br /&gt;&lt;br /&gt;/// SPList myList = SPContext.Current.Web.Lists["Shared Documents"];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;/div&gt;&lt;div class="code"&gt; &lt;/div&gt;&lt;div class="code"&gt;/// myList.Items[0].Update();&lt;br /&gt;&lt;br /&gt;/// SPEventManagerWrapper.EnableEventFiring();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public static class &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;SPEventManagerWrapper&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private static readonly string &lt;/span&gt;&lt;span style="color:black;"&gt;_className &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:#808080;"&gt;"Microsoft.SharePoint.SPEventManager"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;private static readonly string &lt;/span&gt;&lt;span style="color:black;"&gt;_eventFiringSwitchName &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:#808080;"&gt;"EventFiringDisabled"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;private static &lt;/span&gt;&lt;span style="color:black;"&gt;Type _eventManagerType&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;br /&gt;&lt;br /&gt;/// gets the status of event firing on the current thread&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public static bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;EventFiringDisabled&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;get &lt;/span&gt;&lt;span style="color:black;"&gt;{ &lt;/span&gt;&lt;span style="color:blue;"&gt;return &lt;/span&gt;&lt;span style="color:black;"&gt;GetEventFiringSwitchValue()&lt;/span&gt;&lt;span style="color:blue;"&gt;; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private static &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:black;"&gt;Type EventManagerType&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;get&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;&lt;span style="color:black;"&gt;(_eventManagerType &lt;/span&gt;&lt;span style="color:blue;"&gt;== null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:black;"&gt;)&lt;br /&gt;&lt;br /&gt;GetEventManagerType()&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;return &lt;/span&gt;&lt;span style="color:black;"&gt;_eventManagerType&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;br /&gt;&lt;br /&gt;/// enables event firing on the current thread&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public static void &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;EnableEventFiring()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;SetEventFiringSwitch(&lt;/span&gt;&lt;span style="color:blue;"&gt;false&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;br /&gt;/// disables sharepoint event firing on the current thread&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;public static void &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;DisableEventFiring()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;SetEventFiringSwitch(&lt;/span&gt;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:darkgreen;"&gt;&lt;br /&gt;&lt;br /&gt;/// sets the event firing switch on Microsoft.SharePoint.SPEventManager class using reflection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private static void &lt;/span&gt;&lt;span style="color:black;"&gt;SetEventFiringSwitch(&lt;/span&gt;&lt;span style="color:blue;"&gt;bool value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;PropertyInfo pi &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:black;"&gt;EventManagerType.GetProperty(_eventFiringSwitchName, System.Reflection.BindingFlags.Static System.Reflection.BindingFlags.NonPublic)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;pi.SetValue(&lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt;, &lt;/span&gt;&lt;span style="color:blue;"&gt;value&lt;/span&gt;&lt;span style="color:black;"&gt;, &lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private static bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;GetEventFiringSwitchValue()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;PropertyInfo pi &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:black;"&gt;EventManagerType.GetProperty(_eventFiringSwitchName, System.Reflection.BindingFlags.Static System.Reflection.BindingFlags.NonPublic)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;object &lt;/span&gt;&lt;span style="color:black;"&gt;val &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:black;"&gt;pi.GetValue(&lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt;, &lt;/span&gt;&lt;span style="color:blue;"&gt;null&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;return &lt;/span&gt;&lt;span style="color:black;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;bool&lt;/span&gt;&lt;span style="color:black;"&gt;)val&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private static &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;Type GetEventManagerType()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;_eventManagerType &lt;/span&gt;&lt;span style="color:blue;"&gt;= typeof&lt;/span&gt;&lt;span style="color:black;"&gt;(SPList).Assembly.GetType(_className, &lt;/span&gt;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&lt;span style="color:black;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;return &lt;/span&gt;&lt;span style="color:black;"&gt;_eventManagerType&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:78%;color:blue;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:black;"&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulKotlyarsnetAdventures/~4/axrVa7d04zY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://unclepaul84.blogspot.com/feeds/6598878433851269204/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=8755729291410145887&amp;postID=6598878433851269204" title="16 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/6598878433851269204?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8755729291410145887/posts/default/6598878433851269204?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PaulKotlyarsnetAdventures/~3/axrVa7d04zY/disable-event-firing-in-sharepoint-when.html" title="Disable event firing in SharePoint when updating a list item outside of an event handler" /><author><name>Paul Kotlyar</name><uri>http://www.blogger.com/profile/04195795078140552910</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>16</thr:total><feedburner:origLink>http://unclepaul84.blogspot.com/2007/12/disable-event-firing-in-sharepoint-when.html</feedburner:origLink></entry></feed>
