<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Fun</title>
        <link>http://geekswithblogs.net/sonam/category/9177.aspx</link>
        <description>Fun</description>
        <language>en-US</language>
        <copyright>sonam</copyright>
        <managingEditor>sonamsingh_19@yahoo.co.in</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>What happened to my vacations</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/07/21/what-happened-to-my-vacations.aspx</link>
            <description>College is opening tommorow and I am thinking what i have done in past 1 and half months of vacations.&lt;br /&gt;
&lt;br /&gt;
The only thing i can remember is bluz,my open source project.&lt;br /&gt;
Where is that p2p thing i decided earlier?&lt;br /&gt;
All the research papers about skype,overlay networks ,guntella etc are lying there on disk as it is.i have read them only once.I have read not understood..&lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/wink_smile.gif" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
The positive side of vacations is:&lt;br /&gt;
1)I learned a lot about WPF,Blend etc.&lt;br /&gt;
2) I am participating in win7 contest based on above experience.&lt;br /&gt;
3)I met shaun,my  new co-developer of bluz..&lt;br /&gt;
4)I have got some books of ASP.Net by bill ,scott and  WPF book by Mathew macdonald..&lt;br /&gt;
&lt;br /&gt;
And now i have some web 2.0 ideas that i hope to implement as a way of parcticing this ASP.net stuff.Thats a business idea,So you might  see something interesting on web soon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So,If i look back that way,I think it was more rewarding than any of internship i could get.&lt;br /&gt;
&lt;br /&gt;
Now ,its my last year of  graduation,My targets include:&lt;br /&gt;
1)Enjoy it fully.I know thats hard but i'll have to make this year remeberable .&lt;br /&gt;
2)Implement business ideas.(I love making money in humanatic way).&lt;br /&gt;
3)Make final year Project.&lt;br /&gt;
The 3rd one is where i'll cut my efforts ,Becoz i don't think that really matters as compared to my learning.Also,I don't see potential partners for a cool. .Net team to make a cool project at the college.&lt;br /&gt;
&lt;br /&gt;
cya guys,&lt;br /&gt;
cheers&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133640"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133640" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/133640.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/07/21/what-happened-to-my-vacations.aspx</guid>
            <pubDate>Wed, 22 Jul 2009 05:20:28 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/133640.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/07/21/what-happened-to-my-vacations.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/133640.aspx</wfw:commentRss>
        </item>
        <item>
            <title>New Open Source Project-Bluz(Next Generation Media Player)</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/07/15/new-open-source-project-bluznext-generation-media-player.aspx</link>
            <description>&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: verdana; font-size: 11px; white-space: pre-wrap;" class="Apple-style-span"&gt;hi guys.&lt;br /&gt;
&lt;br /&gt;
I  have just released a pre beta release of next generation media player bluz.&lt;br /&gt;
&lt;br /&gt;
Link is here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://code.google.com/p/bluz/"&gt;&lt;br /&gt;
&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: verdana; font-size: 11px; white-space: pre-wrap;" class="Apple-style-span"&gt;&lt;a href="http://code.google.com/p/bluz/"&gt;http://code.google.com/p/bluz/&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: verdana; font-size: 11px; white-space: pre-wrap;" class="Apple-style-span"&gt;Its based on vlc libraries and bass and a couple of others for various tasks.&lt;br /&gt;
Its in c#,WPF but if any of you would like to contribute through any means.&lt;br /&gt;
The UI is purely in XAML,I am not a good designer,Even all icons are made in XAML.&lt;br /&gt;
.&lt;br /&gt;
If any of you would like to contribute through coding various modules or helping me develop the website,it would be nice of you to make it a hit on windows OS.&lt;br /&gt;
&lt;br /&gt;
Atleast,U guys can check out and report any bugs you find to me directly..&lt;br /&gt;
&lt;br /&gt;
It requires .Net 3.5&lt;br /&gt;
Have a nice day.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Screenshots:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://handsonwpf.files.wordpress.com/2009/07/mjlook.jpg?w=450&amp;amp;h=281" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://handsonwpf.files.wordpress.com/2009/07/2009-07-07_0259.png?w=450&amp;amp;h=270" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133506"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133506" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/133506.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/07/15/new-open-source-project-bluznext-generation-media-player.aspx</guid>
            <pubDate>Wed, 15 Jul 2009 20:49:56 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/133506.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/07/15/new-open-source-project-bluznext-generation-media-player.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/133506.aspx</wfw:commentRss>
        </item>
        <item>
            <title>I got task for summers:Study p2p architectures</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/05/03/i-got-task-for-summersstudy-p2p-architectures.aspx</link>
            <description>This is in continuation to my last post in which i was confused of "what  to do in summers".&lt;br /&gt;
After a lot of thinking,I have got the answer.&lt;br /&gt;
I'll study/research on &lt;span style="color: rgb(255, 0, 0);"&gt;"p2p architectures and there use in enterprises"...&lt;/span&gt;Lets see how it goes,i have semester exams next week and i have downloaded a lot of  books/technical papers to get started. ..&lt;br /&gt;
&lt;br /&gt;
p2p will help me distinguish my music player from others in the market...&lt;br /&gt;
&lt;br /&gt;
I'll also look at using the p2p library &lt;span style="color: rgb(0, 0, 255);"&gt;"Brunet" &lt;/span&gt;which is not much publicized as gnutella ...You can see the work here:.&lt;br /&gt;
.&lt;br /&gt;
&lt;a href="http://github.com/johnynek/brunet/tree/master"&gt;http://github.com/johnynek/brunet/tree/master&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Its a work by Sir ,Oscar  BoyKin at UCLA(University of California)..For a weath of softwares and knowledge/he blogs at:&lt;br /&gt;
&lt;a href="http://boykin.acis.ufl.edu/"&gt;http://boykin.acis.ufl.edu/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I'll make my player a true web 2.0 social app..doing some homework in p2p architectures will be good for my summers...&lt;br /&gt;
&lt;br /&gt;
And I'll keep posting tuts/links or any cool things that i'll encounter in my p2p research.I am really excited for it.&lt;br /&gt;
&lt;br /&gt;
Have a happy coding.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131688"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131688" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/131688.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/05/03/i-got-task-for-summersstudy-p2p-architectures.aspx</guid>
            <pubDate>Sun, 03 May 2009 12:14:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/131688.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/05/03/i-got-task-for-summersstudy-p2p-architectures.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/131688.aspx</wfw:commentRss>
        </item>
        <item>
            <title>What to do in summer?</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/04/16/what-to-do-in-summer.aspx</link>
            <description>I am a Computer science student and there is a big Question mark of  what  i'll do in summers.&lt;br /&gt;
Ofcourse,I have some projects to do ,But even then i would like to get some internship.A fun and learning opportunity at the same time,i can earn too..&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://blogs.psychologytoday.com/files/u114/qmark.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But this recession has really affected my internship hopes..&lt;br /&gt;
Companies like Microsoft,Google are giving paid internships to Phd Students only and i am  a pursuing undergraduate from not so famous college.&lt;br /&gt;
..And they require some big references which i am not having.&lt;br /&gt;
&lt;br /&gt;
What may be other cooler options..?Let me think over it ..hmmm..&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131245"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131245" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/131245.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/04/16/what-to-do-in-summer.aspx</guid>
            <pubDate>Thu, 16 Apr 2009 16:24:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/131245.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/04/16/what-to-do-in-summer.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/131245.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ListView DragDrop in WPF,multiselect</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/03/02/listview-dragdrop-in-wpfmultiselect.aspx</link>
            <description>After going through the web ,I haven't got anything that i can use directly to enable drag drop between two listview controls or within same for multiple items.&lt;br /&gt;
The best thing available in my opinion is this one by Josh smith:&lt;br /&gt;
http://www.codeproject.com/KB/WPF/ListViewDragDropManager.aspx&lt;br /&gt;
&lt;br /&gt;
But it is for single SelectionMode only&lt;br /&gt;
&lt;br /&gt;
Another one for multiselct is this:&lt;br /&gt;
http://www.codeproject.com/KB/WPF/WPF_MultiSelect_DragDrop.aspx&lt;br /&gt;
But the second one has many limitations..&lt;br /&gt;
So i have done some work to extend it from there..&lt;br /&gt;
I don't have much time in near weeks to work on this ,So it is not that much well written.&lt;br /&gt;
But it will serve as the good to get u one what u want during drag drop in more graceful way....&lt;br /&gt;
&lt;br /&gt;
The code is as follows:&lt;br /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Collections;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Linq;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Text;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows.Controls;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows.Media;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows.Controls.Primitives;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Collections.ObjectModel;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Reflection;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Diagnostics;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;namespace DragDropManager&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;{&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;   public class DragDropManager&amp;lt;T&amp;gt; where T:class,ICloneable&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;   {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        ListView listView;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       // delegate for GetPosition function of DragEventArgs and&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       // MouseButtonEventArgs event argument objects. This delegate is used to reuse the code&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       // for processing both types of events.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       delegate Point GetPositionDelegate(IInputElement element);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       public DragDropManager(ListView listView)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           this.listView = listView;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           listView.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(listView_PreviewMouseLeftButtonDown);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           listView.Drop += new System.Windows.DragEventHandler(listView_Drop);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       void listView_Drop(object sender, DragEventArgs e)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           int index = this.GetCurrentIndex(e.GetPosition);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (index &amp;lt; 0)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               return;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           Dictionary&amp;lt;int,T&amp;gt; draggedItems =  e.Data.GetData(typeof(Dictionary&amp;lt;int,T&amp;gt;)) as Dictionary&amp;lt;int,T&amp;gt;;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        if(sender==this.listView)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            this.listView.SelectedItems.Clear();&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       int i = 0;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;         ObservableCollection&amp;lt;T&amp;gt;  itemsSource=  this.listView.ItemsSource as ObservableCollection&amp;lt;T&amp;gt;;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           // finally insert the items into the source collection&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;         T dropTarget = itemsSource[index];&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;         if (draggedItems.ContainsValue(dropTarget)) return;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;   &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;   &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          foreach(int key in draggedItems.Keys)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;              T draggedItemClone = draggedItems[key].Clone() as T;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;              itemsSource.Insert(index + i, draggedItemClone);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;             &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;              i++;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
  &lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;      &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       void listView_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           int index = this.GetCurrentIndex(e.GetPosition);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (index &amp;lt;0) return; &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           // this will create the drag "rectangle"&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           DragDropEffects allowedEffects = DragDropEffects.Move;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (this.listView.SelectedItems.Count == 0)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               return;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;          &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           Dictionary&amp;lt;int,T&amp;gt; draggedItems = new Dictionary&amp;lt;int, T&amp;gt;();&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;      &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;         &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           foreach(T draggedItem in this.listView.SelectedItems)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            draggedItems[this.listView.Items.IndexOf(draggedItem)] = (draggedItem as T);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;             &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           T item = this.listView.Items[index] as T;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (!draggedItems.ContainsValue(item))&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;                     return;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           DragDrop.DoDragDrop(this.listView, draggedItems, allowedEffects);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       ListViewItem GetListViewItem(int index)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (this.listView.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               return null;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           return this.listView.ItemContainerGenerator.ContainerFromIndex(index) as ListViewItem;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       // returns the index of the item in the ListView&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       int GetCurrentIndex(GetPositionDelegate getPosition)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           int index = -1;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           for (int i = 0; i &amp;lt; this.listView.Items.Count; ++i)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               ListViewItem item = GetListViewItem(i);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (this.IsMouseOverTarget(item, getPosition))&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;             &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;                   index = i;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;                   break;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           return index;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       bool IsMouseOverTarget(Visual target, GetPositionDelegate getPosition)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           if (target == null)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;               return false ;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           Rect bounds = VisualTreeHelper.GetDescendantBounds(target);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           Point mousePos=  MouseUtilities.GetMousePosition(target);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;           return bounds.Contains(mousePos);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;       }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;   }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
..........................................................................&lt;br /&gt;
The code for MouseUtilities.cs is :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Text;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Runtime.InteropServices;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;using System.Windows.Media;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;namespace DragDropManager&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;{&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// Provides access to the mouse location by calling unmanaged code.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// &amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// This class was written by Dan Crevier (Microsoft).  &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// http://blogs.msdn.com/llobo/archive/2006/09/06/Scrolling-Scrollviewer-on-Mouse-Drag-at-the-boundaries.aspx&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    /// &amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    public class MouseUtilities&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        [StructLayout(LayoutKind.Sequential)]&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        private struct Win32Point&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            public Int32 X;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            public Int32 Y;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        };&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        [DllImport("user32.dll")]&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        private static extern bool GetCursorPos(ref Win32Point pt);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        [DllImport("user32.dll")]&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        private static extern bool ScreenToClient(IntPtr hwnd, ref Win32Point pt);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// Returns the mouse cursor location.  This method is necessary during &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// a drag-drop operation because the WPF mechanisms for retrieving the&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// cursor coordinates are unreliable.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        /// &amp;lt;param name="relativeTo"&amp;gt;The Visual to which the mouse coordinates will be relative.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        public static Point GetMousePosition(Visual relativeTo)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            Win32Point mouse = new Win32Point();&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            GetCursorPos(ref mouse);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            // Using PointFromScreen instead of Dan Crevier's code (commented out below)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            // is a bug fix created by William J. Roberts.  Read his comments about the fix&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            // here: http://www.codeproject.com/useritems/ListViewDragDropManager.asp?msg=1911611#xx1911611xx&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            return relativeTo.PointFromScreen(new Point((double)mouse.X, (double)mouse.Y));&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            #region Commented Out&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //System.Windows.Interop.HwndSource presentationSource =&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //    (System.Windows.Interop.HwndSource)PresentationSource.FromVisual( relativeTo );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //ScreenToClient( presentationSource.Handle, ref mouse );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //GeneralTransform transform = relativeTo.TransformToAncestor( presentationSource.RootVisual );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //Point offset = transform.Transform( new Point( 0, 0 ) );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            //return new Point( mouse.X - offset.X, mouse.Y - offset.Y );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;            #endregion // Commented Out&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;        }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);"&gt;}&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255); color: rgb(255, 102, 0);" /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
I have tested the drag drop of nearly 10,000 items from one listview to another and it was excellent(milliseconds).&lt;br /&gt;
There are some things that i want to say:&lt;br /&gt;
1)If u want to this to work for all SelectionModes,U'll will to do some changes or better to checks before using selectedItems property.&lt;br /&gt;
&lt;br /&gt;
2)The dragDrop between listviews will function when the two controls have same itemType(T) as the observableCollection type.&lt;br /&gt;
For any other type,U'll have do some little more coding .:P&lt;br /&gt;
&lt;br /&gt;
3)The reason for ICloneable Interface is because if u drag and drop one item two or more times to another listview,And then select that item in the other listview,U'll get some annoying behaviour of selection.&lt;br /&gt;
To Overcome that,I have used IConeable Interface for the meanwhile..&lt;br /&gt;
&lt;br /&gt;
If u have any questions regarding this code or feedback,u r most welcome.&lt;br /&gt;
&lt;br /&gt;
And do let me know if u think to make it more graceful and well written code in near future,becoz I'll have time to work on this after 1-2 months only... hopefully....:)&lt;br /&gt;
&lt;br /&gt;
&lt;br style="background-color: rgb(0, 0, 0); color: rgb(255, 255, 255);" /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129803"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129803" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/129803.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/03/02/listview-dragdrop-in-wpfmultiselect.aspx</guid>
            <pubDate>Tue, 03 Mar 2009 05:46:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/129803.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/03/02/listview-dragdrop-in-wpfmultiselect.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/129803.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to Wrap hard disk in a control?Help</title>
            <link>http://geekswithblogs.net/sonam/archive/2008/11/28/how-to-wrap-hard-disk-in-a-controlhelp.aspx</link>
            <description>Well..I am trying to index my hard disk.&lt;br /&gt;
After making an initial Index,I want to get notified from hard disk for any change in the file system on any drive whatsoever (Removable media not into account).The hard disk will notify a background  running windows service(of my app) for event like file moved,copied,deleted,created etc.&lt;br /&gt;
U can say,i want to make my hard disk a control like a button which fires event when clicked.Using Windows Indexing Service would be an overkill.&lt;br /&gt;
Any suggestions or ideas or alternates if somebody have in mind.:)&lt;br /&gt;
I would be very thankful to u.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127436"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127436" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/127436.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2008/11/28/how-to-wrap-hard-disk-in-a-controlhelp.aspx</guid>
            <pubDate>Fri, 28 Nov 2008 17:38:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/127436.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2008/11/28/how-to-wrap-hard-disk-in-a-controlhelp.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/127436.aspx</wfw:commentRss>
        </item>
        <item>
            <title>algo for kth smallest no .</title>
            <link>http://geekswithblogs.net/sonam/archive/2008/11/24/algo-for-kth-smallest-no.aspx</link>
            <description>&lt;strong&gt;W&lt;/strong&gt;ell,I am trying hard to get an internship preferably from Microsoft and that too  in US..&lt;br /&gt;
Now a days, i am trying to build an Impressive  portfolio..But these end semester exams have really made my pace a little slow towards doing some creative things.&lt;br /&gt;
Anyways,I was reading up some Interview experiences of Interns at Microsoft..In that i got a question,:&lt;br /&gt;
Ques:&lt;strong&gt;"Finding the  kth smallest element in a given unsorted sequence of nos."?&lt;/strong&gt;&lt;br /&gt;
The intern answered that we can sort and then find that kth no.&lt;br /&gt;
Well this might be right but has flaw, when  all the nos in the array are not distinct.&lt;br /&gt;
But the Interviewer emphasized on doing &lt;em&gt;without sorting.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Well,I thought to give it   a shot.This question was already asked by my prof  of DAA (Data Analysis And Algo)in Internal viva to someone but he was expecting a conventional answer of some steps of Randomised sort etc.&lt;br /&gt;
No one knew the steps ,neither they tried to think for some method.&lt;br /&gt;
I thought to give this question a shot and within few minutes  i  invented  a nice algo.&lt;br /&gt;
A nice algo becoz it works for every sequence,a recursive procedure   and it was invented by me in few minutes.Maybe ,someone had already knew this but atleast i didn't knew anything before(my ignorance)..&lt;img alt="" src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: rgb(255, 153, 0);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;class KthSmallestElement&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;     {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        static int highest; //Maximum Element Among all the numbers in the sequence&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        static int smallest;    //Smallest number among all the numbers in sequence&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        static int i = 1;        //Index which stores the Last position in  sorted array &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// The algo is :&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// At each call to method,we  find the smallest no which is not in the sorted array.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// Since,The sorted array is initialized with smallest number in the sequence,&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// the method goes on finding next smaller numbers until the length of array reaches  k.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// Finally,we have a sorted array which contains all the elements of sequence sorted upto kth position.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// but sorted array have all distinct numbers.&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        /// &amp;lt;param name="sequence"&amp;gt;unsorted "sequence" of numbers&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        /// &amp;lt;param name="sortArray"&amp;gt;A temporary array "sortarray"&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;        /// &amp;lt;param name="k"&amp;gt;the kth position&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;       static void KthElement(int[] sequence, int[] sortArray, int k)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;            int  minimum=highest ;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             foreach (int number in sequence)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                 if (minimum &amp;gt; number &amp;amp;&amp;amp; !sortArray.Contains(number))&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                 {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                     minimum = number;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                     &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                 }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             sortArray[i] = minimum; &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             i++;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             if ((i) != k)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;                 KthElement(sequence, sortArray, k);               //Recursive call to find kth lement until sortarray contains k sorted elements  &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;     &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;              &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         static void Main(string[] args)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;           &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             int[] sequence = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,19,110 };&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             int[] sortArray=new int[sequence.Length];&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             highest = 110;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             smallest = 1;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             sortArray[0] = smallest;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;            &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             KthSmallestElement.KthElement(sequence, sortArray, 20);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             foreach(int no in sortArray)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             Console.WriteLine(no);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;             Console.WriteLine("The 20th smallest No is : " + sortArray[i-1]);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;         }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;     &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;     }&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127343"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127343" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sonam/aggbug/127343.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2008/11/24/algo-for-kth-smallest-no.aspx</guid>
            <pubDate>Mon, 24 Nov 2008 15:56:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/127343.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2008/11/24/algo-for-kth-smallest-no.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/127343.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>