Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

visual studio 2010 - Tool for examining potential casting problems in C# -


i have following situation on hands. in project work on have abstract class a has 2 descendants, a_concrete1 , a_concrete2. these 2 around time now.

the time has come add third descendant, a_concrete3. problem is, lot of time in existing codebase you'll find that:

a instance; // ... // assignment of instance // ... if (!(a a_concrete1))   a_concrete2 = (a_concrete2)a; 

so now, when a has more 2 descendants, code broken , fail @ runtime.

my question is: how locate these situations automatically fix them? best way/tool it? tried use resharper, doesn't provide casting analysis. i'd glad hear suggestions , pointers on one.

thanks in advance

the best way have methods in (that might overridden in subclasses) , code given use call methods of a, , never cast either subclass. way won't have again.

probably find in files (the toolbar button features binoculars on file folder) best way find (a_concrete2) , is a_concrete1. don't in there , replace if bunch of ifs - change it's more appropriate base class.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -