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.

How to simulate C++ friend in C# and VB.NET? -


because sometimes, need friend.

i can think of following tricks:

  1. read wrapper - readonlycollection. friend keeps pointer modifiable object, while else can access wrapper.
  2. write delegate - friend gives constructor of object reference delegate 1 of parameters, constructor fills address private method can used modify object.
  3. reflection - bad idea. included completeness.
  4. multiple assemblies - put friends in separate assembly , set modifier methods internal.
  5. expose modifiable object, add comments modifier methods "this infrastructure method - don't call it!"
  6. nested classes.
  7. add system.componentmodel.editorbrowsable(system.componentmodel. editorbrowsablestate.never) attribute member want friend access hide intellisense.
  8. implicit interface implementation - see comments.

is list exhaustive? can sort these in order of decreasing performance? order of decreasing neatness? suggestions when use which?

you can use internalsvisibleto attribute.

for given assembly, a, can specify other assemblies can have access a's internal types.


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 -