예제 #1
0
        public ViewSpecList Filter(Func <ViewSpec, bool> viewPredicate)
        {
            var viewSpecs     = ImmutableList.ValueOf(ViewSpecs.Where(viewPredicate));
            var viewSpecNames = new HashSet <string>(viewSpecs.Select(viewSpec => viewSpec.Name));

            return(new ViewSpecList(viewSpecs, ViewLayouts.Where(layout => viewSpecNames.Contains(layout.ViewName))));
        }
예제 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((ViewSpecs.GetHashCode() * 397) ^ ViewLayouts.GetHashCode());
     }
 }
예제 #3
0
 public ViewSpec GetView(string name)
 {
     return(ViewSpecs.FirstOrDefault(viewSpec => viewSpec.Name == name));
 }
예제 #4
0
 public ViewSpecList FilterRowSources(ICollection <string> rowSources)
 {
     return(new ViewSpecList(ViewSpecs.Where(viewSpec => rowSources.Contains(viewSpec.RowSource))));
 }
예제 #5
0
        public ViewSpecList DeleteViews(IEnumerable <string> names)
        {
            var nameSet = names as HashSet <string> ?? new HashSet <string>(names);

            return(new ViewSpecList(ViewSpecs.Where(spec => !nameSet.Contains(spec.Name))));
        }