internal static StageCategory[] GetStageCategories <T>(this T component) where T : IBaseComponent, IPersistPropertyBag { component.EnsureIsPipelineComponent(); var stageCategories = component.GetType().GetCustomAttributes(typeof(ComponentCategoryAttribute), false) .Cast <ComponentCategoryAttribute>() .Where(a => StageCategory.IsKnownCategoryId(a.Category)) .Select(a => StageCategory.FromKnownCategoryId(a.Category)) .ToArray(); if (!stageCategories.Any()) { throw new ArgumentException( string.Format( "{0} has not been associated with a pipeline stage category. Apply the ComponentCategoryAttribute with one of the stage categories available through {1}.", component.GetType().Name, typeof(CategoryTypes).FullName)); } return(stageCategories); }
internal Stage(Guid categoryId, PipelinePolicy pipelinePolicy) { Category = StageCategory.FromKnownCategoryId(categoryId); StagePolicy = pipelinePolicy.Stages.Cast <StagePolicy>().Single(s => new Guid(s.StageIdGuid) == Category.Id); Components = new ComponentList(this); }
internal Stage(Guid categoryId) { Category = StageCategory.FromKnownCategoryId(categoryId); Components = new ComponentList(this); }