public void BuildUp(IAttributeBuilder builder) { ((DirectorAttribute[])builder.GetType().GetCustomAttributes(typeof(DirectorAttribute), false)) .OrderByDescending(x => x.Priority) .ToList <DirectorAttribute>() .ForEach(x => InvokeBuilderPartMethod(builder, x)); }
public void BuilUp(IAttributeBuilder builder) { object[] attributes = builder.GetType().GetCustomAttributes(typeof(DirectorAttribute), false); if (attributes.Length <= 0) { return; } DirectorAttribute[] directors = new DirectorAttribute[attributes.Length]; for (int i = 0; i < attributes.Length; i++) { directors[i] = attributes[i] as DirectorAttribute; Array.Sort <DirectorAttribute>(directors); foreach (var item in directors) { InvokeBuildPartMethod(builder, item); } } }