Example #1
0
        private IEnumerable <StandardizedResourceProfileData> GetStandardizedResourceProfileData()
        {
            if (ProjectHasProfileDefinition)
            {
                return(ProfileResourceNamesProvider
                       .GetProfileResourceNames()
                       .Select(prn => prn.ProfileName)
                       .Distinct()
                       .Select(
                           profileName =>
                           ProfileResourceModelProvider.GetProfileResourceModel(profileName))
                       .SelectMany(
                           prm => prm.Resources.Select(
                               pct =>
                               new StandardizedResourceProfileData
                {
                    Readable = pct.Readable, Writable = pct.Writable, ProfileName = prm.ProfileName
                }))
                       .OrderBy(spd => spd.ProfileName.ToLower())
                       .ThenBy(x => x.ResolvedResource.Name));
            }

            return(ResourceModelProvider.GetResourceModel()
                   .GetAllResources()
                   .Where(r => !r.IsAbstract() && TemplateContext.ShouldRenderResourceClass(r))
                   .OrderBy(x => x.Name)
                   .Select(
                       resource =>
                       new StandardizedResourceProfileData
            {
                Readable = resource, Writable = resource, ProfileName = null
            })
                   .OrderBy(x => x.ResolvedResource.Name));
        }
 private IEnumerable <ProfileResourceModel> GetProfileResourceModels()
 {
     return(ProfileResourceNamesProvider
            .GetProfileResourceNames()
            .Select(prn => prn.ProfileName)
            .Distinct()
            .Select(
                profileName =>
                ProfileResourceModelProvider.GetProfileResourceModel(profileName)));
 }