Is it possible to override a class?

2011-04-28 Thread Anthony
Is it possible to override a entire class? I know I can create new class and inherit from another but what if I want to override the functionality of winform control in my whole application..do I have to change the declaration everywhere? Can I achieve this another way? Say I wanted to make all t

RE: Is it possible to override a class?

2011-04-28 Thread Greg Keogh
Anthony, it sounds like you do actually want to derive a new class. A control is just a class. In large WinForm apps I usually create FooLabel, FooButton, FooPanel, etc classes and use them in place of the usual base classes. My FooLabel could detect a settings change for example and they would all

RE: Is it possible to override a class?

2011-04-28 Thread Anthony
April 2011 5:40 AM To: 'ozDotNet' Subject: RE: Is it possible to override a class? Anthony, it sounds like you do actually want to derive a new class. A control is just a class. In large WinForm apps I usually create FooLabel, FooButton, FooPanel, etc classes and use them in place of

RE: Is it possible to override a class?

2011-04-28 Thread Ben.Robbins
Refactoring like this is where R# really pays its way... From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Anthony Sent: Friday, 29 April 2011 8:02 AM To: 'ozDotNet' Subject: RE: Is it possible to override a cl

Re: Is it possible to override a class?

2011-04-28 Thread Hoss Ravanparsa
11 8:02 AM > > *To:* 'ozDotNet' > *Subject:* RE: Is it possible to override a class? > > Greg...that’s what i was afraid of...yeh..good idea..will create my own > toolbox with derived controlsmmm...now i have to do a search and replace > on my current project J >

Re: Is it possible to override a class?

2011-04-28 Thread David Burstin
zdotnet-boun...@ozdotnet.com [mailto: >> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Anthony >> *Sent:* Friday, 29 April 2011 8:02 AM >> >> *To:* 'ozDotNet' >> *Subject:* RE: Is it possible to override a class? >> >> Greg...that’s what i was afra

Re: Is it possible to override a class?

2011-04-28 Thread Noon Silk
> R#? He's talking about Resharper; some people use it to correct design mistakes. I think there is an easier approach :P -- Noon Silk http://dnoondt.wordpress.com/  (Noon Silk) | http://www.mirios.com.au:8081 > Fancy a quantum lunch? http://www.mirios.com.au:8081/index.php?title=Quantum_Lunch

RE: Is it possible to override a class?

2011-04-28 Thread Chris Walsh
Yes, it's to use CodeRush http://devexpress.com/crx -Original Message- From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Noon Silk Sent: Friday, 29 April 2011 11:00 AM To: ozDotNet Subject: Re: Is it possible to override a class? > R

Re: Is it possible to override a class?

2011-04-28 Thread Hoss Ravanparsa
now i have to do a search and replace >>> on my current project J >>> >>> >>> >>> *From:* ozdotnet-boun...@ozdotnet.com [mailto: >>> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Greg Keogh >>> *Sent:* Friday, 29 April 2011 5:40 AM >

RE: Is it possible to override a class?

2011-04-28 Thread Ben.Robbins
-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Noon Silk Sent: Friday, 29 April 2011 9:00 AM To: ozDotNet Subject: Re: Is it possible to override a class? > R#? He's talking about Resharper; some people use it to correct design mistakes. I think there is a

Re: Is it possible to override a class?

2011-04-28 Thread Noon Silk
> By an easier approach I assume you mean a time machine to go back and a > crystal ball to ensure that the > people that developed the system you are now working on do everything > perfectly and with perfect anticipation > of future changes to requirements... Indeed; in Visual Studio just press

Re: Is it possible to override a class?

2011-04-28 Thread Michael Minutillo
I use Ctrl-Alt-Butterfly to do that http://xkcd.com/378/ Also, this is the price we pay for using designers. They create code that is useful for the tool, not the developer. Back in the old-school days of Java at uni we have a widget-factory that would create our controls f

Re: Is it possible to override a class?

2011-04-28 Thread Wallace Turner
erfect anticipation of future changes to requirements... -Original Message- From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Noon Silk Sent: Friday, 29 April 2011 9:00 AM To: ozDotNet Subject: Re: Is it possible to override a class? R#? He's t

Re: Is it possible to override a class?

2011-04-28 Thread Noon Silk
> Noon Silk, > > I've gathered you dislike Resharper from this post and previous posts. > Are you using an alternative? (eg CodeRush) > > I think you have stuck yourself in a corner where you've said 'i don't > like it' and wont go back on your position even if it can cure cancer. > > I would like

Re: Is it possible to override a class?

2011-04-28 Thread Grant Maw
Damn. And here I was looking forward to a good old fashioned Silky style stoush for a Friday afternoon :) On 29 April 2011 12:52, Noon Silk wrote: >> Noon Silk, >> >> I've gathered you dislike Resharper from this post and previous posts. >> Are you using an alternative? (eg CodeRush) >> >> I thin

RE: Is it possible to override a class?

2011-04-28 Thread Anthony
] On Behalf Of Noon Silk Sent: Friday, 29 April 2011 12:53 PM To: ozDotNet Subject: Re: Is it possible to override a class? > Noon Silk, > > I've gathered you dislike Resharper from this post and previous posts. > Are you using an alternative? (eg CodeRush) > > I think you h

RE: Is it possible to override a class?

2011-04-28 Thread Ben.Robbins
iday, 29 April 2011 11:09 AM To: 'ozDotNet' Subject: RE: Is it possible to override a class? How can I do a replace of all buttons with my inherited version using resharper? I have resharper but would have no idea how to do this? I assume just a search and replace or is it more cl

Re: Is it possible to override a class?

2011-04-28 Thread Mark Hurd
On 29 April 2011 13:43, wrote: > Actually in this scenario I'd just do a search and replace too. > > However Resharper can help here and what I typically do in this situation is > select a usage of the class I want to replace (e.g. "Button") and use the > "find usages" feature to find all insta

Re: Is it possible to override a class?

2011-04-28 Thread Wallace Turner
The find/replace method is OK but Resharper can go one better. Consider these three instantiations ofButton _button1 = new System.Windows.Forms.Button(); _button2 = new Button(); _button3 = new DumbAlias.Button(); So its likely you

RE: Is it possible to override a class?

2011-04-29 Thread Anthony
That excites me J thanks Wallace! From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Wallace Turner Sent: Friday, 29 April 2011 4:12 PM To: ozDotNet Subject: Re: Is it possible to override a class? The find/replace method is OK but Resharper can go

Re: Is it possible to override a class?

2011-04-29 Thread Wallace Turner
Sent: Friday, 29 April 2011 4:12 PM To: ozDotNet Subject: Re: Is it possible to override a class?   The find/replace method is OK but Resharper can go one better. Consider these three instanti

Re: Is it possible to override a class?

2011-04-29 Thread Mark Hurd
Wallace! > > > > *From:* ozdotnet-boun...@ozdotnet.com [ > mailto:ozdotnet-boun...@ozdotnet.com ] *On > Behalf Of *Wallace Turner > *Sent:* Friday, 29 April 2011 4:12 PM > *To:* ozDotNet > *Subject:* Re: Is it possible to override a class? > > >