Jun 15, 2009, 9:40 AM
Inheritance: Modifications to provide a complete extension
Hello guys,
Coolite it's a great work in several aspects. Nice job.
I've started using at version 0.7.
Actually, i'm extending Coolite GridPanel (already v 0.8) and notice that it's not possible the correct reuse of coolite
javascripts (the new folder structure separation at v0.8 it's a great help for development) without a little modifications.
First -> Attributes.cs (Added AttributeUsage for correct drill through base types performed by Type.GetCustomAttributes)
Coolite it's a great work in several aspects. Nice job.
I've started using at version 0.7.
Actually, i'm extending Coolite GridPanel (already v 0.8) and notice that it's not possible the correct reuse of coolite
javascripts (the new folder structure separation at v0.8 it's a great help for development) without a little modifications.
First -> Attributes.cs (Added AttributeUsage for correct drill through base types performed by Type.GetCustomAttributes)
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class ClientScriptAttribute : ResourceAttribute
Second -> WebControl_Helpers.cs public List<T> GetCustomResourceAttributes<T>() where T : ResourceAttribute
{
object[] items = this.GetType().GetCustomAttributes(typeof(T), true);
List<T> list = new List<T>();
foreach (object item in items)
{
// Little "sort" operation to ensure that 'Coolite' resources figure at top at partial dependencies list
int position = list.Count;
if (((T)item).WebResource.Contains(ScriptManager.ASSEMBLYSLUG))
position = 0;
list.Insert(position, (T)item);
}
return list;
}
Please verify these and notify if i performed a wrong modification