VS 2010 snippet manager and quickCode

 

During the last few years I've used QuickCode and it was very helpful.

Visual Studio 2010 has  Code Snippets Manager that MS finally made quite convenient to use, so I will use it in a future.
 
I will need to convert my QuickCode commands to VS snippets.
I am sure I will miss Alt-Q hotkey for some time.
 
Code snippets links:

How to "cast" from generic List<> to ArrayList

We are writing new code using generic List<> , e.g. List<MyClass>.
 
However we have legacy functions, that are expect ArrayList as a parameter.
It is a second time, when I and my colleague asked, how to "cast" generic List<MyClass> to ArrayList.
The answer is simple- just use ArrayList constructor with ICollection parameter.
Note that it is not real cast, it  copies  references to ArrayList.


var list=new List<MyClass>();

//Fill list items

ArrayList al=new ArrayList(list);//"cast"- 

 
If you need opposite operation -Convert ArrayList to a Generic List,
you can filter all elements of arrayList that can be cast to the same type using Enumerable.OfType(Of TResult) Method
 
List<MyClass> typedList = arrayList.OfType<MyClass>().ToList();
 
 

 

 


 

«June»
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910