<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6120627810176387630</id><updated>2011-11-02T08:15:41.508-07:00</updated><category term='C#'/><category term='Windows Live'/><category term='Microsoft'/><category term='XtraEditors'/><category term='Home'/><category term='DevExpress'/><category term='Entity Framework'/><category term='Programming'/><category term='Politics'/><category term='General Rants'/><title type='text'>Trevor Unlocked</title><subtitle type='html'>This is where I unleash whatever thoughts pressure their way into my brain to the point that I am compelled to make a permanent record.
&lt;p&gt; *Disclaimer - Not all shared thoughts are released with proper and clear consideration and I may find myself objectionable after posting, let alone what others may happen to feel. &lt;br&gt;&lt;/br&gt; Therefore, if anything I write somehow offends... please - close your browser!&lt;/P&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-8094283273166464313</id><published>2009-03-01T03:42:00.001-08:00</published><updated>2009-03-01T03:42:39.493-08:00</updated><title type='text'>Livescribe and Accounting</title><content type='html'>&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ispCtfQaHRs/Sap0oqomFVI/AAAAAAAAAV8/PlTP4Jf9BLY/s1600-h/BigPromoImage_02%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 0px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BigPromoImage_02" border="0" alt="BigPromoImage_02" align="left" src="http://lh5.ggpht.com/_ispCtfQaHRs/Sap0pFFGr0I/AAAAAAAAAWA/qC_Le6FQgGI/BigPromoImage_02_thumb%5B2%5D.jpg?imgmax=800" width="103" height="73" /&gt;&lt;/a&gt;I purchased a new Livescribe pulse pen and… well.. it ROCKS!&lt;/p&gt;  &lt;p&gt;I am currently attending PSU (Portland State University) and, as most college students will know, not only is it difficult to take notes at the speed in which some professors may speak, it is nearly impossible to recall everything they have said… until now…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_ispCtfQaHRs/Sap0puJhiBI/AAAAAAAAAWE/6BNwLP4c-Uw/s1600-h/livescribepen2.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="livescribepen2" border="0" alt="livescribepen2" src="http://lh5.ggpht.com/_ispCtfQaHRs/Sap0qTxNOcI/AAAAAAAAAWI/gOzlTRpWaWk/livescribepen2_thumb.jpg?imgmax=800" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Livescribe pen is amazing. It records audio (yes, the pen itself) that really captures the sound from an entire room very well. Of course, the more personal the scenario and the less ambient noise the better, but this pen works very well in a classroom. If it only recorded audio, this pen would be amazing, but it records what you write as the audio (sounds) happen. After recording, you can upload the sound and notes to your PC. Once loaded, you can watch or observe every pen stroke as the original audio plays. Even further, the software uses OCR (optical character recognition) technology and you can search through the handwritten notes which are now loaded on the PC. You can take the original note book and just touch a spot on the notebook and the sound plays that matches that exact moment in time. In addition, you can touch a spot in the already written notes (where you couldn’t possibly keep up with an instructor) and re-listen to the speech… here is the cool part… you can add additional notes that are synchronized to the audio. Not only that, you can upload the result to the web and share it with others (privately or publicly).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is my very first class and my first day using the pen:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.livescribe.com/cgi-bin/WebObjects/LDApp.woa/wa/MLSOverviewPage?sid=NxjZSxcW1zsl" href="http://www.livescribe.com/cgi-bin/WebObjects/LDApp.woa/wa/MLSOverviewPage?sid=NxjZSxcW1zsl"&gt;http://www.livescribe.com/cgi-bin/WebObjects/LDApp.woa/wa/MLSOverviewPage?sid=NxjZSxcW1zsl&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The beginning or first page is not the best example: the instructor was talking about the results of an exam and I was writing notes related to a transparency on the screen. I do think it shows off some usefulness for the pen.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Go to their web site: &lt;a href="http://www.livescribe.com"&gt;www.livescribe.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Watch the demos.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Get the darn thing!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ispCtfQaHRs/Sap0q_iqfZI/AAAAAAAAAWM/ggjDhWSq31g/s1600-h/image.php%5B2%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image.php" border="0" alt="image.php" src="http://lh4.ggpht.com/_ispCtfQaHRs/Sap0rWrMJxI/AAAAAAAAAWQ/lfgMzUjRUW4/image.php_thumb.jpg?imgmax=800" width="244" height="204" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-8094283273166464313?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/8094283273166464313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=8094283273166464313&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8094283273166464313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8094283273166464313'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2009/03/livescribe-and-accounting.html' title='Livescribe and Accounting'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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://lh5.ggpht.com/_ispCtfQaHRs/Sap0pFFGr0I/AAAAAAAAAWA/qC_Le6FQgGI/s72-c/BigPromoImage_02_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-505586163982525531</id><published>2009-02-06T01:34:00.001-08:00</published><updated>2009-02-07T13:59:18.563-08:00</updated><title type='text'>Understanding the Economy</title><content type='html'>&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ispCtfQaHRs/SYwEDVJul8I/AAAAAAAAAVk/0fV7HiDRKZY/s1600-h/image%5B12%5D.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" align="left" src="http://lh4.ggpht.com/_ispCtfQaHRs/SYwEDwhwLEI/AAAAAAAAAVo/2ClNjLiQza0/image_thumb%5B6%5D.png?imgmax=800" width="118" height="153" /&gt;&lt;/a&gt; We are in a recession. The housing market has faltered. The banking system is hoarding funds. Jobs are being lost.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;What can be done?&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Right now, it appears there are two choices: &lt;strong&gt;&lt;em&gt;lower taxes&lt;/em&gt;&lt;/strong&gt; or the &lt;strong&gt;&lt;em&gt;government steps-in and spends money.&lt;/em&gt;&lt;/strong&gt; Which is it? Let's explore... Ahhh... wait a minute... before we begin... whenever given any task, it is important to define the goal or objective: to understand how we define success. &lt;/p&gt;  &lt;p&gt;I suggest everyone go here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dictionary.com"&gt;www.dictionary.com&lt;/a&gt;&lt;a title="http://dictionary.reference.com/browse/economy" href="http://dictionary.reference.com/browse/economy"&gt;http://dictionary.reference.com/browse/economy&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Did you READ the definitions? Let me share some of them:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Economy: the prosperity or earnings of a place: &lt;em&gt;Further inflation would endanger the national economy seriously.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Economy: the efficient, sparing, or concise use of something: an economy of effort; an economy of movement. &lt;/li&gt;    &lt;li&gt;Economy: the management of the resources of a community, country, etc., esp. with a view to its productivity. &lt;/li&gt;    &lt;li&gt;Economy: thrifty management; frugality in the expenditure or consumption of money, materials, etc. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;What I don't see listed in the dictionary reference to the term economy is what I believe most people mean: the complex relationships intertwined in business and government interaction that either results in overall prosperity or overall depression. Let's be clear. Don't we all want the &amp;quot;&lt;strong&gt;&lt;em&gt;economy&lt;/em&gt;&lt;/strong&gt;&amp;quot; to mean that - overall - people are most able to be prosperous?&lt;/p&gt;  &lt;p&gt;I listened to President Obama as he he urged the Senate to pass the Stimulus Bill. Here are some of his comments:&lt;/p&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" align="left" src="http://lh5.ggpht.com/_ispCtfQaHRs/SYwED1TVODI/AAAAAAAAAVs/B2Nik48arg8/image_thumb%5B2%5D.png?imgmax=800" width="178" height="117" /&gt; &lt;/li&gt;      &lt;li&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;&lt;em&gt;&amp;quot;If nothing is done, this recession might linger for years.&amp;quot;&lt;/em&gt;&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;em&gt;&amp;quot;Our economy will lose 5 million more jobs.&amp;quot;&lt;/em&gt;&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;em&gt;&amp;quot;Unemployment will approach double digits.&amp;quot;&lt;/em&gt;&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;em&gt;&amp;quot;Our nation will sink deeper into a crisis that, at some point, we may not able to reverse.&amp;quot; &lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;em&gt;&amp;quot;That's why I feel such a sense of urgency about the recovery plan before Congress, the Action Americans Need.&amp;quot;&lt;/em&gt;&lt;/strong&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I ask you (the reader) to consider, &amp;quot;How many decisions are 'good' decisions, the 'right' decisions, when people are urged not to think, not to take time to give any issue proper considerations, and are asked simply to support the decision?&amp;quot;&lt;/p&gt;  &lt;p&gt;I have learned two very important rules over time and they apply everywhere:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Anyone who tries to solve a problem by simply &amp;quot;writing a check&amp;quot; is simply funding an idea with no direction. There is no guarantee of results, but there are very high odds that the money is NOT well spent. So, the rule is: Beware of anyone, anywhere, at anytime, who claims any problem will be resolved simply by &amp;quot;writing a check.&amp;quot; &lt;/li&gt;    &lt;li&gt;Panic is bad. Whether you arrive at an accident scene and lives are in danger, or whether you manage a business in a seemingly perilous position, or whether you are a government official facing a crisis... no matter what scenario, a poor approach involves panic. It is always better to be calm, collective, reserved, and to take the time to assess and evaluate in order to form a prudent and wise decision. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So before going deep into analysis, I have to say that I am disturbed. I am disturbed that we are &amp;quot;urged&amp;quot; to stop thinking and support a $900+ billion dollar bill (simply writing a check does not work). I am disturbed that nearly every definition of an economy involves frugality and the &amp;quot;wise&amp;quot; or efficient use of resources. Where did anyone get the idea that confiscating tomorrow's money today (from taxpayers) and spending it willy-nilly will result in a prosperous economy?&lt;/p&gt;  &lt;p&gt;Now, it is time to explain, to define why Obama's plan is destined to fail (it has zero chance to boost the economy).&lt;/p&gt;  &lt;p&gt;First, when Obama suggests that he is only spending $800 billion, he is understating the amount. The government is already spending more than they receive; they are in deficit spending now. In order to spend more money, they must borrow the money. It is like a consumer buying a car via a loan and telling you that it only costs $10,000. They neglect to include the interest. In the end, the car may cost $15,000+ after interest. $800 billion in spending today is simply going to cost much more... more like $1.2+ trillion!&lt;/p&gt;  &lt;p&gt;This is important. The government &amp;quot;spending&amp;quot; option immediately involves added cost. &lt;/p&gt;  &lt;p&gt;If the government were operating at a surplus (they took in more than they spent), then there would not be added cost and they would be freeing capital. If businesses and individuals were hoarding money, if savings accounts were building, if - essentially - people were holding their money back in fear of a bad economy, then government spending might change the &amp;quot;psychology&amp;quot; of the market and induce people to free their capital to better the economy. However, this is not the case. &lt;/p&gt;  &lt;p&gt;Obama has repeatedly bashed former President Bush and has let everyone know, in no uncertain terms, that the economy faltered under Bush; therefore, all his policies were bad for the economy. In particular, Obama highlights George Bush's tax cuts. I ask, this:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;If you have a business and the government cuts your taxes, how does that cause your business to decline?&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;How does any single person buy that argument? It is complete nonsense! While it is true that the economy faltered under Bush, it is not due to tax cuts. So, what did happen? Perhaps, it is because government grew massively under Bush? How about the idea that tax rates mean nothing if government spends the money anyway? The only difference is that government essentially issued credit cards in the name of taxpayers to compensate for the lower tax rates.&amp;#160; How about the idea that government is supposed to ensure that business transactions and the overall business environment is safe, secure, and managed well. Instead, government actually ordered Fanny-Mae&amp;#160; and Freddie-Mac to give loans to those who could not afford loans. How about government getting rid of usury laws allowing credit cards companies to gouge consumers? How about &amp;quot;mandatory arbitration&amp;quot; clauses in contracts so consumers get screwed. How about government allowing executives to run banks to the ground and they fix the problem by handing them billions of our money?&lt;/p&gt;  &lt;p&gt;We are being taught that businesses are &amp;quot;evil&amp;quot;. We are taught to hate the &amp;quot;rich&amp;quot;. Let me ask this to test your business acumen, &amp;quot;If a corporation earns a profit, what does that mean to the owners or stockholders, or better yet what can the corporation do with the money?&amp;quot;&lt;/p&gt;  &lt;p&gt;The answer:&lt;/p&gt;  &lt;p&gt;A corporation can only do this with profits:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Buy property, plant, equipment or other items; they can &amp;quot;buy stuff&amp;quot; &lt;/li&gt;    &lt;li&gt;Give employees raises &lt;/li&gt;    &lt;li&gt;Hire new employees &lt;/li&gt;    &lt;li&gt;Invest the money (which just goes to another business) &lt;/li&gt;    &lt;li&gt;Pay dividends &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;That is it, but why is this important? Well, I ask people if Microsoft earned $100 million dollars, how much can Bill Gates spend for his personal use? The answer is ZERO!&lt;/p&gt;  &lt;p&gt;Microsoft would have to issue a dividend (a payment to stockholders)&amp;#160; or Bill Gates would have to sell shares of his stock. Dividends are TAXED! Wages are TAXED! Selling stock is TAXED!&lt;/p&gt;  &lt;p&gt;So, why is there a &amp;quot;corporate tax&amp;quot;? Think about it. A corporation can only buy stuff which drives the economy and adds jobs, or they can pay employees more, or they can hire employees, or they can invest which provides to other businesses and individuals. In other words, lowering the corporate tax (what Bush failed to do) can only drive the economy. If corporate taxes were lowered, it could have no other effect than boost the economy. &lt;/p&gt;  &lt;p&gt;So, why is Obama so against lowering corporate taxes? Why? Why? Why?&lt;/p&gt;  &lt;p&gt;It is simple. You KNOW the answer. It means the money goes STRAIGHT to businesses. It avoids government involvement. Obama wants POWER! If, instead of lowering corporate tax, they &amp;quot;spend&amp;quot; the money, what happens?&lt;/p&gt;  &lt;p&gt;The money goes to Obama, not business. Businesses then must line-up outside the White house door to beg for their share. Look at the Bank Bailout. What happened? Bank executives lined up and streamed inside to &amp;quot;beg&amp;quot; for some money. This is the real goal. It is not to feed the hungry, boost the economy, save the nation, or any other line that will convince you of his deepest support for your needs. Look at the Stimulus Bill. Read it!&lt;/p&gt;  &lt;p&gt;It pays off his political supporters. It does not get spent anytime soon. In other words, it is NOT a stimulus bill. It spends some now and most later. More importantly, it is simply PORK! LOTS OF PORK! Nearly ALL PORK! It is a PONZI scheme! In fact, what is the difference between Bernard Madoff and Barack Obama?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_ispCtfQaHRs/SYwEEagYyQI/AAAAAAAAAVw/90T6T-wWG4c/s1600-h/image%5B15%5D.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://lh4.ggpht.com/_ispCtfQaHRs/SYwEEq2BF8I/AAAAAAAAAV4/aOybEaMtJZM/image_thumb%5B7%5D.png?imgmax=800" width="182" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Bernard Madoff convinced people to give him money with the promise to make them money. He knew better. He knew he was scheming. He knew that what he really wanted was their money!&lt;/p&gt;  &lt;p&gt;Barack Obama is either a complete idiot, a moron, the dumbest individual on the planet, OR...&lt;/p&gt;  &lt;p&gt;Barack Obama knows he is feeding you rhetoric. He knows that he could &amp;quot;do the right thing&amp;quot; (I.e. lower corporate taxes and not spend unwisely), but that doesn't divert the money into his arena, his world... the world of forming special relationships and living the good life off of our tax payer money.&amp;#160; &lt;/p&gt;  &lt;p&gt;Bernard Madoff only ripped-off investors for $50 billion... if you support Obama and his Ponzi scheme, he is just beginning with $900+ billion.&lt;/p&gt;  &lt;p&gt;When is our country going to wake up? If you are a Barack supporter, when will you look at what he does and not what he says? If anything like the current bill passes, our economy will decline, we will have the Jimmy Carter era all over again, and, God Help Us, we may actually experience another depression. The only good from this may be that Americans wake up and stop accepting phony speeches and start demanding results, common sense, and someone with a history of success before voting them in as President.&lt;/p&gt;  &lt;p&gt;Are you still possibly a Barack supporter? Didn't you hear him during his election campaign? Didn't he say he would go &amp;quot;line-by-line&amp;quot; through the government budget to keep what is good and eliminate the bad? Are you one of those who watched the movie Dave and thought Barack would be the real-life equivalent? Do you still believe that?&lt;/p&gt;  &lt;p&gt;Hmmm?&lt;/p&gt;  &lt;p&gt;Answer this: Why is it that the &amp;quot;line-by-line&amp;quot; items in the &amp;quot;stimulus bill&amp;quot; are, hands down, the most egregious, offensive, and disgusting pile of stinking pork in the history of the United States that totals more than all stimulus bills ever signed combined? Add up all the stimulus bills from the depression, to the sixties, the seventies, and onwards. This single bill (adjusted for inflations) is MORE than all of them combined! It is not the dollar amount that is so bad, it is where they actually plan to spend the money. Hello? Is anybody awake out there?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;References:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://news.xinhuanet.com/english/2009-02/06/content_10770840.htm" href="http://news.xinhuanet.com/english/2009-02/06/content_10770840.htm"&gt;http://news.xinhuanet.com/english/2009-02/06/content_10770840.htm&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-505586163982525531?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/505586163982525531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=505586163982525531&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/505586163982525531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/505586163982525531'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2009/02/understanding-economy.html' title='Understanding the Economy'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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://lh4.ggpht.com/_ispCtfQaHRs/SYwEDwhwLEI/AAAAAAAAAVo/2ClNjLiQza0/s72-c/image_thumb%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-4186840145117045065</id><published>2009-01-19T02:04:00.001-08:00</published><updated>2009-01-19T02:16:17.985-08:00</updated><title type='text'>The Economy: What will fix it?</title><content type='html'>&lt;p&gt;There are certain moments in life when a person realizes that their ideas remain solely in their thoughts; within their own mind; there is no record. I, like many others, often listen to the news and have some expectation that 'expert opinion' or competent views are the ideas expressed widely by news organizations. This blog is an effort to cement a moment in time with my own personal opinion. It is an effort to forecast the U.S. economy based on personal opinion and simultaneously create a record to validate or invalidate my opinions.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ispCtfQaHRs/SXRQJDzmjGI/AAAAAAAAAVU/ZSXxsKZHExU/s1600-h/george-bush2%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="George Bush and italian Romano Prodi meeting" align="left" src="http://lh6.ggpht.com/_ispCtfQaHRs/SXRQJaN0hAI/AAAAAAAAAVY/jd8p4RgiYHk/george-bush2_thumb%5B2%5D.jpg?imgmax=800" width="106" height="113" /&gt;&lt;/a&gt; This moment is an end of an era: the George W. Bush era. I meet few people that are happy with George W. Bush - overall. This blog focuses on one aspect of his Presidency: the economy! First, there is no question that the economy at the end of George Bush's Presidency is not good. However, there are important questions: What happened? What went wrong? What will fix the economy?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Perhaps you are one of those who heard, &amp;quot;George Bush was President the last eight years. The economy is bad under George Bush. George Bush supported &amp;quot;trickle-down&amp;quot; economics. George Bush supported reductions in capital gains taxes; therefore, reductions in capital gains taxes are bad for the economy!&amp;quot;&lt;/p&gt;  &lt;p&gt;Is this true? Shouldn't we ban any reduction in capital gains taxes? After all, these tax reductions must have benefited the rich and made the poor more poor, correct? Before answering these questions, let's consider some basic concepts in any beginning-level philosophy class. Let's consider some fallacies of reason. Let's assume that &amp;quot;All ducks are white.&amp;quot; The point is not whether all ducks really are white, the point is to understand logic and reasoning. So, if I say, &amp;quot;All ducks are white. Harold is a duck; therefore, Harold is white.&amp;quot; Is the the logic sound? I submit that the logic is sound. If, in fact, all ducks are white and Harold is a duck, it must be true that Harold is white. Now, if I change the statement to: &amp;quot;All ducks are white. Harold is white; therefore, Harold is a duck.&amp;quot; Is that logic sound? I submit that it is not. While all ducks are white, it is not true that all things white are ducks. It is important to note that sound reasoning must be understood and employed or there is no point in analysis. The point is to identify fallacies of reason, to look for truth not rhetoric. &lt;/p&gt;  &lt;p&gt;So, George W. Bush supported reductions in capital gains taxes and while he was President the economy went south: the economy has entered into a severe recession. I ask this, &amp;quot;How does reducing taxes, in any form, cause an economy to decline?&amp;quot; There is only one major argument to support such a statement. The argument must be that government failed to collect taxes AND that those taxes would have been spent in support of the private sector for necessary fundamental government functions such as roads, highways, or, importantly, an overall oversight of the market such that the market is allowed to function freely. Is that what happened? The U.S.&amp;#160; had insufficient infrastructure? There were too few resources for police, law enforcement, and those that are part of the legal system? I submit that the U.S. had ample resources and ample infrastructure. While there are substantial arguments for improvement, I don't believe there was such a massive reduction in government resources that the economy had to to decline into a recession.&lt;/p&gt;  &lt;p&gt;Now I have to ask, &amp;quot;Does every reader even understand what is a capital gain?&amp;quot; It is a simple concept but many simply do not know. A capital gain is the result of a purchase and sale. If some property is purchased (whether it be stocks, a building, or whatever) there must be a resulting sale where the sale price is greater than the purchase price. If this happens, there is a capital gain. For example, if a building is purchased for $100,000 dollars and it is later sold for $120,000 dollars, there is a capital gain of $20,000 dollars. The U.S., generally, requires citizens to report these gains and pay taxes on these gains. I ask, &amp;quot;How is it possible that reducing taxes will cause the economy to decline?&amp;quot; Other than the government reason supplied above, it is NEVER possible!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ispCtfQaHRs/SXRQJltADgI/AAAAAAAAAVc/lYQugj1wPUE/s1600-h/barack_obama%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="barack_obama" align="left" src="http://lh4.ggpht.com/_ispCtfQaHRs/SXRQJ8TQdgI/AAAAAAAAAVg/d24jpfToY4o/barack_obama_thumb%5B2%5D.jpg?imgmax=800" width="139" height="105" /&gt;&lt;/a&gt; So, what really happened during the last eight years? This is the &amp;quot;meat&amp;quot; of what I want to have on record. Further, I want to have on record my predictions for the current proposals by the incoming administration, the Barack Obama Administration. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My view of what happened:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Both state and federal governments have substantially increased deficit spending: they spend more than they collect. When governments spend more than they collect, they essentially issue credit cards against those who pay taxes. Currently, there is about 303 million citizens in the United States. The recent &amp;quot;bailout bill&amp;quot; cost $700 billion dollars. If we divide $700 billion by 300 million citizens we get approximately $2,310 per citizen. However, 40% of American citizens do not pay tax. They do not contribute their income to address such deficits. In my opinion, it is incorrect to include those who are not liable for the debt; therefore, we need to divide by approximately 182 million people who are liable. The result is $3,850 per tax-paying citizen. The current total deficit (before the bailout) is about $10 trillion dollars! Each tax paying citizen (before bailout) is liable for ~$55,005 dollars in debt. This burden is dominating the private sector (business) and driving the economy down - period. &lt;/li&gt;    &lt;li&gt;Federal and state laws have increased the cost of business by continually adding the burden of increased laws and regulations. For example, building construction requires permits and inspections. Right here in the state of Oregon, we have inspectors to verify the proper installation of various structural components. Businesses must submit proposals, pay fees, and wait for inspections. Isn't it interesting that the building inspectors failed to catch severe flaws in their own building? Water pipes burst and flooded the building - after their inspection. What is important is that, for all the costs and delays, statistically, there are the same number of flaws in construction as there are without inspections. What are these inspections for? It might be understandable, or acceptable, if these added costs resulted in structures with substantially reduced failures and increased safety. That is not the case; we just pay more and wait longer for the same result. &lt;/li&gt;    &lt;li&gt;The Abandonment of Usury laws. If you look at the one possible reason that reducing taxes could possibly cause the economy to fail. Usury laws would be part of that reason. Isn't it interesting that there has been a trend for citizens to pay increasingly higher interest rates and penalties to maintain their debt? Increased taxes did not result in better oversight, it resulted in the opposite: worse oversight. Credit cards now have interest rates as high as 39%, so do credit lines and many other forms of debt. Our government has taken increased tax revenue but have failed to protect citizens. It is my submittion that failure for proper oversight is the underlying reason why homeowners are defaulting in higher percentages than ever before. Government is not short money, they are large in corruption. &lt;/li&gt;    &lt;li&gt;Failure to stomp out corruption - Yes, this is a broad topic, but it is simply too true. AOL had millions of customers requesting to end their payments; to stop their service and AOL simply kept billing them and refused to acknowledge customer requests to end service. AOL's actions were criminal and massively costly. Did the government react? Did they help? No! They allowed AOL to collect cash they did not earn. Further, this was one more stone cast on the average citizen that resulted in one more step closer to bankruptcy. AOL should have been forced to compensate every last customer who requested their service to end and instead had their bills extended. There is only one reason why AOL and other organizations get away with such scandalous behavior, they lobby politicians and buy their protection. The scandals in Chicago and California and New York and Connecticut, etc never cease. I live in Oregon. We need a new bridge. We have paid millions to &amp;quot;study&amp;quot; the &amp;quot;right&amp;quot; new bridge. The bridge that collapsed in Minnesota was replaced for approximately $280 million. The bridge we need is smaller. The current proposal: in excess of $4 billion dollars! Corruption is rampant in Oregon too. &lt;/li&gt;    &lt;li&gt;Credit Reporting Bureaus - as noted with AOL, many businesses simply lie; they report debt that they are not entitled to collect. I personally was billed by Direct TV after I canceled my service. I paid after I canceled by phone and could not prove that I canceled. However, after that experience, I wrote on my check, &amp;quot;Last payment, by accepting this check the bill is paid in full&amp;quot;. Direct TV canceled me and mysteriously reactivated me retroactively. I referred to my check, and they removed their claim... until they SOLD that claim to third-party collectors. To this day: I prove I canceled and paid and the phony debt resurfaces and ends up with a new collector (it has been removed and reactivated more than ten times for more than ten years). The process of removing bogus debt is atrocious. I worked as a loan officer for a brief time and read thousands of credit reports and worked with many people with similar issues. There is simply a hugely weighted scale in favor of anyone claiming a debt and almost nothing in place that actually works long-term to remove false claims. My opinion why? It is simple, bad credit reports allow every lender to charge higher rates. These lenders lobby politicians and get what they want. The result is a debt-laden society on the verge of a depression. &lt;/li&gt;    &lt;li&gt;Gambling - this is a no-brainier. Anyone who travels anywhere that gambling is legalized knows that the majority of those &amp;quot;playing&amp;quot; are those who don't make a lot of money and are those who can afford such habits least. It is simply predictable that a percentage of the population WILL gamble more than they can afford. Even those who gamble and still manage to still pay their bills. Of these, there is a percentage who have essentially kept themselves from growing their wealth. It was one thing to support casinos on reservations, in limited fashion, in order to provide a means for native Americans to add value to their land. That concept was destroyed when tribes were allowed to lease land and call it &amp;quot;reservation&amp;quot; land. Simply put: gambling destroys a significantly predictable percentage of the population. &lt;/li&gt;    &lt;li&gt;Okay - there are many more reasons, but you get the point. These type of problems MUST be corrected: the actual reasons that the economy has scaled back and began to decline. We don't need rhetoric and we should be scared of what could actually make things worse. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;My forecast:&lt;/p&gt;  &lt;p&gt;Barack Obama has suggested that massively increased government spending will solve the economic problems. He supports over a trillion dollars in increased deficit spending and simultaneously supports increased taxes. This is a recipe for disaster. The government cannot even account for the $350 billion dollars they recently spent in the bailout bill. I don't care if a person refers to a business or government. It is not likely that any major problem will be solved by simply writing checks and throwing money at the problem. Problems are solved by actually applying sound reasoning and judgment, by understanding fallacies of reason. &lt;/p&gt;  &lt;p&gt;Can anyone name what Barack Obama identified as the cause the economic problems during the Bush Administration?&amp;#160; I am positive that no person can because he never did. He always stuck to generalizations. He played a 'guilt-by-association' game of Bush was there, bad things happened, they are bad, I am good. We are for change. Change with me will be good. &lt;/p&gt;  &lt;p&gt;Hmmm? What did he say? How will things improve? Is he really 'good' (for the economy)?I am not saying he isn't, but I am saying that what little he has proposed seems to be a recipe for economic disaster. Increasing government spending, raising taxes, and finding more ways for government to be a burden via laws and regulations will never steer any economy into growth.&lt;/p&gt;  &lt;p&gt;I needed to have this on-the-record. I needed to be able to look back after Barack has been in office and compare my forecast from today with the actual results of tomorrow. &lt;/p&gt;  &lt;p&gt;It is my prediction that the economy will continue to decline until actual problems (like those I identified) are corrected. We need the government to cut-back, not expand. We need corporate tax cuts (different than capital gains cuts which don't provide significant incentives in declining economies; only in flat or growing). We need those who fail in business to be relieved of their jobs, not given bailout money. &lt;/p&gt;  &lt;p&gt;What would have happened if we gave over a trillion dollars to those businesses that succeeded rather than hand-out money to those who failed... to the sinking ships? &lt;/p&gt;  &lt;p&gt;The future (as proposed) does not seem hard to predict. I actually hope I am wrong, but I cannot map-out any logical scenario that leads to an improving economy when corruption continues to be brushed aside (in fact seems to be expanding), government is expanding, debt is increased, taxes are raised, and laws are increasingly more costly and burdensome. Help me understand, please, how can so many news organizations find so-called &amp;quot;experts&amp;quot; that actually believe the current proposals have any chance of success? We don't seem to have experts anymore. We have someone's pal, friend, or a supporter of some preconceived idea packaged as an expert. So, I am now on-the-record. Only the future will validate or invalidate the statements made.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-4186840145117045065?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/4186840145117045065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=4186840145117045065&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/4186840145117045065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/4186840145117045065'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2009/01/economy-what-will-fix-it.html' title='The Economy: What will fix it?'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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://lh6.ggpht.com/_ispCtfQaHRs/SXRQJaN0hAI/AAAAAAAAAVY/jd8p4RgiYHk/s72-c/george-bush2_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-724459641556962656</id><published>2007-12-07T19:28:00.001-08:00</published><updated>2007-12-07T19:29:08.014-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Namespace Alias Qualifier</title><content type='html'>&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3bae0b43-be95-4c01-9807-f4681c1feb0b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/C#" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Namespace" rel="tag"&gt;Namespace&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Alias" rel="tag"&gt;Alias&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Qualifier" rel="tag"&gt;Qualifier&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Global" rel="tag"&gt;Global&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Attribute" rel="tag"&gt;Attribute&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Auto-generator" rel="tag"&gt;Auto-generator&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Code%20Generator" rel="tag"&gt;Code Generator&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I have noticed a trend with code auto-generated from Microsoft tools. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is a sample section of code as I would have viewed it in older samples:&lt;/p&gt;  &lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;   &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;     &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;      &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;p&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 23&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Data.Objects.DataClasses.&lt;span style="color: #2b91af"&gt;EdmEntityTypeAttribute&lt;/span&gt;(NamespaceName = &lt;span style="color: #a31515"&gt;&amp;quot;PizzaModel&amp;quot;&lt;/span&gt;, Name = &lt;span style="color: #a31515"&gt;&amp;quot;PizzaOrder&amp;quot;&lt;/span&gt;)]&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 24&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.Runtime.Serialization.&lt;span style="color: #2b91af"&gt;DataContractAttribute&lt;/span&gt;()]&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 25&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [System.&lt;span style="color: #2b91af"&gt;Serializable&lt;/span&gt;()]&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 26&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;partial&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PizzaOrder&lt;/span&gt; : System.Data.Objects.DataClasses.&lt;span style="color: #2b91af"&gt;EntityObject&lt;/span&gt; {&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This is the exact same code, except it includes the more recent changes that I happened to notice:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 23&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: blue"&gt;global&lt;/span&gt;::System.Data.Objects.DataClasses.&lt;span style="color: #2b91af"&gt;EdmEntityTypeAttribute&lt;/span&gt;(NamespaceName = &lt;span style="color: #a31515"&gt;&amp;quot;PizzaModel&amp;quot;&lt;/span&gt;, Name = &lt;span style="color: #a31515"&gt;&amp;quot;PizzaOrder&amp;quot;&lt;/span&gt;)]&lt;/p&gt;

    &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 24&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: blue"&gt;global&lt;/span&gt;::System.Runtime.Serialization.&lt;span style="color: #2b91af"&gt;DataContractAttribute&lt;/span&gt;()]&lt;/p&gt;

    &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 25&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: blue"&gt;global&lt;/span&gt;::System.&lt;span style="color: #2b91af"&gt;Serializable&lt;/span&gt;()]&lt;/p&gt;

    &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 26&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;partial&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PizzaOrder&lt;/span&gt; : &lt;span style="color: blue"&gt;global&lt;/span&gt;::System.Data.Objects.DataClasses.&lt;span style="color: #2b91af"&gt;EntityObject&lt;/span&gt; {&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Notice the reference to 'global::'? Apparently, Visual Studio and ultimately the compiler can potentially be confused.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Here is a link to the Namespace Alias Qualifier:&lt;/p&gt;

&lt;p&gt;&lt;a title="http://msdn2.microsoft.com/en-us/library/c3ay4x3d(VS.80).aspx" href="http://msdn2.microsoft.com/en-us/library/c3ay4x3d(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/c3ay4x3d(VS.80).aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;According to that sample, you may have a namespace TestApp and within that TestApp namespace have a constant named Console within a class named System. The example also shows a using statement referencing the namespace System. That combination is apparently deadly to the compiler and even though Console.WriteLine() exists within the System namespace; it cannot be referenced because it conflicts with the Console constant. Here is the &amp;quot;non-working&amp;quot; code:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;&amp;#160;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;

      &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// yada yada ...&lt;/span&gt;&lt;/p&gt;

      &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&lt;span style="color: green"&gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160;&amp;#160; 8&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;TestApp&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160;&amp;#160; 9&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Define a new class called 'System' to cause problems.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 10&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt; { }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 11&lt;/span&gt;&amp;#160;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 12&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Define a constant called 'Console' to cause more problems.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 13&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; Console = 7;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 14&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; number = 66;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 15&lt;/span&gt;&amp;#160;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 16&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 17&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Error&amp;#160; Accesses TestApp.Console&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 18&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;//Console.WriteLine(number);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 19&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;&amp;#160;&amp;#160; 20&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To the rescue: We have the 'global::' namespace qualifier available which forces a namespace comparison to be&amp;#160; based on the entire namespace starting from the root. I can only assume that namespace collisions (at least for Microsoft) happen more often than we assume; especially, when code generators are involved. &lt;/p&gt;

&lt;p&gt;It is one thing to create and compile code within Visual Studio, but its entirely different if you are creating/ managing a code generator where you can never be sure of namespace conflicts. I happen to use CodeDOM (&lt;a title="http://msdn2.microsoft.com/en-us/library/y2k85ax6.aspx" href="http://msdn2.microsoft.com/en-us/library/y2k85ax6.aspx"&gt;http://msdn2.microsoft.com/en-us/library/y2k85ax6.aspx&lt;/a&gt;) and understand completely how this could benefit my auto-generated code.&lt;/p&gt;

&lt;p&gt;If you auto-generate code, it may be wise to to include a global reference similar to the new trend I am noticing. If you do not, this post may be helpful to simply understand the global reference.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;
&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-724459641556962656?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/724459641556962656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=724459641556962656&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/724459641556962656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/724459641556962656'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/12/namespace-alias-qualifier.html' title='Namespace Alias Qualifier'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-3593445603060525999</id><published>2007-12-07T15:51:00.001-08:00</published><updated>2007-12-07T15:51:45.895-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework'/><title type='text'>Entity Framework Model Designer</title><content type='html'>&lt;p&gt;I am just making a post to my BLOG here so that I can share an issue with the layout algorithm of the model designer with users in the Microsoft forum. Essentially I am showing the the automatic layout function could be improved (IMO).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here are two images of the designer after choosing 'Layout Diagram' in the model editor. The model is the AdventureWorks database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/TrevorWesterdahl/R1ncjjYZfdI/AAAAAAAAAI4/h9QO7KLjOW4/EntityModel-1%5B5%5D" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="404" alt="EntityModel-1" src="http://lh6.google.com/TrevorWesterdahl/R1ncjzYZfeI/AAAAAAAAAJA/9YfbfFXfoOQ/EntityModel-1_thumb%5B3%5D" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/TrevorWesterdahl/R1nckDYZffI/AAAAAAAAAJI/fYFwmqZHXOY/EntityModel-2%5B4%5D" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="404" alt="EntityModel-2" src="http://lh4.google.com/TrevorWesterdahl/R1nckTYZfgI/AAAAAAAAAJQ/1AHHcKdzlBc/EntityModel-2_thumb%5B2%5D" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:021ea9b8-a4cf-44e8-bb6b-b124904b1b0b" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/C#" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Database" rel="tag"&gt;Database&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Entity%20Framework" rel="tag"&gt;Entity Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ORM" rel="tag"&gt;ORM&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The top image shows how text is overlapped and the diagrams are crammed together. The bottom image shows the entire layout where the algorithm clearly fails to use width appropriately.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-3593445603060525999?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/3593445603060525999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=3593445603060525999&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3593445603060525999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3593445603060525999'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/12/entity-framework-model-designer.html' title='Entity Framework Model Designer'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-8314570180436069052</id><published>2007-12-05T14:18:00.001-08:00</published><updated>2007-12-05T14:28:05.536-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General Rants'/><title type='text'>eBay - Worse than SPAM?</title><content type='html'>&lt;p&gt;I happened to be checking on current prices for the Nintendo Wii game console and browsed the listings on eBay. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here are a couple of screen shots showing the search results:&lt;/p&gt;  &lt;p&gt;This is of the &amp;quot;featured items&amp;quot;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/TrevorWesterdahl/R1cjzDYZfXI/AAAAAAAAAII/U1VPqCcNR1s/Wii-1%5B4%5D"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="545" alt="Wii-1" src="http://lh6.google.com/TrevorWesterdahl/R1cjzTYZfYI/AAAAAAAAAIQ/h20XsZzfLOw/Wii-1_thumb%5B2%5D" width="757" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;... and this one is from &amp;quot;Highest to Lowest&amp;quot; pricing:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/TrevorWesterdahl/R1cjzjYZfZI/AAAAAAAAAIY/fqmqVTBULf8/Wii-2%5B4%5D"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="562" alt="Wii-2" src="http://lh5.google.com/TrevorWesterdahl/R1cj0DYZfaI/AAAAAAAAAIg/PqwcSWkt_1Y/Wii-2_thumb%5B2%5D" width="775" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;WOW!! the pricing of &amp;quot;featured items&amp;quot; ranged from ~$1,700 to $20,000 US. In the regular listings, the highest priced Nintendo Wii was listed at $5 million!!!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I suppose we all wish that we could list an item and receive far more than its worth (like millions more and simply retire). Surely we can all expect, out of the &amp;quot;goodness&amp;quot; of someone's heart, such outrageous purchase prices - but - seriously - this is making eBay the equivalent of a rotten Email program that not only doesn't block any SPAM; it supports and promotes the creation of SPAM. Ebay's listings are simply becoming inundated with more and more garbage and finding valid items within this slue of garbage is becoming ever more problematic.&lt;/p&gt;  &lt;p&gt;From my view, it is becoming so hard to sift through search results that eBay is becoming a joke. I am not sure what can be done - maybe a rule that forbids pricing above suggested retail without some truly valuable and tangible asset being added to the item? Maybe separating these baloney listings into a separate category?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Is eBay becoming too cluttered with such garbage for you as well? What are your ideas or suggestions for eBay?&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6c31ff98-f65c-43f1-a009-6889f98ffc25" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/eBay" rel="tag"&gt;eBay&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Garbage" rel="tag"&gt;Garbage&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Listings" rel="tag"&gt;Listings&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-8314570180436069052?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/8314570180436069052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=8314570180436069052&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8314570180436069052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8314570180436069052'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/12/ebay-worse-than-spam.html' title='eBay - Worse than SPAM?'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-3489069693204264289</id><published>2007-10-26T00:19:00.001-07:00</published><updated>2007-10-26T00:19:31.698-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General Rants'/><title type='text'>Holiday Spirit: Site Changes</title><content type='html'>&lt;p&gt;I just thought I would get in the holiday spirit and modify some of the look &amp;amp; feel of the site to align with the holidays. My first change is a nice Halloween pumpkin for an image.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/TrevorWesterdahl/RyGVAVagGgI/AAAAAAAAAHo/GSARjcMq0Lc/pumpkin_128%5B2%5D.png"&gt;&lt;img id="id" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="132" alt="pumpkin_128" src="http://lh3.google.com/TrevorWesterdahl/RyGVAVagGhI/AAAAAAAAAHw/lRw8LRiD_9o/pumpkin_128_thumb.png" width="132" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; I will likely experiment with some other changes as the holiday season progresses. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.google.com/TrevorWesterdahl/RyGVAlagGiI/AAAAAAAAAH4/qpJsLZNHWJQ/scream_128%5B2%5D.png"&gt;&lt;img id="id" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="132" alt="scream_128" src="http://lh5.google.com/TrevorWesterdahl/RyGVA1agGjI/AAAAAAAAAIA/bMLKGr5bPc0/scream_128_thumb.png" width="132" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-3489069693204264289?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/3489069693204264289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=3489069693204264289&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3489069693204264289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3489069693204264289'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/holiday-spirit-site-changes.html' title='Holiday Spirit: Site Changes'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-3423201928704397766</id><published>2007-10-21T23:00:00.001-07:00</published><updated>2007-10-21T23:32:27.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='DevExpress'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Feedback: DevExpress Layout Control Main Demo</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4870fa2d-3c72-4cc6-a356-feaca5abdd78" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/C#/" rel="tag"&gt;C#&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Programming/" rel="tag"&gt;Programming&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/DevExpress/" rel="tag"&gt;DevExpress&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Developer%20Express/" rel="tag"&gt;Developer Express&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Layout%20Control/" rel="tag"&gt;Layout Control&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Feedback/" rel="tag"&gt;Feedback&lt;/a&gt; 		&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Here is a screen shot of the &lt;a title="Developer Express" href="http://www.devexpress.com/" target="_blank"&gt;Developer Express&lt;/a&gt; Layout Control Main Demo:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.google.com/TrevorWesterdahl/Rxw_SFtHkLI/AAAAAAAAAG0/lspoTwcJ_g0/Demo1%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="454" alt="Demo1" src="http://lh3.google.com/TrevorWesterdahl/Rxw8a1tHkCI/AAAAAAAAAG8/l0GrAhX3fUI/Demo1_thumb%5B2%5D.jpg" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;If I click a feature, such as Validating, I get a screen shot similar to this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/TrevorWesterdahl/Rxw8bVtHkDI/AAAAAAAAAHA/9NfW8TDIcrM/Demo2%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="454" alt="Demo2" src="http://lh6.google.com/TrevorWesterdahl/Rxw8bltHkEI/AAAAAAAAAHE/1J51t2aKB3w/Demo2_thumb%5B2%5D.jpg" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Its a nice demo - I want to learn from it, and so I open the source code for the demo that is included with my subscription where I see something in VS2005 similar to this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/TrevorWesterdahl/Rxw8b1tHkFI/AAAAAAAAAHI/lX51pf8q1R8/VS20051%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="444" alt="VS20051" src="http://lh4.google.com/TrevorWesterdahl/Rxw8cFtHkGI/AAAAAAAAAHM/cbuS5ZD89oQ/VS20051_thumb%5B2%5D.jpg" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Hmm... there are a LOT of custom User Controls and I start looking/ learning (as I suspect most users may) by looking at the main form (frmMain) and attempt to &amp;quot;go backwards&amp;quot; through the code. Here is the code behind frmMain.cs:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.google.com/TrevorWesterdahl/Rxw8cltHkHI/AAAAAAAAAHQ/ljwKNz8KkaA/VS20052%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="444" alt="VS20052" src="http://lh4.google.com/TrevorWesterdahl/Rxw8dFtHkII/AAAAAAAAAHU/WZSv3M3-h9k/VS20052_thumb%5B2%5D.jpg" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I highlighted where the form inherits from a base form &amp;quot;DevExpress.DXperience.Demos.frmMain&amp;quot;. Can you see it in the rectangle? Its a little frustrating to chase down code in a demo, but hey... okay... so I click on &amp;quot;Go to Definition&amp;quot; and this is what I get:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/TrevorWesterdahl/Rxw8dVtHkJI/AAAAAAAAAHY/y0nYba4cf-I/VS20053%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="444" alt="VS20053" src="http://lh3.google.com/TrevorWesterdahl/Rxw8d1tHkKI/AAAAAAAAAHc/UmEL6dYp86A/VS20053_thumb%5B2%5D.jpg" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;* This is my summary *&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;First (metatdata):&lt;/strong&gt; Notice... or... look carefully... the base or inherited class I chased down (the very first step I took to understand the demo code) is &amp;quot;FROM METADATA&amp;quot; and this is just &amp;quot;wrong&amp;quot; (IMO) - for any demo. Isn't a demo supposed to include the code? Inheriting from classes that are not included is not the best choice (IMO). I found numerous objects that inherit from classes that are not contained directly in the demo. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;DevExpress: Please, do NOT create a demo that utilizes custom controls or features that are hidden within your source code library! I am fairly certain that the base class &amp;quot;frmMain&amp;quot; is not a standard control for your library and I am also certain that this confuses users and does not help them. Why is this &amp;quot;frmMain&amp;quot; not part of the demo solution? I certainly can understand that some elements are common to many demo solutions, but they should simply be referenced as a separate &amp;quot;common&amp;quot;&amp;#xA0; project, should they not? The common projects should be included DIRECTLY in each demo solution.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Second (organization)&lt;/strong&gt;: I started &amp;quot;browsing&amp;quot; the code and looked at the &amp;quot;BaseControl&amp;quot; which inherits from some TutorialControl which is located in a file named DemoControls.cs; yet the BaseControl is not part of DemoControls, it is special and gets its own file.&amp;#xA0; However, for some reason the LayoutAppearanceMenu is also located in the DemoControls.cs file. What I am getting at is that there is&amp;#xA0; a very difficult to follow pattern for why certain classes are located within certain files. There really needs to be some organization and logic followed to make it easy to locate objects. A possible simple approach I might recommend would be a file for every class. Grouping classes into files without clear understanding of any reasoning for grouping them makes the code more difficult to understand. &lt;/p&gt;  &lt;p&gt;Why is the &amp;quot;TutorialControl&amp;quot; and the &amp;quot;LayoutAppearanceMenu&amp;quot; contained in DemoControls? I don't see the logical relationship here... maybe someone else does??? &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Third (Isolation):&lt;/strong&gt; These demos, obviously, offer many benefits. For example, I was trying to understand how to properly deal with Visual Inheritance and understand Visual Studio's problem with collection members in inherited or derived forms. To understand: if someone adds a DevExpress LayoutControl to a base user control or form and then tries to inherit or derive a form from that base, the LayoutControl would be unusable in the designer because Visual Studio does not support adding, removing, or changing collections via the designer in a derived form when the source collection is in a base class.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;So why am I mentioning isolation?&lt;/p&gt;  &lt;p&gt;Well, I suspect most users look at the choices within a Demo or the &amp;quot;Features&amp;quot; such as Validating, Localization, Image Layout , etc and they just want to understand that specific feature. This really screams or demands that code is NOT inherited. Most users (I suspect) want to see the all the code in one spot, where they can follow the logic, where they don't chase down inheritance, and where they don't get confused where pieces of the puzzle aren't even located within the demo. I suggest that each &amp;quot;feature&amp;quot; be self-contained and easy-to-follow. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;This post is not meant to be a complaint, it is meant to suggest what I feel is the perspective of the typical end-user - the one who actually needs and uses the various demos. I am trying to share the overall experience and I simply feel the experience could be improved. Ironically, there is no specific demo for visual inheritance - it is addressed in every demo. I consider Visual Inheritance, custom user controls, deep inheritance chains, etc. to be advanced examples. It just does not seem right to make every demo based on advanced functionality and I stand by my premise that no demo should be pieced together with significant custom code elements that are not included in the demo directly, such as the frmMain.cs file I highlighted.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-3423201928704397766?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/3423201928704397766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=3423201928704397766&amp;isPopup=true' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3423201928704397766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/3423201928704397766'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/feedback-devexpress-layout-control-main.html' title='Feedback: DevExpress Layout Control Main Demo'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-5374738437199941231</id><published>2007-10-19T16:47:00.001-07:00</published><updated>2007-10-19T17:22:23.164-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>DuckTyping - A Nice Tool to Keep in Your Bag of Tricks</title><content type='html'>&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:416c96e8-c324-4a19-9b5c-f8d0d4efe1e2" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/C#/" rel="tag"&gt;C#&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Programming/" rel="tag"&gt;Programming&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/DuckTyping/" rel="tag"&gt;DuckTyping&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Interface/" rel="tag"&gt;Interface&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Cast/" rel="tag"&gt;Cast&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Casting/" rel="tag"&gt;Casting&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Runtime/" rel="tag"&gt;Runtime&lt;/a&gt; 		&lt;/div&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I was recently working on a class designed to manage simple data entry within Windows forms. Essentially, the majority of data objects are always edited with the same business logic; the only difference is the actual properties of the data being edited. Before, I discuss how DuckTyping fits-in, its important to understand the situation:&lt;/p&gt;  &lt;p&gt;When I am designing, I perpetually seek to recognize repeated patterns. For example, while creating several data entry forms, it became obvious they all required something like the following:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.google.com/TrevorWesterdahl/RxlB_VtHj7I/AAAAAAAAAE0/1ot93xVElR4/DataEntryBar%5B4%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="59" alt="DataEntryBar" src="http://lh3.google.com/TrevorWesterdahl/RxlB_ltHj8I/AAAAAAAAAE8/f-4QLmSycNk/DataEntryBar_thumb%5B2%5D.jpg" width="384" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.google.com/TrevorWesterdahl/RxlB_1tHj9I/AAAAAAAAAFE/M5eYLA-PqGo/DataEntryBar2%5B3%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="60" alt="DataEntryBar2" src="http://lh5.google.com/TrevorWesterdahl/RxlCAFtHj-I/AAAAAAAAAFM/kJLg_fll5a0/DataEntryBar2_thumb%5B1%5D.jpg" width="383" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&amp;quot;Data entry bars&amp;quot; similar to these are located on every data entry form. I originally added each button manually to each form. Then I recognized a &amp;quot;pattern&amp;quot; and created a UserControl that contained all the buttons. However, I was still left with registering each of the respective click events for Add, Delete, edit, etc. for each respective form and then calling matching methods within my data manager. &lt;/p&gt;  &lt;p&gt;Again, I recognized a pattern and realized I wanted my data entry manager to auto-register the events for me and my next change resulted in defining an enumeration for pre-defined &amp;quot;button functions&amp;quot;. In other words, how would my data manager know that the Cancel button was actually for canceling? I had to assign something to each button to declare their purpose. &lt;/p&gt;  &lt;p&gt;Then... the next problem... I didn't just have bars such as the above, I also had drop-down menu support such as this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.google.com/TrevorWesterdahl/RxlCAVtHj_I/AAAAAAAAAFU/YEDfhuIWJ4o/DataEntryMenu%5B2%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="149" alt="DataEntryMenu" src="http://lh3.google.com/TrevorWesterdahl/RxlCAltHkAI/AAAAAAAAAFc/R1R9NVwxp58/DataEntryMenu_thumb.jpg" width="102" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Both could be &amp;quot;active&amp;quot; at the same time. Therefore, I chose not to add the bar or menu directly to the manager. I decided to have each control expose an IList&amp;lt;Button&amp;gt; containing all the buttons. Well, not exactly Button either. The control library I use utilizes different buttons for menu support than the buttons used in the tool bar. It meant their was no common interfaces or base class (one is not even derived from Control) between the different button options. I was getting a little frustrated with finding a way to get Visual Studio or C# to recognize that there is usable commonality between different objects.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I could create an interface and , in fact, I did, but some objects are contained in a third party library and I didn't necessarily have the option to implement the interface (either I had no access to the source code, or a class was sealed, or it was really just a pain). &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;In came DuckTyping to the rescue! I first experimented with DuckTyping after reading this article on the Code Project: &lt;a title="http://www.codeproject.com/cs/library/nduck.asp" href="http://www.codeproject.com/cs/library/nduck.asp"&gt;http://www.codeproject.com/cs/library/nduck.asp&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I use this DuckTyping library which does differ from above: &lt;a title="http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx" href="http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx"&gt;http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I use the latter library because it seems to be maintained/ upgraded while the version on the code project does not appear to be maintained.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;What does it do? Well, let's say I know that all the objects I need for my data manager require this interface:&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;   &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;     &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;      &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Implemented on objects that respond with standard Click event.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;interface&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;IStandardClick&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Occurs when the control is clicked.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;event&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt; Click;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;However, none of the objects actually implement that interface; although, I happen to know they do expose the correct Click event.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;With DuckTyping I now have an option to dynamically cast at runtime to the interface I need. Here is a sample:&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;IStandardClick&lt;/span&gt;&lt;span style="line-height: 1"&gt; clickableObject = &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;DuckTyping&lt;/span&gt;&lt;span style="line-height: 1"&gt;.Cast&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;IStandardClick&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;(myButton);&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;The &amp;quot;myButton&amp;quot; object does not actually implement IStandardClick, but it does contain the required members (the click event). In other words, with DuckTyping I can cast any object to any interface so long as the object actually does implement the required interface members. &lt;/p&gt;

&lt;p&gt;For me, DuckTyping is very cool and has an appropriate place in my bag of tricks. I suggest all C# developers download the library (&lt;a title="http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx" href="http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx"&gt;http://www.deftflux.net/blog/page/Duck-Typing-Project.aspx&lt;/a&gt;) and experiment, you may never know when such a tool will come in handy.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-5374738437199941231?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/5374738437199941231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=5374738437199941231&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/5374738437199941231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/5374738437199941231'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/ducktyping-nice-tool-to-keep-in-your.html' title='DuckTyping - A Nice Tool to Keep in Your Bag of Tricks'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-2235598340531047006</id><published>2007-10-05T14:52:00.001-07:00</published><updated>2007-10-05T14:56:04.952-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C#: Advanced Event Handling: Memory Optimization, Thread-safety, and Proper Disposal</title><content type='html'>&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:729e61d1-d966-42e4-b706-6bad0e8c4d28" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/Programming/" rel="tag"&gt;Programming&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/C#/" rel="tag"&gt;C#&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Events/" rel="tag"&gt;Events&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Thread%20Safe/" rel="tag"&gt;Thread Safe&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Disposal/" rel="tag"&gt;Disposal&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Memory%20Leaks/" rel="tag"&gt;Memory Leaks&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Delegate/" rel="tag"&gt;Delegate&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Best%20Practice/" rel="tag"&gt;Best Practice&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Advanced%20Event%20Handling/" rel="tag"&gt;Advanced Event Handling&lt;/a&gt; 		&lt;/div&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Recently I have been developing custom objects that expose numerous events and there were several issues I needed to address or consider:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;What are the 'Best Practices' for handling events? &lt;/li&gt;    &lt;li&gt;What happens to memory when there are a large number of events? &lt;/li&gt;    &lt;li&gt;If the object closes, what happens to any event delegates still registered if the listener did not unregister the events? Will the GC collect the disposed object? In other words, how do I properly dispose of all those events if they are still registered? &lt;/li&gt;    &lt;li&gt;Are my events thread-safe? &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Let's try to establish a 'Best Practice' by looking at typical event declarations:&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;   &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;     &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;      &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;/p&gt;

      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
        &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableClass&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; NonDisposableClass() {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;event&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; SomeEvent;&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;virtual&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; OnSomeEvent(&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; ea) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (SomeEvent != &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SomeEvent(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;, ea);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;p&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Here is a sample of a class (listener) registering with the event:&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableEventListener&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; NonDisposableEventListener() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; RegisterEvent();&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// A reference to the non disposable class exposing an event&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableClass&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_nonDisposableClass = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableClass&lt;/span&gt;&lt;span style="line-height: 1"&gt;();&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; RegisterEvent() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_nonDisposableClass.SomeEvent += &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;(m_nonDisposableClass_SomeEvent);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_nonDisposableClass_SomeEvent(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt; sender, &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; e) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// Do something when event occurs here...&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;These samples work with each other, but are they the 'Best Practice'? &lt;/p&gt;

&lt;p&gt;First, we need to understand that the C# keyword &lt;font color="#0000ff"&gt;event&lt;/font&gt; is special and allows this line of code in the &lt;font color="#408080"&gt;NonDisposableEventListener&lt;/font&gt; class to work:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_nonDisposableClass.SomeEvent += &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;(m_nonDisposableClass_SomeEvent);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Under the hood (or in the resulting IL), the C# compiler is creating a delegate with Add/Remove handlers that allow the += or -= operators to work. More than that and importantly... this style of event declaration has some serious potential for problems. Let's begin with a look at memory usage; here is a quote from this link : &lt;a title=".NET Matters" href="http://msdn.microsoft.com/msdnmag/issues/06/11/NETMatters/default.aspx"&gt;.NET Matters&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;quot;This hints at one of the primary reasons for writing your own add and remove accessors: to provide your own underlying data store. One reason you might want to do this [use EventHandlersList] is if you have lots of exposed events on your class, but in such a way that only a few are typically in use on an instance at any point in time. In such a scenario, there can be significant memory overhead associated with maintaining a delegate field for each event. Take the Windows&lt;sup&gt;&amp;#xAE;&lt;/sup&gt; Forms Control class as an example.&lt;/p&gt;

  &lt;p&gt;In the Microsoft .NET Framework 2.0, Control exposes 69 public events. If each of these events had an underlying delegate field, on a 32-bit system these events would add an overhead of 276 bytes per instance. Instead, Control (or, more specifically, its base class System.ComponentModel.Component) maintains a list of key/value pairs, where the value is a delegate. Every event on Control then has custom add and remove accessors that store the registered delegates for all events into this list, an instance of the System.ComponentModel.EventHandlersList class. &amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Huh? What is the issue? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MEMORY&lt;/strong&gt;: Well, what I believe the author is stating is that events declared in such a manner as the typical example I provided will cause the C# compiler to reserve memory for the event's delegate regardless of whether a listener has actually registered with the event. With numerous events, the available memory is reduced and can have a significant impact on performance when resources are tight. *I will address a solution after examining other issues.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISPOSING&lt;/strong&gt;: Next we should look at the example again and consider what happens when they are disposed (out of scope): in the example, there was no code added to specifically manage resources on disposal, but it was not necessary because the class broadcasting the events is created within the class receiving the events. There is an inherent mutual dependency and they coexist and are created and disposed together...&lt;/p&gt;

&lt;p&gt;However, what if there is some form of &lt;a title="Dependency Injection" href="http://www.devx.com/dotnet/Article/34066/0/page/2"&gt;Dependency Injection&lt;/a&gt; where the class broadcasting the events is instantiated outside the class and its reference is added via the constructor? Would problems possibly arise? Let's explore this scenario:&lt;/p&gt;

&lt;p&gt;If the listener class registers with the event, under the hood, there is a link or reference to each other maintained between each class once the listener has registered with the event. If the listener class goes out of scope (is no longer in use), the GC (Garbage Collector) may not identify the class for garbage collection because of this underlying reference and may keep it alive for as long as the &lt;font color="#408080"&gt;NonDisposableClass&lt;/font&gt; is still alive. Conversely, if the class responsible for announcing the event (the &lt;font color="#408080"&gt;NonDisposableClass&lt;/font&gt;&lt;font color="#000000"&gt;) goes out of scope it may not be garbage collected because of the reference to the listener. In essence, there is potential for mutual dependency that results in both classes remaining in memory until both are disposed or removed from scope. When there are multiple listeners and multiple events, this can become very significant and the previous example would expose potential 'memory leaks' - unintended storage or references of objects that hang around in memory significantly longer than desired.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Let's expand my example to include disposal when a form of dependency injection exists (note the constructor):&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
        &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;DisposableEventListener&lt;/span&gt;&lt;span style="line-height: 1"&gt; : &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;IDisposable&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; DisposableEventListener(&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableClass&lt;/span&gt;&lt;span style="line-height: 1"&gt; nonDisposableClass) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (nonDisposableClass == &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;throw&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;ArgumentNullException&lt;/span&gt;&lt;span style="line-height: 1"&gt;(&lt;/span&gt;&lt;span style="color: #a31515; line-height: 1"&gt;&amp;quot;nonDisposableClass&amp;quot;&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_nonDisposableClass = nonDisposableClass;&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; RegisterEvent();&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// A reference to the non disposable class exposing an event&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;NonDisposableClass&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_nonDisposableClass;&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;virtual&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; RegisterEvent() {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_nonDisposableClass.SomeEvent += &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;(m_nonDisposableClass_SomeEvent);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_nonDisposableClass_SomeEvent(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt; sender, &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; e) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// Do something when event occurs here...&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; Dispose() {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;true&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;GC&lt;/span&gt;&lt;span style="line-height: 1"&gt;.SuppressFinalize(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;bool&lt;/span&gt;&lt;span style="line-height: 1"&gt; IsDisposed = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;false&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;bool&lt;/span&gt;&lt;span style="line-height: 1"&gt; Disposing) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (!IsDisposed) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (Disposing) {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;//Clean Up managed resources&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// Ensure we clean-up references to event&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (m_nonDisposableClass != &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_nonDisposableClass.SomeEvent -= &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;(m_nonDisposableClass_SomeEvent);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;//Clean up unmanaged resources&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; IsDisposed = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;true&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ~DisposableEventListener() {&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;false&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

          &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Ah, we are getting somewhere. Now, the listener takes on the responsibility of ensuring that it unregisters it own event(s) (which is the base for the underlying mutual reference between the listener and the class announcing the event and can prevent proper garbage collection). PROPER DISPOSAL IS CRUCIAL WHEN REFERENCES EXIST OUTSIDE THE CLASS. &lt;/p&gt;

&lt;p&gt;Further, I did not find an example where the class broadcasting events also takes on the responsibility of removing any registered listeners when it is disposed. Should it? Well, if listeners are outside the control of the developer creating the class broadcasting events, I would say yes. In fact, I believe it is a 'Best Practice' even when the developer is in control of the listeners. Consider my dependency injection sample where some outside class that is inaccessible from listener is managing the life-cycle of the class broadcasting events. What if this manager class is disposed? All the underlying references for events could keep a big chain alive in memory as all of the listeners are unaware of the disposal and are still registered. Here is a sample with the class broadcasting events handling the disposal of its registered listeners:&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;DisposableEventClass&lt;/span&gt;&lt;span style="line-height: 1"&gt; : &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;IDisposable&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; DisposableEventClass() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;event&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; SomeEvent;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;virtual&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; OnSomeEvent(&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; ea) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (SomeEvent != &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SomeEvent(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;, ea);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; Dispose() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;true&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;GC&lt;/span&gt;&lt;span style="line-height: 1"&gt;.SuppressFinalize(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;bool&lt;/span&gt;&lt;span style="line-height: 1"&gt; IsDisposed = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;false&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;bool&lt;/span&gt;&lt;span style="line-height: 1"&gt; Disposing) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (!IsDisposed) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (Disposing) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;//Clean Up managed resources&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;// Ensure we clean-up references to event&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SomeEvent = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;//Clean up unmanaged resources&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; IsDisposed = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;true&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ~DisposableEventClass() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Dispose(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;false&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Whew! Now we ensure that we a class responsible for broadcasting events ensures that all registered event listener references are disposed. &lt;/p&gt;

&lt;p&gt;*** I will not provide another example because I think the reader can understand what is needed, but, a 'Best Practice' should also include, at a minimum) a 'Closed' event for classes that broadcast events. This way listeners are informed that the broadcasting class is no longer available to broadcast events and the listeners will be able to react to such a scenario appropriately&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;strong&gt;THREAD-SAFETY&lt;/strong&gt;: If we deploy the latter code examples, would the events be thread-safe? The short answer is NO. A longer answer involves the developer understanding the specific EventArgs passed via the events and the resulting actions taken based on the events. If there are any (even one) shared member altered due to the events, a potential for problems related to thread-safety exists. If, for example, there is a static counter shared across instances,one thread could alter the counter just after another new thread accesses the counter value and weird,&amp;#xA0; unwanted, incorrect behavior can occur.&lt;/p&gt;

&lt;p&gt;I found a nice reference to a code snippet for events on this link: &lt;/p&gt;

&lt;p&gt;Here is the snippet:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;ThreadSafeEventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; ThreadSafeEventHandler() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;readonly&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt; TextChangedEventLock = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt;();&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; TextChangedEvent;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Event raised after the &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;see cref=&amp;quot;Text&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;&amp;#xA0; property value has changed.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;event&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; TextChanged {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;add&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEventLock) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; TextChangedEvent += &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;value&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;remove&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEventLock) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; TextChangedEvent -= &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;value&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Raises the &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;see cref=&amp;quot;TextChanged&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; event.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;param name=&amp;quot;e&amp;quot;&amp;gt;&amp;lt;see cref=&amp;quot;EventArgs&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; object that provides the arguments for the event.&lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;virtual&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; OnTextChanged(&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; e) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; handler = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEventLock) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; handler = TextChangedEvent;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (handler == &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;return&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; handler(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;, e);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Notice the changes where we manually handle the add/remove methods for the event and our new implementation wraps them in a lock. Also notice that calls to OnTextChanged (raising the event) is also uses a lock. This combination ensures that our events are thread-safe.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MEMORY-REVISITED&lt;/strong&gt;: I previously delayed addressing the memory issue where numerous events can result in less-than-desirable memory usage. What can we do? Well, let's look at Microsoft's solution that they implemented on the Control class. Within the framework is a handy class for managing multiple events, the&amp;#xA0; &lt;a title="EventHandlerList" href="http://msdn2.microsoft.com/en-us/library/system.componentmodel.eventhandlerlist(vs.80).aspx"&gt;System.ComponentModel.EventHandlerList&lt;/a&gt;. If you create a Windows form and type 'this' (dot), intellisense will reveal a property named 'Events'. Events is simply a reference to an instance of the EventHandlerList. Using the list to stores events frees up memory for the events that are not registered. It also has a bonus feature where its much easier to dispose of all events in one call by setting Events = null in the dispose method rather than each respective event. If you are using a class that inherits from control, you should use the Events property to add/remove events, rather than use private fields.&lt;/p&gt;

&lt;p&gt;Here is a sample using the Control class:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;ControlEventSample&lt;/span&gt;&lt;span style="line-height: 1"&gt; : &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;Control&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; ControlEventSample() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;readonly&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt; TextChangedEvent = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;object&lt;/span&gt;&lt;span style="line-height: 1"&gt;();&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Event raised after the &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;see cref=&amp;quot;Text&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt;&amp;#xA0; property value has changed.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; [Category(&lt;/span&gt;&lt;span style="color: #a31515; line-height: 1"&gt;&amp;quot;Property Changed&amp;quot;&lt;/span&gt;&lt;span style="line-height: 1"&gt;)]&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; [Description(&lt;/span&gt;&lt;span style="color: #a31515; line-height: 1"&gt;&amp;quot;Event raised after the Text property value has changed.&amp;quot;&lt;/span&gt;&lt;span style="line-height: 1"&gt;)]&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;event&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; TextChanged {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;add&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEvent) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Events.AddHandler(TextChangedEvent, &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;value&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;remove&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEvent) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Events.RemoveHandler(TextChangedEvent, &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;value&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; Raises the &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;see cref=&amp;quot;TextChanged&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; event.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;///&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;param name=&amp;quot;e&amp;quot;&amp;gt;&amp;lt;see cref=&amp;quot;EventArgs&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="color: green; line-height: 1"&gt; object that provides the arguments for the event.&lt;/span&gt;&lt;span style="color: gray; line-height: 1"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;virtual&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;void&lt;/span&gt;&lt;span style="line-height: 1"&gt; OnTextChanged(&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt; e) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt; handler = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;lock&lt;/span&gt;&lt;span style="line-height: 1"&gt; (TextChangedEvent) {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; handler = (&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandler&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventArgs&lt;/span&gt;&lt;span style="line-height: 1"&gt;&amp;gt;)Events[TextChangedEvent];&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (handler != &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; handler(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;, e);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Okay, so what if you don't inherit from a built-in class where the Events property is already implemented? Can you still use this class? The answer: Yes!&lt;/p&gt;

&lt;p&gt;Simply add this property to your class:&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandlerList&lt;/span&gt;&lt;span style="line-height: 1"&gt; Events {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;get&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;return&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_events;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;private&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandlerList&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_events = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;EventHandlerList&lt;/span&gt;&lt;span style="line-height: 1"&gt;();&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STATIC VERSUS INSTANCE EVENTS&lt;/strong&gt;: Events like other members of a class can be declared as static. I caution developers to be careful when using the &lt;a title="EventHandlerList" href="http://msdn2.microsoft.com/en-us/library/system.componentmodel.eventhandlerlist(vs.80).aspx"&gt;System.ComponentModel.EventHandlerList&lt;/a&gt; and warn not use the EventHandlerList to manage static events. Manage them using private static fields. The reason I add such a caution is the handy way of disposing all registered events by setting Events to null on disposal of an instance. If static events are referenced in the EventHandlerList and multiple instances are open, then any instance closing would unregister all other open instances and this is clearly unwanted behavior. &lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONCLUSION&lt;/strong&gt;: Events are a powerful feature of the .NET Framework, but perils exists if they are not understood and implemented properly. I shared what I believe addresses potential pitfalls regarding &lt;strong&gt;memory optimization&lt;/strong&gt;, &lt;strong&gt;thread-safety&lt;/strong&gt;, &lt;strong&gt;proper disposal&lt;/strong&gt;, and &lt;strong&gt;static versus instance events&lt;/strong&gt;. I hope my post helps others and am open to any comments or suggestions others may provide.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISCLAIMER&lt;/strong&gt;: THE CODE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&amp;#xA0; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION&amp;#xA0; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE CODE&amp;#xA0; OR THE USE OR OTHER DEALINGS WITH THE CODE. &lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
    &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-2235598340531047006?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/2235598340531047006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=2235598340531047006&amp;isPopup=true' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2235598340531047006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2235598340531047006'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/c-advanced-event-handling-memory.html' title='C#: Advanced Event Handling: Memory Optimization, Thread-safety, and Proper Disposal'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-8547873905443145307</id><published>2007-10-03T01:38:00.001-07:00</published><updated>2007-10-03T02:04:15.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Politics'/><title type='text'>WTO agreement: Will it boost the world economy?</title><content type='html'>&lt;p&gt;I was reading an old post on the BBC with the same title : &lt;a title="Link to Article" href="http://news.bbc.co.uk/1/hi/talking_point/1656961.stm"&gt;LINK&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Here is an excerpt where I believe I have a personal connection:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&amp;quot;It is ironic that the &amp;quot;multi-nationals&amp;quot; have provided the kind of world whereby Zafar Almas, from Pakistan, can express himself to me here in the US ... the telephone, the computer (with all its technical components), the internet, the video screen ... the list goes on and on. Like all his kind, they want the best of what we have invented and made available, but do not wish to participate in, encourage or take responsibility for promoting the very culture that encourages such innovations! I'd wager that there is much latent talent and brilliance in Pakistan just bursting to get out, if only the Luddites and the primitive thinking of the cultural institutions in developing countries let freedom rip! In the end, you'll understand ... in the meantime, just keep buying our stuff!        &lt;br /&gt;&lt;b&gt;Mark M. Newdick, US/UK &lt;/b&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;As usual, we have extraordinarily comments about global trade, this time from Mark M Newdick. Leaving aside the problems of the Western view of development being necessarily 'good', the thesis that 'innovation' produces profit is extremely flawed. In the West, we see that much low-paid, physically demanding (and frequently dangerous) manual work in production has given way to work in management and service sectors. But the production work is still done - usually in poor countries for offensively low wages as corporations seek to reduce production costs. The WTO and IMF help to stifle competition from poor nations by forcing them to adhere to free trade agreements (no subsidies or trade barriers, goods produced solely for export), while the West frequently ignores these rules. Nobody subsidises rice more heavily than the US, and each economic downturn is met by embargos on imports to help domestic products. So Mark M Newdick, the wealth that you enjoy relies more on the US breaking free trade agreements and exploiting workers in poor countries than all of those high-minded notions about cultural freedom and good-ol' US innovation.        &lt;br /&gt;&lt;b&gt;Paul R, Wales &amp;quot;&lt;/b&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I wish I could respond (post my own comments) on the now closed article... I cannot, but I can respond here!&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I suspect that I personally know this particular Mark Newdick and if he is the man I know,&amp;#xA0; he is a man with a particular history that likely provides him with more accurate and meaningful insight than Paul.&lt;/p&gt;  &lt;p&gt;The Mark I know is from England and now lives in the USA; he volunteered (or was hired) as a accountant related to the international efforts to build desalinization plants in Africa. The world is full of wealthy countries and compassionate people who seek to help developing countries. The USA's contribution efforts are unmatched anywhere in the world. The idea that Western nations are the major corrupting influence is ridiculous. Consider who paid (funded) the building of the desalinization plants. The reasoning can be conveyed simply with this proverb: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;quot;You can give a man a fish and he can eat for a day, or you teach him to fish and he can eat for life.&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Paul seems to think that the poverty suffered by the people living in developing countries around the world is due to the gluttony of the United States and/or to other Western Civilization Nations and their respective citizens along with some scheming plot to dump menial,&amp;#xA0; low-wage jobs into poor nations. That's how it works isn't it? Another nation has a positive environment for building the overall standard of living for all its citizens and then Evil Western nations con them into unfair trade agreements, block each country's respective production, and forces them to do our menial, low-wage jobs. does that make sense to you?&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Paul should know that Mark is one of those idealistic persons that imagined helping setup desalinization plants to bring self-sufficiency and prosperity to these nations; he imagined water irrigating dry soil, new farming jobs, and large-scale agricultural production being established to,&amp;#xA0; &amp;quot;teach the people to fish and eat for life.&amp;quot; He arrived in Africa where local politicians smiled and greeted these ostensibly &amp;quot;Evil Westerners&amp;quot;. He watched their public handshaking as cameras flashed for the media. Billions of dollars were poured into poor nations via the graciousness of Western nations, Western businesses, and Western citizens. There has never been and there is not likely ever going to be an expectation from Western nations that they receive a profit on the overall support they have given. Any &amp;quot;paybacks&amp;quot; that have been received are a fraction of what has been given. It is not corruption to give with rules under these circumstances. Oh... but why are there these rules?&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Mark continued to watch as the media and foreign politicians left their photo-op. He watched as local warlords (thugs with guns) drove up in various vehicles armed with AK47s and small armies of troops. He watched as the politicians publicly claiming to help their people greeted these thugs, and, over-time, discovered how the funds for aid were used to fund diamond and drug trafficking. He watched as the shipments of food and medicine (supplied by various international - mostly Western - aid organizations)&amp;#xA0; arrived for the poor. The food and medicine - most often - did not get delivered to the poor and suffering, it was carted off to the warlords who used it to influence, oppress and control the local citizens. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Handling all the logistics necessary for desalinization is no small task. Mark watched as huge rubber tanks holding thousands of gallons of water were air-dropped into remote areas. These rubber tanks are expensive. He watched as warlords drove up to intercept the airdrop, were they punched holes into the tanks to fill a few 55 gallon drums. The tanks were ruined, the water wasted, and the people dependent on it: in trouble. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;This venture occurred during the 1980s and this article highlights that nothing has changed: &lt;a title="Failed Water Plants" href="http://www.foodandwaterwatch.org/water/waterprivatization/africa/tanzania/tanzania-sued"&gt;Failed Water Plants&lt;/a&gt;; although, one should take note that the article points fingers in the wrong direction. No wonder Paul doesn't understand: too many media sources are not interested in truth anymore. My sister travels to Africa often. She just climbed Mount Kilamanjaro a few months ago. If you read the article, then you know that foreign aid amounts to a whopping 1/3 of the income in Tanzania. The failed plant was not due to Western corruption, its due to local corruption. This local corruption been going on so long that many nations are demanding rules or they will cutoff support. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Mark knows there is a consistency in the world where the higher the corruption, the more impoverished its people. Corruption exists everywhere, but its highest in poor nations - and that is why they are poor. When Warlords storm the supply depots for the desalinization plants and take critical supplies, when they take food and medicine, when they murder their own citizens, when they divert funds intended for aid to diamond and drug traffickers and to purchase weapons, when they do these things, they are killing their people and they are making their country poor, and they make the dreamy, idealistic notion of helping them seem far beyond reach. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Western nations do have their own corruption, but it is not the gluttony of Western nations nor the result of international trade agreements that is making poor nations poor. It is the local corruption and the local policies of the respective nations that is the root cause, not the subsidies of US rice farmers.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-8547873905443145307?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/8547873905443145307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=8547873905443145307&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8547873905443145307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/8547873905443145307'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/wto-agreement-will-it-boost-world.html' title='WTO agreement: Will it boost the world economy?'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-7250441188032243899</id><published>2007-10-03T00:44:00.001-07:00</published><updated>2007-10-03T14:11:48.380-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Finally: A Code Snippet Plugin that Works!</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b69f3485-aaa6-458d-8e34-f9319d55274d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/Windows%20Live%20Writer/" rel="tag"&gt;Windows Live Writer&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/C#/" rel="tag"&gt;C#&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Programming/" rel="tag"&gt;Programming&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/VS2005/" rel="tag"&gt;VS2005&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Visual%20Studio/" rel="tag"&gt;Visual Studio&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Code%20Snippet/" rel="tag"&gt;Code Snippet&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Plugin/" rel="tag"&gt;Plugin&lt;/a&gt; 		&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I am new to blogging and am using &lt;a title="Windows Live Writer" href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; (beta) and am really liking it. However, I did have an initial stumbling block: I could not easily post source code and get it to display properly.&lt;/p&gt;  &lt;p&gt;I downloaded the &lt;a title="Code Snippet Plugin" href="http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html"&gt;Code Snippet Plugin&lt;/a&gt; for &lt;a title="Windows Live Writer" href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; authored by Leo Vildosola and here is the best result I could obtain:&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; DevExpress.XtraEditors;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; DevExpress.XtraEditors.ViewInfo;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#xA0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; CustomSimpleButton {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#xA0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CustomButton : SimpleButton {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#xA0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; CustomButton() {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.TabStop = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AllowFocus = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#xA0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; CustomButtonViewInfo m_customButtonViewInfo;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#xA0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; BaseStyleControlViewInfo CreateViewInfo() {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (m_customButtonViewInfo == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; m_customButtonViewInfo = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CustomButtonViewInfo(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; m_customButtonViewInfo;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;If it displays on this web page for you, the same as it does for me, all of my lines of code are shifted or justified left (it's hard to read) and it does not use the colors or formatting that I use in Visual Studio. It seems like a potentially decent plugin with some unusable flaws for me; although, other users do not seem to have the same justification problem I am experiencing. I wrote the author about my justification problem and have not received a response, so I moved on to look for something better...&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;I tried every plugin I could find for WLW ( &lt;a title="Windows Live Writer" href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; ) and I could tire you by demonstrating that none of them would display properly. Either they lost the basic formatting similar to above, or they used hard-coded color schemes that were offensive to me, or something just not acceptable happened with each plugin I tried... and I tried every one available for download (approx. 5 to 8). &lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;I did, however, find a clear winner and it was not a plugin for &lt;a title="Windows Live Writer" href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt;, it is a plugin for Visual Studio! It uses the formatting settings that I use in Visual Studio and is very simple to use. You tell me, does this second sample appear better to you?&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="color: blue; line-height: 1"&gt;using&lt;/span&gt;&lt;span style="line-height: 1"&gt; System;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="color: blue; line-height: 1"&gt;using&lt;/span&gt;&lt;span style="line-height: 1"&gt; DevExpress.XtraEditors;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="color: blue; line-height: 1"&gt;using&lt;/span&gt;&lt;span style="line-height: 1"&gt; DevExpress.XtraEditors.ViewInfo;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="color: blue; line-height: 1"&gt;namespace&lt;/span&gt;&lt;span style="line-height: 1"&gt; CustomSimpleButton {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;class&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;CustomButton&lt;/span&gt;&lt;span style="line-height: 1"&gt; : &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;SimpleButton&lt;/span&gt;&lt;span style="line-height: 1"&gt; {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;public&lt;/span&gt;&lt;span style="line-height: 1"&gt; CustomButton() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;.TabStop = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;.AllowFocus = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;false&lt;/span&gt;&lt;span style="line-height: 1"&gt;;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;CustomButtonViewInfo&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_customButtonViewInfo;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;protected&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;override&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;BaseStyleControlViewInfo&lt;/span&gt;&lt;span style="line-height: 1"&gt; CreateViewInfo() {&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;if&lt;/span&gt;&lt;span style="line-height: 1"&gt; (m_customButtonViewInfo == &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;null&lt;/span&gt;&lt;span style="line-height: 1"&gt;)&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_customButtonViewInfo = &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;new&lt;/span&gt;&lt;span style="line-height: 1"&gt; &lt;/span&gt;&lt;span style="color: #2b91af; line-height: 1"&gt;CustomButtonViewInfo&lt;/span&gt;&lt;span style="line-height: 1"&gt;(&lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;this&lt;/span&gt;&lt;span style="line-height: 1"&gt;);&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;span style="color: blue; line-height: 1"&gt;return&lt;/span&gt;&lt;span style="line-height: 1"&gt; m_customButtonViewInfo;&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;}&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px; line-height: 1"&gt;&lt;span style="line-height: 1"&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;What is this magical plugin? It is &lt;a title="CopySourceAsHTML" href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;CopySourceAsHTML&lt;/a&gt; written by &lt;a href="http://www.jtleigh.com/people/colin/"&gt;Colin Coller&lt;/a&gt; and released by &lt;a href="http://www.jtleigh.com/"&gt;J.T. Leigh &amp;amp; Associates Inc.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: the Code Snippet box is my own wrapper and is not created as part of the plugin: the plugin just auto-creates wonderfully formatted code for the web. &lt;/p&gt;

&lt;p&gt;The steps I take are simple:&lt;/p&gt;

&lt;p&gt;I insert my Code Snippet template in Live Writer, I switch to Visual Studio and highlight my code, then I right-click and select CopyAsHTML from the context menu. I then switch back to Live Writer and place my mouse cursor in the Code Snippet box. The final step is choose Edit, Paste Special, and select the option, Keep Formatting. Wa La - it's done!&lt;/p&gt;

&lt;p&gt;All of this is done with an easy to use WYSIWYG blog post editor: Windows Live Writer (beta) and the assistance of a very helpful plugin.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-7250441188032243899?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/7250441188032243899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=7250441188032243899&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/7250441188032243899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/7250441188032243899'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/finally-code-snippet-plugin-that-works.html' title='Finally: A Code Snippet Plugin that Works!'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-7065508799970519345</id><published>2007-10-02T00:15:00.001-07:00</published><updated>2007-10-03T00:04:24.809-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DevExpress'/><category scheme='http://www.blogger.com/atom/ns#' term='XtraEditors'/><title type='text'>Replicating the Look &amp; Feel of the DevExpress DataNavigator Control</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e9f7913e-6e9c-4b23-ba36-110f3538e548" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/DevExpress/" rel="tag"&gt;DevExpress&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/XtraEditors/" rel="tag"&gt;XtraEditors&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Navigator/" rel="tag"&gt;Navigator&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Custom/" rel="tag"&gt;Custom&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Look%20&amp;amp;%20Feel/" rel="tag"&gt;Look &amp;amp; Feel&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Programming/" rel="tag"&gt;Programming&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/C#/" rel="tag"&gt;C#&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Developer%20Express/" rel="tag"&gt;Developer Express&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Custom%20Images/" rel="tag"&gt;Custom Images&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Skins/" rel="tag"&gt;Skins&lt;/a&gt; 		&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I use the entire suite of products produced by Developer Express, Inc. or&amp;#xA0; &lt;a title="http://www.devexpress.com/" href="http://www.devexpress.com/"&gt;DevExpress&lt;/a&gt;. While experimenting with various form layouts, I realized that their DataNavigator control; one of the many controls included in their &lt;a title="http://www.devexpress.com/Products/NET/WinForms/XtraEditors/" href="http://www.devexpress.com/Products/NET/WinForms/XtraEditors/"&gt;XtraEditors&amp;#x2122; Library&lt;/a&gt; applied special skinning. If you are not familiar with &lt;a title="http://www.devexpress.com/" href="http://www.devexpress.com/"&gt;DevExpress&lt;/a&gt;, or their controls; they support an application-wide Look &amp;amp; Feel and custom skinning.&lt;/p&gt;  &lt;p&gt;*NOTE: This solution relies on the &lt;a title="http://www.devexpress.com/" href="http://www.devexpress.com/"&gt;DevExpress&lt;/a&gt;&amp;#xA0;&lt;a title="http://www.devexpress.com/Products/NET/WinForms/XtraEditors/" href="http://www.devexpress.com/Products/NET/WinForms/XtraEditors/"&gt;XtraEditors&amp;#x2122; Library&lt;/a&gt; and extends&amp;#xA0; it, it does not try to create an independent solution.&lt;/p&gt;  &lt;p&gt;Here is a screen shot of the Developer Express Ribbon Control combined with many of their other editors:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.google.com/TrevorWesterdahl/RwHwCXvbSlI/AAAAAAAAAD4/aHn5k72ZcrA/Ribbon-Pad-Demo%5B8%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="594" alt="Ribbon-Pad-Demo" src="http://lh4.google.com/TrevorWesterdahl/RwHwC3vbSmI/AAAAAAAAAEA/FXKm7sAH9VM/Ribbon-Pad-Demo_thumb%5B4%5D.jpg" width="742" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;The DataNavigator has a special look; especially when displayed using Office2007 skins. &lt;/p&gt;  &lt;p&gt;Here are various screen shots of the control:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.google.com/TrevorWesterdahl/RwHwDHvbSnI/AAAAAAAAAEI/4sk6O39kob8/DataNavigator-Screenshots%5B2%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="115" alt="DataNavigator-Screenshots" src="http://lh6.google.com/TrevorWesterdahl/RwHwDXvbSoI/AAAAAAAAAEQ/SqwX-e_hYSE/DataNavigator-Screenshots_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;As you can see, the display of the control changes dramatically depending on the Look &amp;amp; Feel selected by the end-user of the application.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I ran into a scenario where I wanted to add custom controls to my form that maintained the same Look &amp;amp; Feel as the DataNavigator. I tried adding SimpleButtons to the form and discovered that I could not get the buttons to match the same appearance. Here is a screen shot of three SimpleButtons set side-by-side using the same Look &amp;amp; Feel as the first (silver-colored) image:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.google.com/TrevorWesterdahl/RwHwDXvbSpI/AAAAAAAAAEY/_uKbXk1OOuk/Simple-Buttons%5B2%5D.jpg"&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="46" alt="Simple-Buttons" src="http://lh3.google.com/TrevorWesterdahl/RwHwDnvbSqI/AAAAAAAAAEg/Waj0MctgUAE/Simple-Buttons_thumb.jpg" width="104" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The highlighting is vertical as opposed to horizontal, the hover color is blue versus orange, and there are noticeable borders where the DataNavigator displays as a continuous strip for this particular style. There are many, many different schemes or styles available and I wanted to add a control that matched the DataNavigator for all of them.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;I started by creating a custom button that inherited from the SimpleButton so that I started with all the built-in features of the &lt;a title="http://www.devexpress.com/" href="http://www.devexpress.com/"&gt;DevExpress&lt;/a&gt; SimpleButton. &lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;*NOTE - I am using a &lt;a title="Code Snippet Plugin" href="http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html"&gt;Code Snippet Plugin&lt;/a&gt; for WLW (&lt;a title="Windows Live Writer (Beta)" href="http://get.live.com/betas/writer_betas"&gt;Windows Live Writer (Beta)&lt;/a&gt;)&amp;#xA0; created by Leo Vildosola and this is my first attempt to use it. I still have an issue where my code gets left justified when I post. I am hoping to correct it soon. There is a link at the bottom to download the entire VS2005 solution.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Here is the code for the CustomSimpleButton:&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;     &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;       &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;        &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;p&gt;&lt;/p&gt;

      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors.ViewInfo;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; CustomSimpleButton {&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomButton&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;SimpleButton&lt;/span&gt; {&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; CustomButton() {&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.TabStop = &lt;span style="color: blue"&gt;this&lt;/span&gt;.AllowFocus = &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;CustomButtonViewInfo&lt;/span&gt; m_customButtonViewInfo;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: #2b91af"&gt;BaseStyleControlViewInfo&lt;/span&gt; CreateViewInfo() {&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (m_customButtonViewInfo == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_customButtonViewInfo = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomButtonViewInfo&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;);&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; m_customButtonViewInfo;&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

        &lt;p style="margin: 0px"&gt;}&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div&gt;&amp;#xA0;&lt;/div&gt;

  &lt;div&gt;&amp;#xA0;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Simply inheriting from the SimpleButton wouldn't do much, I needed to create a custom view (appearance) for the button. &lt;/p&gt;

&lt;p&gt;I wanted my button's custom view to load a custom painter whenever skins are applied, but decided I could use the standard painters whenever skins are not used; DevExpress controls support skinned and non-skinned themes. The difference is that skins require loading specific images from built-in resource files.&lt;/p&gt;

&lt;p&gt;Here is the code for the CustomButtonViewInfo that selects the appropriate painter:&lt;/p&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors.Controls;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors.ViewInfo;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; CustomSimpleButton {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomButtonViewInfo&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;SimpleButtonViewInfo&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; CustomButtonViewInfo(&lt;span style="color: #2b91af"&gt;SimpleButton&lt;/span&gt; owner)&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; : &lt;span style="color: blue"&gt;base&lt;/span&gt;(owner) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; DevExpress.XtraEditors.Drawing.&lt;span style="color: #2b91af"&gt;EditorButtonPainter&lt;/span&gt; ButtonPainter {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;get&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Default;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;switch&lt;/span&gt; (LookAndFeel.ActiveLookAndFeel.ActiveStyle) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.Flat:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Flat;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.UltraFlat:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.UltraFlat;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.Style3D:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Style3D;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.Office2003:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Office2003;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.Skin:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (m_customSkinButtonPainter == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_customSkinButtonPainter = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomSkinButtonPainter&lt;/span&gt;(LookAndFeel.ActiveLookAndFeel);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; m_customSkinButtonPainter;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.WindowsXP:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; style = &lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Simple;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EditorButtonHelper&lt;/span&gt;.GetPainter(style, LookAndFeel, &lt;span style="color: blue"&gt;true&lt;/span&gt;);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;CustomSkinButtonPainter&lt;/span&gt; m_customSkinButtonPainter;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; UpdatePainters() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;base&lt;/span&gt;.UpdatePainters();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;p&gt;Well, here is where I created a painter to fetch the very same skins used by the DataNavigator (in essence, I substitute or replace the standard skins for the DataNavigator skins)&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.Skins;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors.Drawing;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; CustomSimpleButton {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomSkinButtonPainter&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;SkinEditorButtonPainter&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; CustomSkinButtonPainter(&lt;span style="color: #2b91af"&gt;ISkinProvider&lt;/span&gt; provider)&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; : &lt;span style="color: blue"&gt;base&lt;/span&gt;(provider) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; DevExpress.Skins.&lt;span style="color: #2b91af"&gt;SkinElement&lt;/span&gt; GetSkinElement(&lt;span style="color: #2b91af"&gt;EditorButtonObjectInfoArgs&lt;/span&gt; e, DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;ButtonPredefines&lt;/span&gt; kind) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;SkinElement&lt;/span&gt; res = &lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.GetSkin(Provider)[&lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.SkinNavigatorButton];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (res != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="color: blue"&gt;return&lt;/span&gt; res;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (e.BuiltIn) &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.GetSkin(Provider)[&lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.SkinEditorButton];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CommonSkins&lt;/span&gt;.GetSkin(Provider)[&lt;span style="color: #2b91af"&gt;CommonSkins&lt;/span&gt;.SkinButton];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Now I have a button that does skin like the DataNavigator, but its a SimpleButton and does not act as a strip of buttons. To be honest, my task really only needed a simple button that appeared like the DataNavigator. I decided to go a little deeper and create a control that appears like the DataNavigator (button images and all).&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;This code has a quick 'hack' (actually it works okay - never in right to left languages) to scale the buttons when the control is resized. I added a panel control and apply the appropriate style to get a very close approximation to the border changes with the DataNavigator, and I load the actual images used by the DataNavigator from the DevExpress resources. That was complicated by the fact that several styles use different images.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Here is the code for the control:&lt;/p&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; background: #808080; padding-bottom: 0px; margin-left: 4px; margin-right: 4px; padding-top: 0px"&gt;
  &lt;div style="border-right: #2e595c 1px solid; border-top: #2e595c 1px solid; background: #fff; left: -2px; border-left: #2e595c 1px solid; color: black; border-bottom: #2e595c 1px solid; position: relative; top: -2px"&gt;
    &lt;div style="border-right: blue 1px solid; border-top: blue 1px solid; background: #3f73b6; border-left: blue 1px solid; width: 100%; color: white; border-bottom: blue 1px solid"&gt;&lt;span style="width: 100%"&gt;Code Snippet&lt;/span&gt;&lt;/div&gt;

    &lt;pre&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;/p&gt;

    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;
      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System.Drawing;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.LookAndFeel;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.Skins;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.Utils;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; DevExpress.XtraEditors;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; CustomSimpleButton {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;partial&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CustomButtonsControl&lt;/span&gt; : DevExpress.XtraEditors.&lt;span style="color: #2b91af"&gt;XtraUserControl&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; CustomButtonsControl() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; InitializeComponent();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SetStyle();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; InitEventHandlers();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;CustomButton&lt;/span&gt;&amp;gt; m_buttons = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;CustomButton&lt;/span&gt;&amp;gt;();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;ImageCollection&lt;/span&gt; m_navigatorSkinImages;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ImageCollection&lt;/span&gt; m_defaultImages = &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; internalImageResourceName = &lt;span style="color: #a31515"&gt;&amp;quot;DevExpress.XtraEditors.Images.Navigator.bmp&amp;quot;&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; InitEventHandlers() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ApplyPanelStyle(&lt;span style="color: blue"&gt;this&lt;/span&gt;.LookAndFeel.ActiveLookAndFeel.Style);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.LookAndFeel.StyleChanged += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;(LookAndFeel_StyleChanged);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.SizeChanged += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;(CustomButtonsControl_SizeChanged);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;internal&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; GetDefaultImages() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (LookAndFeel.ActiveStyle == &lt;span style="color: #2b91af"&gt;ActiveLookAndFeelStyle&lt;/span&gt;.Skin) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: #2b91af"&gt;SkinElement&lt;/span&gt; element = &lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.GetSkin(LookAndFeel)[&lt;span style="color: #2b91af"&gt;EditorsSkins&lt;/span&gt;.SkinNavigator];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (element.Image != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="color: blue"&gt;return&lt;/span&gt; element.Image.GetImages();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; ImagesDefault;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; ImagesDefault {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;get&lt;/span&gt; {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (m_defaultImages == &lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_defaultImages = DevExpress.Utils.Controls.&lt;span style="color: #2b91af"&gt;ImageHelper&lt;/span&gt;.CreateImageCollectionFromResources(&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; internalImageResourceName, &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NavigatorButtonsBase&lt;/span&gt;).Assembly,&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Size&lt;/span&gt;(11, 11));&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;return&lt;/span&gt; m_defaultImages;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ApplyImages() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbFirst.Image = m_navigatorSkinImages.Images[0];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbPrevPage.Image = m_navigatorSkinImages.Images[1];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbPrev.Image = m_navigatorSkinImages.Images[2];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbNext.Image = m_navigatorSkinImages.Images[3];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbNextPage.Image = m_navigatorSkinImages.Images[4];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbLast.Image = m_navigatorSkinImages.Images[5];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbAdd.Image = m_navigatorSkinImages.Images[6];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbDelete.Image = m_navigatorSkinImages.Images[7];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbAccept.Image = m_navigatorSkinImages.Images[9];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.sbCancel.Image = m_navigatorSkinImages.Images[10];&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: green"&gt;// ... etc, etc to use navigator button images (loaded from DevExpress skins)&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ApplyPanelStyle(&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt; style) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;switch&lt;/span&gt; (style) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt;.Flat:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Flat;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt;.UltraFlat:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.UltraFlat;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt;.Style3D:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Style3D;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt;.Office2003:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Office2003;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;case&lt;/span&gt; DevExpress.LookAndFeel.&lt;span style="color: #2b91af"&gt;LookAndFeelStyle&lt;/span&gt;.Skin:&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.&lt;span style="color: #2b91af"&gt;BorderStyles&lt;/span&gt;.Default;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; AddButton(&lt;span style="color: #2b91af"&gt;CustomButton&lt;/span&gt; button) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.m_buttons.Add(button);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; StoreButtonReferences() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (m_buttons.Count &amp;lt; 1) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbFirst);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbPrevPage);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbPrev);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbNext);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbNextPage);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbLast);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbAdd);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbDelete);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbAccept);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; AddButton(&lt;span style="color: blue"&gt;this&lt;/span&gt;.sbCancel);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; CalcButtonLayout() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; StoreButtonReferences();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; this is a semi-okay hack to make buttons scale when the grab handles are dragged.&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;int&lt;/span&gt; workingSpaceWidth = &lt;span style="color: blue"&gt;this&lt;/span&gt;.Width - 2;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;int&lt;/span&gt; widthPerButton = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Math&lt;/span&gt;.Round(((&lt;span style="color: blue"&gt;decimal&lt;/span&gt;)workingSpaceWidth / m_buttons.Count), 0);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;int&lt;/span&gt; startPos = 2;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;int&lt;/span&gt; counter = 1;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;int&lt;/span&gt; prevButtonPos = 1;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;CustomButton&lt;/span&gt; button &lt;span style="color: blue"&gt;in&lt;/span&gt; m_buttons) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; button.Width = widthPerButton;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; button.Left = startPos;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; button.Top = 2;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; button.Height = &lt;span style="color: blue"&gt;this&lt;/span&gt;.panelControl1.Height - 4;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;if&lt;/span&gt; (counter == m_buttons.Count) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; button.Width = (&lt;span style="color: blue"&gt;this&lt;/span&gt;.Width - 2) - startPos;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; counter++;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; prevButtonPos = startPos;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; startPos = button.Right;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Invalidate();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;void&lt;/span&gt; CustomButtonsControl_SizeChanged(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; CalcButtonLayout();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; SetStyle() {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: green"&gt;//navigator images change with different styles&lt;/span&gt;&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; m_navigatorSkinImages = (&lt;span style="color: #2b91af"&gt;ImageCollection&lt;/span&gt;)GetDefaultImages();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ApplyImages();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ApplyPanelStyle(&lt;span style="color: blue"&gt;this&lt;/span&gt;.LookAndFeel.ActiveLookAndFeel.Style);&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;span style="color: blue"&gt;void&lt;/span&gt; LookAndFeel_StyleChanged(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e) {&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SetStyle();&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/p&gt;

      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;div&gt;&amp;#xA0;&lt;/div&gt;

&lt;p&gt;What is the result? Well, for the most part the controls are identical: There are some differences on exact borders and the Money Twins theme has a much darker appearance for the the buttons on the DevExpress control (I think they have them set to some always hot state).. and of course my sizing logic is not nearly as robust and will differ slightly. Overall, I am very happy and did get what I was seeking.&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;If you are a DevExpress user and want to see/try the result for yourself, download the code and experiment with the control. Keep in mind that all I wanted was something reasonably close and I certainly went deeper than I intended with the multi-button control. Maybe someone can help me improve it? Maybe, at least,&amp;#xA0; it will spark some ideas? &lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Download the VS2005 solution &lt;a title="Solution Download" href="http://www.drivehq.com/file/df.aspx/shareID2632978/fileID88250909/CustomSimpleButton.zip"&gt;Here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#xA0;&lt;/p&gt;

&lt;p&gt;Trevor&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-7065508799970519345?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/7065508799970519345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=7065508799970519345&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/7065508799970519345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/7065508799970519345'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/10/replicating-look-feel-of-devexpress.html' title='Replicating the Look &amp;amp; Feel of the DevExpress DataNavigator Control'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-2181385515666798146</id><published>2007-09-30T23:38:00.001-07:00</published><updated>2007-09-30T23:38:59.409-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Home'/><title type='text'>Home Remodeling</title><content type='html'>&lt;p&gt;Well, I have some great blogs that are &amp;quot;in-process&amp;quot; regarding custom buttons for DevExpress and some XPO topics; however, I have spent the weekend yanking out carpet, pulling linoleum, discovering how hard it is to remove adhesive from hardwood floors, and have sanding, re-staining, and varnishing the gorgeous hardwood floors that have been hidden underneath to look forward to this week. It all looks so easy on the &amp;quot;do-it-yourself channels.&amp;quot; I now realize just how much time-lapse photography makes things look easy.&lt;/p&gt;  &lt;p&gt;Anyway, just wanted to keep the Blog alive and keep up. I hope to get some deeper posts completed tomorrow.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-2181385515666798146?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/2181385515666798146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=2181385515666798146&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2181385515666798146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2181385515666798146'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/09/home-remodeling.html' title='Home Remodeling'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-2146459596397390083</id><published>2007-09-27T17:55:00.001-07:00</published><updated>2007-09-27T20:18:37.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Review: Windows Live Writer(Beta) &amp; Windows Live Mail (Beta)</title><content type='html'>&lt;p&gt;Well, I just started Blogging, so what's a better topic than my first experience using a Blog Editor? &lt;/p&gt;  &lt;p&gt;I discovered that 'Windows Live Writer&amp;#xAE;' (Beta) had been released and decided to give it a try. While downloading/installing Live Writer, an option to choose other 'Widows Live' products was offered and I decided to include Live Mail as well (I have been using Outlook 2002 and its time I decided to try a newer version).&lt;/p&gt;  &lt;p&gt;I should note that the download/install does appear to 'hang', but eventually does continue (about 3-5 minutes for me). I have&amp;#xA0; nice Comcast&amp;#xA0; Cable&amp;#xAE; connection and 3-5 minutes now seems like an eternity.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;I was immediately impressed:&lt;/strong&gt; Live Mail auto-discovered and imported my email AND my registered newsgroups. The password and user information for the newsgroups was imported as well, but I had to manually enter my username, password and email server settings for my email accounts. I was up an running in minutes.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Here is a screen shot of my newsgroups using Live Mail:&lt;/p&gt;  &lt;p&gt;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="478" alt="Windows-Live-Mail" src="http://lh6.google.com/TrevorWesterdahl/RvxeVnvbSfI/AAAAAAAAAC8/Q0xajNnm6rQ/Windows-Live-Mail%5B15%5D.jpg" width="644" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;The new Live Mail newsgroups is essentially the old (Outlook Express)with a prettier face: I have not noticed any new features regarding newsgroups. Perhaps there is something &amp;quot;under-the-hood&amp;quot;, but I didn't notice any difference in functionality. I did like how it was imported automatically and I like how my email and newsgroups are integrated into one program.&lt;/p&gt;  &lt;p&gt;I did; however, notice improvements for email. For example, the new Live Mail versus Outlook 2002 was recognizing spam and moving it to a junk folder automatically. I think I will keep using Live Mail and give a longer test. So far, I am happy.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Live Writer is what I am using to post this Blog and it was very easy to configure. A few wizard screens had me enter my Blog info and my account info (required to have permission to access the Blog). Within less than a minute Live writer downloaded my template and I was looking at a great WYSIWYG editor.&lt;/p&gt;  &lt;p&gt;I am finding this editor (Live Writer) to be very easy to use and here is a screen shot:&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;img id="id" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="434" alt="Windows-Live-Writer" src="http://lh3.google.com/TrevorWesterdahl/Rvxqr3vbSgI/AAAAAAAAADE/jCqCXBHBABw/Windows-Live-Writer%5B4%5D.jpg" width="644" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Overall: I am happy with both products and will continue to use them. Live Writer truly is a WYSIWYG editor and I am very happy. I will certainly discover any problems over time, until then I will assume the best. &lt;/p&gt;  &lt;p&gt;Nice job Microsoft!&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-2146459596397390083?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/2146459596397390083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=2146459596397390083&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2146459596397390083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/2146459596397390083'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/09/review-windows-live-writerbeta-windows.html' title='Review: Windows Live Writer(Beta) &amp;amp; Windows Live Mail (Beta)'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry><entry><id>tag:blogger.com,1999:blog-6120627810176387630.post-6409191474008366217</id><published>2007-09-26T22:50:00.000-07:00</published><updated>2007-09-26T23:01:12.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General Rants'/><title type='text'>Finally... pressured into blogging.</title><content type='html'>I have been contributing to newsgroups for some time but had not taken the leap into blogging... until now.

I am a member of the DX-Squad - that means I do something that the employees of Developer Express find useful enough on the forums and newsgroups for their products that they granted me an official title (well semi-official) - however, I had enjoyed a form of relative anonymity by not blogging which will now fade (if I do actually keep up the blog).

Another member of the squad (Rory Becker) finally teased me enough to start… so here it is… my first post.

I intended to keep this short because I need to spend time learning how to blog (I don't even know what my own site will look like yet).

Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6120627810176387630-6409191474008366217?l=trevorunlocked.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trevorunlocked.blogspot.com/feeds/6409191474008366217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6120627810176387630&amp;postID=6409191474008366217&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/6409191474008366217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6120627810176387630/posts/default/6409191474008366217'/><link rel='alternate' type='text/html' href='http://trevorunlocked.blogspot.com/2007/09/finally-pressured-into-blogging.html' title='Finally... pressured into blogging.'/><author><name>Trevor Westerdahl</name><uri>http://www.blogger.com/profile/10711661584189880690</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></entry></feed>
