I always have a unique id in my databases for each row. When passing this to objects for javascript to manipulate I add it to the class string as ‘id_1′ so I can easily retrieve it later. The GetIds function below returns an array with the id pulled out. It also handles multiple ids in the format of ‘id_name_1′ so we can do something like ‘block id_1 id_Page_1′
Read more…
The table below is a periodically updated listing of font survey results for all platforms, the cumulative total of all valid font survey submissions since January 2004.
These figures are calculated per platform and do not show how common the fonts are on other systems. Think of it this way: More Mac systems have the Monaco font than Windows systems have Trebuchet MS.
Read more…
Defining the Flags:
To start of with, declare an enum to list all the possible flags. Two things are important when declaring the enum. The first thing you will probably notice is the [Flags] attribute. This is necessary in order to indicate that the enumeration should be treated as a set of flags. The second important thing is assigning a value to each of the items in the enum. The first value should be 1, then just double the value for each consecutive item. The integer type in .NET can store up to 32 flags. Read more…
There is a DLL called CommonAssembly. This contains a namespace called CommonNamespace. This namespace contains a class called CommonClass.
Another project adds a reference to CommonAssembly and wants to get the type of CommonClass using the method Type.GetType.
Read more…
typeof(IFoo).IsAssignableFrom(bar.GetType());
typeof(IFoo).IsAssignableFrom(typeof(BarClass));
The Type.IsAssignableFrom() method check whether a type can be assigned from another. It takes a System.Type object as argument, so if you are given a class or an instance of a class, you can use the typeof operator or the Object.GetType() method to get the corresponding System.Type object respectively. The MSDN has a clear definition of the returned value of the IsAssignableFrom() method:
Read more…