private void _addFilter(CswNbtViewEditorData Return) { CswNbtViewRelationship parent = (CswNbtViewRelationship)CurrentView.FindViewNodeByArbitraryId(Request.Property.ParentArbitraryId); CswNbtViewRoot.forEachRelationship eachRel = relationship => { if (parent.SecondId == relationship.SecondId) { CswNbtViewProperty viewProp = relationship.Properties.FirstOrDefault(vp => vp.Name == Request.Property.Name); if (null != viewProp) { if (false == _hasFilter(viewProp)) { CurrentView.AddViewPropertyFilter(viewProp, Conjunction: (CswEnumNbtFilterConjunction)Request.FilterConjunction, SubFieldName: (CswEnumNbtSubFieldName)Request.FilterSubfield, FilterMode: (CswEnumNbtFilterMode)Request.FilterMode, Value: Request.FilterValue); } } else { ICswNbtMetaDataProp Prop = null; if (Request.Property.Type.Equals(CswEnumNbtViewPropType.NodeTypePropId)) { Prop = _CswNbtResources.MetaData.getNodeTypeProp(Request.Property.NodeTypePropId); } else if (Request.Property.Type.Equals(CswEnumNbtViewPropType.ObjectClassPropId)) { Prop = _CswNbtResources.MetaData.getObjectClassProp(Request.Property.ObjectClassPropId); } CurrentView.AddViewPropertyAndFilter(relationship, Prop, Value: Request.FilterValue, Conjunction: Request.FilterConjunction, SubFieldName: (CswEnumNbtSubFieldName)Request.FilterSubfield, FilterMode: (CswEnumNbtFilterMode)Request.FilterMode, ShowInGrid: false // the user is filtering on a prop not in the grid, don't show it in the grid ); } } }; CurrentView.Root.eachRelationship(eachRel, null); _getFilters(Return, CurrentView); HashSet <string> seenRels = new HashSet <string>(); CswNbtViewRoot.forEachRelationship eachRelationship = relationship => { if (false == seenRels.Contains(relationship.TextLabel)) { seenRels.Add(relationship.TextLabel); Return.Step4.Relationships.Add(relationship); } }; CurrentView.Root.eachRelationship(eachRelationship, null); Return.Step4.ViewJson = CswConvert.ToString(CurrentView.ToJson()); }