<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>C#</title>
        <link>http://geekswithblogs.net/sonam/category/9259.aspx</link>
        <description>C#</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>Capturing optional groups in regular expressions?</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/12/24/capturing-optional-groups-in-regular-expressions.aspx</link>
            <description>&lt;p&gt;  string input =&lt;span style="color: #ff6600"&gt; @"cool  man dog no dude yes fight son";&lt;/span&gt;&lt;br /&gt;
  string pattern = &lt;span style="color: #ff6600"&gt;@"cool (?&amp;lt;hello&amp;gt;((.)* ))   (?&amp;lt;h&amp;gt;( (dude)?)) (?(h)(?&amp;lt;dude&amp;gt;((.)*)))";&lt;/span&gt;&lt;br /&gt;
            &lt;br /&gt;
       MatchCollection matches = Regex.Matches(input, pattern, RegexOptions.ExplicitCapture&lt;br /&gt;
              | RegexOptions.IgnorePatternWhitespace);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
            foreach (Match match in matches)&lt;br /&gt;
            {&lt;br /&gt;
                Console.WriteLine("dude=" + match.Groups["dude"].Value);&lt;br /&gt;
                Console.WriteLine("hello=" + match.Groups["hello"].Value);&lt;br /&gt;
                Console.ReadLine();&lt;br /&gt;
            }&lt;br /&gt;
/*Output-&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
dude=&lt;br /&gt;
hello=  man dog no dude yes fight son&lt;/p&gt;
&lt;p&gt;*/&lt;/p&gt;
&lt;p&gt;But the required output is:&lt;/p&gt;
&lt;p&gt;/*Output-&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
dude=yes fight son&lt;br /&gt;
hello=  man dog no&lt;/p&gt;
&lt;p&gt;*/&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
The target is that i want to capture "strings that have cool as first 'word'  and have 'dude' word as optional in between".&lt;br /&gt;
Now,I want string that follows word "cool" ("man dog no") until "dude" word comes or end comes.&lt;br /&gt;
if "dude" word comes,I want the string that follows word "dude".&lt;/p&gt;
&lt;p&gt;Can anybody explain me why the output is not correct or where i am wrong?&lt;br /&gt;
Thanks in advance.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sonam/aggbug/137214.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/12/24/capturing-optional-groups-in-regular-expressions.aspx</guid>
            <pubDate>Thu, 24 Dec 2009 19:05:21 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/137214.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/12/24/capturing-optional-groups-in-regular-expressions.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/137214.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Setting "WindowStyle=None" hides taskbar on maximizing</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/07/21/setting-windowstylenone-hides-taskbar-on-maximizing.aspx</link>
            <description>&lt;br /&gt;
If you ever tried to make irregular windows in wpf and used setting windowstyle=none,You might have used some code like this to enable minimising,maximising properties for the window:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 102, 0);"&gt;        private void Minimize_Click(object sender, RoutedEventArgs e)&lt;/span&gt;&lt;br style="color: rgb(255, 102, 0);" /&gt;
&lt;span style="color: rgb(255, 102, 0);"&gt;        {&lt;/span&gt;&lt;br style="color: rgb(255, 102, 0);" /&gt;
&lt;br style="color: rgb(255, 102, 0);" /&gt;
&lt;span style="color: rgb(255, 102, 0);"&gt;            this.WindowState = WindowState.Minimized;&lt;/span&gt;&lt;br style="color: rgb(255, 102, 0);" /&gt;
&lt;br style="color: rgb(255, 102, 0);" /&gt;
&lt;span style="color: rgb(255, 102, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;
&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;span style="color: rgb(255, 0, 0);"&gt;        private void Maximize_Click(object sender, RoutedEventArgs e)&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;span style="color: rgb(255, 0, 0);"&gt;        {&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;span style="color: rgb(255, 0, 0);"&gt;            this.WindowState = WindowState.Maximized;&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;br style="color: rgb(255, 0, 0);" /&gt;
&lt;span style="color: rgb(255, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
But on maximizing  ,the window hides the taskbar.i.e it goes fullscreen.&lt;br /&gt;
To avoid that issue,You can use this code and yes,it works like a charm.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/llobo/archive/2006/08/01/Maximizing-window-_2800_with-WindowStyle_3D00_None_2900_-considering-Taskbar.aspx"&gt;http://blogs.msdn.com/llobo/archive/2006/08/01/Maximizing-window-_2800_with-WindowStyle_3D00_None_2900_-considering-Taskbar.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-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;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;
&lt;pre class="code"&gt;    public override void OnApplyTemplate()&lt;br /&gt;        {&lt;br /&gt;            System.IntPtr handle = (new WinInterop.WindowInteropHelper(this)).Handle;&lt;br /&gt;            WinInterop.HwndSource.FromHwnd(handle).AddHook(new WinInterop.HwndSourceHook(WindowProc));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static System.IntPtr WindowProc(&lt;br /&gt;              System.IntPtr hwnd,&lt;br /&gt;              int msg,&lt;br /&gt;              System.IntPtr wParam,&lt;br /&gt;              System.IntPtr lParam,&lt;br /&gt;              ref bool handled)&lt;br /&gt;        {&lt;br /&gt;            switch (msg)&lt;br /&gt;            {&lt;br /&gt;                &lt;font style="background-color: rgb(255, 255, 0);"&gt;&lt;font color="#000000"&gt;case 0x0024:&lt;/font&gt;&lt;span style="font-size: 10pt; color: green; font-family: Consolas;"&gt;&lt;font color="#000000"&gt;/* WM_GETMINMAXINFO */&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;                    WmGetMinMaxInfo(hwnd, lParam);&lt;br /&gt;                    handled = true;&lt;br /&gt;                    break;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            return (System.IntPtr)0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static void WmGetMinMaxInfo(System.IntPtr hwnd, System.IntPtr lParam)&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;            MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO));&lt;br /&gt;&lt;br /&gt;            &lt;font color="#000000" style="background-color: rgb(255, 255, 0);"&gt;// Adjust the maximized size and position to fit the work area of the correct monitor&lt;br /&gt;&lt;/font&gt;            int MONITOR_DEFAULTTONEAREST =0x00000002;&lt;br /&gt;            System.IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);&lt;br /&gt;&lt;br /&gt;            if (monitor != System.IntPtr.Zero)&lt;br /&gt;            {&lt;br /&gt;                &lt;br /&gt;                MONITORINFO monitorInfo = new MONITORINFO();&lt;br /&gt;                GetMonitorInfo(monitor, monitorInfo);&lt;br /&gt;                RECT rcWorkArea = monitorInfo.rcWork;&lt;br /&gt;                RECT rcMonitorArea = monitorInfo.rcMonitor;&lt;br /&gt;                mmi.ptMaxPosition.x = Math.Abs(rcWorkArea.left - rcMonitorArea.left);&lt;br /&gt;                mmi.ptMaxPosition.y = Math.Abs(rcWorkArea.top - rcMonitorArea.top);&lt;br /&gt;                mmi.ptMaxSize.x = Math.Abs(rcWorkArea.right - rcWorkArea.left);&lt;br /&gt;                mmi.ptMaxSize.y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            Marshal.StructureToPtr(mmi, lParam, true);&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;As seen above the code basically handles the &lt;span style="font-size: 10pt; color: green; font-family: Consolas;"&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;WM_GETMINMAXINFO&lt;/strong&gt;&lt;/font&gt; &lt;/span&gt;message. The sample project code is also included. Have Fun. :)&lt;/p&gt;
&lt;p mce_keep="true"&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: A better way to get the handle to the window is to use the SourceInitialized event. This would also avoid calling ApplyTemplate everytime the window template is changedon the fly. Thanks to Hamid for pointing out the better solution. The attached project is now updated.&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;win.SourceInitialized +=&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;new&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font size="2" color="#008080"&gt;EventHandler&lt;/font&gt;&lt;font size="2"&gt;(win_SourceInitialized);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" color="#0000ff"&gt;void&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;win_SourceInitialized(&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;object&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font size="2" color="#008080"&gt;EventArgs&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;e)&lt;br /&gt;
{&lt;br /&gt;
   System.&lt;/font&gt;&lt;font size="2" color="#008080"&gt;IntPtr&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;handle = (&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;new&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;WinInterop.&lt;/font&gt;&lt;font size="2" color="#008080"&gt;WindowInteropHelper&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;this&lt;/font&gt;&lt;font size="2"&gt;)).Handle;&lt;br /&gt;
   WinInterop.&lt;/font&gt;&lt;font size="2" color="#008080"&gt;HwndSource&lt;/font&gt;&lt;font size="2"&gt;.FromHwnd(handle).AddHook(&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;new&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;WinInterop.&lt;/font&gt;&lt;font size="2" color="#008080"&gt;HwndSourceHook&lt;/font&gt;&lt;font size="2"&gt;(WindowProc));&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt; &lt;img src="http://geekswithblogs.net/sonam/aggbug/133639.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/07/21/setting-windowstylenone-hides-taskbar-on-maximizing.aspx</guid>
            <pubDate>Wed, 22 Jul 2009 11:49:48 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/133639.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/07/21/setting-windowstylenone-hides-taskbar-on-maximizing.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/133639.aspx</wfw:commentRss>
        </item>
        <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;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>I am gonna win this contest</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/07/21/i-am-gonna-win-this-contest.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="font-family: -webkit-monospace; font-size: 13px; white-space: pre-wrap;" class="Apple-style-span"&gt;Hii guys,&lt;br /&gt;
Just heard about this &lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://www.code7contest.com/"&gt;https://www.code7contest.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you have  a little experience with MS .Net and you are as empty as me,Have a look over it.&lt;br /&gt;
&lt;br /&gt;
The prizes are awesome and mouth watering .You will have to grasp a little about the windows 7 techonolgies though .But you can do that for atleast 17777$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am getting ready with a killer app idea..yes it  is a a killer idea,Either it will Kill MS or my Laptop.lol!(Sorry bill,its a metaphor,don't take it serious.)&lt;br /&gt;
&lt;br /&gt;
And the best thing is that ,My Last 2-3 months of WPF experience is what gonna be tested.&lt;br /&gt;
The deadline is short but thats good for me ,I am entering with an optimistic mind,Hope to see you guys at LA soon..&lt;br /&gt;
&lt;br /&gt;
cheer with a beer.(I don't drink though)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;img src="http://geekswithblogs.net/sonam/aggbug/133616.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/07/21/i-am-gonna-win-this-contest.aspx</guid>
            <pubDate>Tue, 21 Jul 2009 19:57:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/133616.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/07/21/i-am-gonna-win-this-contest.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/133616.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;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>Extracting Album art  from An Audio File</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/06/11/extracting-album-from-an-audio-file.aspx</link>
            <description>I have moved the tagging features for my media player application from MediaInfo to taglib-sharp.&lt;br /&gt;
because taglib-sharp provides writing of tags back to audio files too..&lt;br /&gt;
As a matter of fact,&lt;br /&gt;
Everything else was fine but,it took me whole half day to figure out how to display an image (album art) from taglib-sharp.&lt;br /&gt;
&lt;br /&gt;
I thought to finally post this workaround.&lt;br /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;     TagLib.File file = TagLib.File.Create((FilePath); //FilePath is the audio file location&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;                 TagLib.IPicture pic=file.Tag.Pictures[0];  //pic contains data for image.&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;                 MemoryStream stream = new MemoryStream(pic.Data.Data);  /create an in memory stream&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;               Image im = new Image();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;               BitmapFrame bmp = BitmapFrame.Create(stream);&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt;               im.Source = bmp;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255);" /&gt;
&lt;span style="color: rgb(51, 102, 255);"&gt; &lt;/span&gt;now u can use this image as a normal image..:)..i.e transformation,animation should be possible as usual.&lt;br /&gt;
&lt;br /&gt;
cheers, i didn't  got any  post on web till now even after searching Novell's Repositories..Hopefully it helps to somebody out there .&lt;br /&gt;
&lt;br /&gt;
            &lt;br /&gt;
  &lt;img src="http://geekswithblogs.net/sonam/aggbug/132745.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/06/11/extracting-album-from-an-audio-file.aspx</guid>
            <pubDate>Thu, 11 Jun 2009 15:27:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/132745.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/06/11/extracting-album-from-an-audio-file.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/132745.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;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>Awesome way to support plugins/AddIns in your applications</title>
            <link>http://geekswithblogs.net/sonam/archive/2009/04/14/awesome-way-to-support-pluginsaddins-in-your-applications.aspx</link>
            <description>Hey all,&lt;br /&gt;
I can't imagine how easy it can be to develop and maintain a plugin architecture with System.AddIn and this tool &lt;br /&gt;
VSPipelineBuilder.. This is a visual studio addIn is an open source  project by the ClrAddIn team and is really awesome.&lt;br /&gt;
&lt;br /&gt;
U just define an interface/Contract and rest of the things, just a single click through that addIn.&lt;br /&gt;
AddIn will implement that  Interface and thats it,u can use it..Cheers .........&lt;br /&gt;
&lt;br /&gt;
I used it for first defining a single interface .and implemented a small AddIn.&lt;br /&gt;
.&lt;br /&gt;
then i added 2-3 interfaces and re executed that VSPipeline Builder AddIn..And it was awesome to see that every project in The Pipeline(4-5 projects) got updated accordingly.&lt;span style="color: rgb(255, 0, 0);"&gt;My old AddIn was still working  becoz its contract was still there..&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);" /&gt;
And iwas ready to implement new AddIns..Really great...It can save a lot of time when u have a lot of contracts to support various plugins/AddIns.&lt;br /&gt;
Below is a screenshot of an excellent demo app from jesse kaplan:&lt;br /&gt;
&lt;br /&gt;
It demonstrates visual addIn also(Passing UI objects between AddIn and host)&lt;br /&gt;
ClrAddIn Team blogs at:&lt;br /&gt;
http://blogs.msdn.com/clraddins/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://blogs.msdn.com/photos/clr_add-in_team/images/4265273/original.aspx" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
U can download the VSPipeline Builder from here:&lt;br /&gt;
&lt;br /&gt;
http://clraddins.codeplex.com/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cheers,And thanx to Jesse kaplan and the whole ClrAddIn team.&lt;br /&gt; &lt;img src="http://geekswithblogs.net/sonam/aggbug/130959.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2009/04/14/awesome-way-to-support-pluginsaddins-in-your-applications.aspx</guid>
            <pubDate>Tue, 14 Apr 2009 17:53:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/130959.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2009/04/14/awesome-way-to-support-pluginsaddins-in-your-applications.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/130959.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>&lt;p&gt;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;/p&gt;
&lt;p&gt;&lt;font color="#ff00ff"&gt;A small project which shows demo,U can download it from here:..the code might differ a little bit but the theme remains same,,..:)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff00ff"&gt;&lt;a href="http://rapidshare.com/files/306026760/Listview.zip.html"&gt;http://www.rapidshare.com/files/306026760/Listview.zip.html&lt;/a&gt;&lt;br /&gt;
&lt;/font&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;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>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/129803.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Static methods in Interface</title>
            <link>http://geekswithblogs.net/sonam/archive/2008/12/18/static-methods-in-interface.aspx</link>
            <description>I was trying to implement an Interface by a class but i wanted to have static methods.&lt;br /&gt;
But C# doesn't allow static methods in interface.&lt;br /&gt;
After a little search,I got "why We can't have static methods in Interfaces".&lt;br /&gt;
suppose i have an interface,&lt;br /&gt;
&lt;span style="background-color: rgb(204, 255, 255);"&gt; &lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 255);" /&gt;
&lt;span style="background-color: rgb(204, 255, 255);"&gt; interface IDemo&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 255);" /&gt;
&lt;span style="background-color: rgb(204, 255, 255);"&gt;            {&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 255);" /&gt;
&lt;span style="background-color: rgb(204, 255, 255);"&gt;                static void add();&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 255);" /&gt;
&lt;span style="background-color: rgb(204, 255, 255);"&gt;            }&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 255);" /&gt;
      Now we implement it:&lt;br /&gt;
&lt;br /&gt;
 &lt;span style="background-color: rgb(255, 102, 0);"&gt;&lt;span style="background-color: rgb(204, 255, 204);"&gt;class MyClass:IDemo&lt;/span&gt;&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;        {&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;            static void add()&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;            {&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;                Console.WriteLine("Added");&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;            }&lt;/span&gt;&lt;br style="background-color: rgb(204, 255, 204);" /&gt;
&lt;span style="background-color: rgb(204, 255, 204);"&gt;        }&lt;/span&gt;&lt;br /&gt;
Pretty cool na.&lt;br /&gt;
But it won't compile.&lt;br /&gt;
because what if  &lt;span style="background-color: rgb(0, 204, 255);"&gt;IDemo.add();&lt;/span&gt;&lt;br /&gt;
To avoid this ambiguity,&lt;br /&gt;
Static Methods are not allowed in Interfaces .&lt;br /&gt;
&lt;br style="background-color: rgb(255, 255, 255);" /&gt;
&lt;span style="background-color: rgb(255, 255, 255);"&gt;Note::&lt;/span&gt;
&lt;p style="background-color: rgb(255, 255, 255); color: rgb(255, 0, 0);"&gt;Although not implemented in C# the CLR does support static methods on interfaces. The drawback is that from C# you'd have to invoke them using reflection.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sonam/aggbug/128053.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sonam</dc:creator>
            <guid>http://geekswithblogs.net/sonam/archive/2008/12/18/static-methods-in-interface.aspx</guid>
            <pubDate>Fri, 19 Dec 2008 06:03:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sonam/comments/128053.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sonam/archive/2008/12/18/static-methods-in-interface.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sonam/comments/commentRss/128053.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
