AddClassAttribute( SecurityElement element, Type type, String typename )
{
// Replace any quotes with apostrophes so that we can include quoted materials
// within classnames. Notably the assembly name member 'loc' uses a quoted string.
// NOTE: this makes assumptions as to what reflection is expecting for a type string
// it will need to be updated if reflection changes what it wants.
if ( typename == null )
typename = type.FullName;
BCLDebug.Assert( type.FullName.Equals( typename ), "Incorrect class name passed! Was : " + typename + " Shoule be: " + type.FullName);
element.AddAttribute( "class", typename + ", " + type.Module.Assembly.FullName.Replace( '\"', '\'' ) );
}