Randy Patterson

Code To Live, Live To Code

  • Home
  • About

12

Mar

ReSharper and the Method Group Refactor

Posted by randypatterson  Published in C#, ReSharper

While writing code similar to the following lines, ReSharper suggested the “Replace With Method Group” Refactoring for Line 2.
 

1: var names = Directory.GetFiles(@"c:\Program Files").ToList();

2: names.ForEach(n => Console.WriteLine(n));

The Method Group shorthand is usually found in places where you take the following code
myButton.Click += new EventHandler(myButton_Click);
and replace it with this.

myButton.Click [...]

Bookmark It

Add to Del.icio.us Add to digg Add to DotNetKicks Add to DZone
Add to Google Bookmarks Add to reddit Add to Slashdot Add to Stumble Upon
Add to Technorati Add to Twitter Add to Yahoo My Web

Continue reading...

no comment

RSS

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Tags

Azure CodeCamp IoC Podcast Presentation ReSharper TFS Unit Test Unity VS2010

Categories

  • C# (8)
  • Deals (2)
  • Events (11)
  • Patterns (4)
  • Podcast (5)
  • ReSharper (3)
  • TFS (1)
  • Uncategorized (7)
  • Unit Tests (1)
  • Unity Application Block (7)
  • What Burns Me (1)

Recent Posts

  • Support The National Day of Prayer
  • ReSharper and the Method Group Refactor
  • Moved my Blog
  • Installing VS 2010 in XP Mode
  • TFS Basic Version

Twitter

  • Die database project die; may you and your offspring be eternally deadlocked.-1 day ago
  • time to read this series RT @blastr: King's Dark Tower being turned into massive TV/film series http://bit.ly/9eyzQn-1 day ago
  • RT @MSPlatformReady: Microsoft SharePoint Could be a 2 Billion Dollar Business - http://bit.ly/dbauvR #SharePoint-1 day ago
  • Watching american pickers, <3 that show-1 day ago
  • VS Database Project.....I spit in your general direction-1 day ago
  • can they get a GPS signal down there? RT @physorg_com: Male fish refuse to ask for directions http://tw.physorg.com/203056102-2 days ago
  • finally something worthy of news RT @blastr: Guy who wrote 'Jump the Shark' episode finally speaks out http://bit.ly/bIC1X2-2 days ago
  • If I have to know how the internals of a tool work so I can correct issues it creates then it's not a tool it is an impediment.-2 days ago

Comments

  • Schalk on Lazy Instantiation with Unity Application Block
  • olegsych on Moved my Blog
  • Ed Holloway on TFS Basic Version
  • Jeff P on The Power of the Predicate<T>
  • Jeff Odell on Beginning ReSharper

Recent Entries

  • Support The National Day of Prayer
  • ReSharper and the Method Group Refactor
  • Moved my Blog
  • Installing VS 2010 in XP Mode
  • TFS Basic Version
  • Windows Azure Commercial Release this year!
  • Orlando Code Camp 2009 – Unity Presentation Slides and Code
  • Speaking at the South Florida Code Camp
  • Call for Speakers
  • Beginning ReSharper
  • Random Selection of Posts

    • Support The National Day of Prayer
    • Beginning ReSharper
    • Lazy Instantiation with Unity Application Block
    • Tampa Bay International Association of Software Architects (IASA) Monthly Meeting
    • Tampa Bay International Association of Software Architects Newsletter – January 2008
    • International Association of Software Architects, Tampa Chapter
    • Alt.NET Podcast Launched!
© 2008 Randy Patterson. WordPress. Free email sender software
Theme designing by Mark Hoodia