Example #1
0
 public override IEnumerable <ClientSideQuery.NotFoundError> GetNotFoundErrors_IfThisIsTheOnlyFilter()
 {
     foreach (ClientSideQuery.PropertyValueFilter propertyValueFilter in base.PropertyValueFilters)
     {
         if (propertyValueFilter.BehaviorOnNoMatch != BehaviorOnNoMatch.ReportErrors || propertyValueFilter.HadMatch)
         {
             continue;
         }
         ClientSideQuery.PropertyValueRegularFilter propertyValueRegularFilter = (ClientSideQuery.PropertyValueRegularFilter)propertyValueFilter;
         yield return(propertyValueRegularFilter.GetGranularNotFoundError());
     }
 }
Example #2
0
            public CimInstanceRegularFilter(string propertyName, IEnumerable allowedPropertyValues, bool wildcardsEnabled, BehaviorOnNoMatch behaviorOnNoMatch)
            {
                HashSet <BehaviorOnNoMatch> behaviorOnNoMatches = new HashSet <BehaviorOnNoMatch>();

                foreach (object allowedPropertyValue in allowedPropertyValues)
                {
                    ClientSideQuery.PropertyValueFilter propertyValueRegularFilter = new ClientSideQuery.PropertyValueRegularFilter(propertyName, allowedPropertyValue, wildcardsEnabled, behaviorOnNoMatch);
                    base.AddPropertyValueFilter(propertyValueRegularFilter);
                    behaviorOnNoMatches.Add(propertyValueRegularFilter.BehaviorOnNoMatch);
                }
                if (behaviorOnNoMatches.Count != 1)
                {
                    base.BehaviorOnNoMatch = behaviorOnNoMatch;
                    return;
                }
                else
                {
                    base.BehaviorOnNoMatch = behaviorOnNoMatches.Single <BehaviorOnNoMatch>();
                    return;
                }
            }
Example #3
0
			public CimInstanceRegularFilter(string propertyName, IEnumerable allowedPropertyValues, bool wildcardsEnabled, BehaviorOnNoMatch behaviorOnNoMatch)
			{
				HashSet<BehaviorOnNoMatch> behaviorOnNoMatches = new HashSet<BehaviorOnNoMatch>();
				foreach (object allowedPropertyValue in allowedPropertyValues)
				{
					ClientSideQuery.PropertyValueFilter propertyValueRegularFilter = new ClientSideQuery.PropertyValueRegularFilter(propertyName, allowedPropertyValue, wildcardsEnabled, behaviorOnNoMatch);
					base.AddPropertyValueFilter(propertyValueRegularFilter);
					behaviorOnNoMatches.Add(propertyValueRegularFilter.BehaviorOnNoMatch);
				}
				if (behaviorOnNoMatches.Count != 1)
				{
					base.BehaviorOnNoMatch = behaviorOnNoMatch;
					return;
				}
				else
				{
					base.BehaviorOnNoMatch = behaviorOnNoMatches.Single<BehaviorOnNoMatch>();
					return;
				}
			}