public class RollingList <T> : ICollection <T> { #region Private Fields private int _capacity; private LinkedList <T> _linkedList; #endregion #region Constructors public RollingList( int capacity) { _capacity = capacity; _linkedList...
ManagementObjectSearcher searcher = new ManagementObjectSearcher ( "SELECT * FROM Win32_SerialPort" ); foreach ( ManagementObject obj in searcher.Get()) { Console .WriteLine(obj[ "DeviceID" ].ToString()); }
There a lot of things to think about when it comes to serializing static fields, how it will be stored, how it will be reinstated, duplication of data, and design. Although, it usually is a sign of bad design if you are trying to serialize static fields...
Have you ever been developing a Windows Forms application, and then somewhere in the form you want to create a new Timer (System.Threading). When you do this you run into a ambiguous reference problem because System.Windows.Forms already contains definition...
I have seen a lot of code lately using "is" instead of "as". I just want to get the word out there that it is much better to use "as" as it is more efficient. For example, here's a sample code post using "is"...