// Token: 0x060000C7 RID: 199 RVA: 0x00004E68 File Offset: 0x00003068 protected override void InternalTaskExecute() { base.InternalTaskExecute(); Restriction mapiRestriction = null; if (this.restriction != null) { mapiRestriction = ConvertHelper.ConvertToMapiRestriction(this.restriction); if (mapiRestriction == null) { throw new NspiException(NspiStatus.TooComplex, "Restriction too complex"); } } int[] midList = null; PropRowSet mapiRowset = null; PropTag[] mapiPropTags = ConvertHelper.ConvertToMapiPropTags(this.propertyTags); base.NspiContextCallWrapper("GetMatches", () => this.Context.GetMatches(this.NspiState, mapiRestriction, this.maxRows, mapiPropTags, out midList, out mapiRowset)); if (base.Status == NspiStatus.Success) { this.returnState = base.NspiState; this.returnMids = midList; this.returnRowset = ConvertHelper.ConvertFromMapiPropRowSet(mapiRowset, MarshalHelper.GetString8CodePage(base.NspiState)); base.TraceNspiState(); NspiDispatchTask.NspiTracer.TraceDebug <int>((long)base.ContextHandle, "Rows returned: {0}", (mapiRowset == null) ? 0 : mapiRowset.Rows.Count); } }
internal static Restriction[] ConvertToMapiRestrictions(Restriction[] restrictions) { if (restrictions == null) { return(null); } Restriction[] array = new Restriction[restrictions.Length]; for (int i = 0; i < restrictions.Length; i++) { array[i] = ConvertHelper.ConvertToMapiRestriction(restrictions[i]); } return(array); }
internal static Restriction ConvertToMapiRestriction(Restriction restriction) { if (restriction == null) { return(null); } switch (restriction.RestrictionType) { case RestrictionType.And: return(Restriction.And(ConvertHelper.ConvertToMapiRestrictions(((CompositeRestriction)restriction).ChildRestrictions))); case RestrictionType.Or: return(Restriction.Or(ConvertHelper.ConvertToMapiRestrictions(((CompositeRestriction)restriction).ChildRestrictions))); case RestrictionType.Not: return(Restriction.Not(ConvertHelper.ConvertToMapiRestriction(((NotRestriction)restriction).ChildRestriction))); case RestrictionType.Content: { ContentRestriction contentRestriction = restriction as ContentRestriction; if (contentRestriction.PropertyValue == null) { throw new NspiException(NspiStatus.InvalidParameter, "Null PropertyValue is not valid for ContentRestriction."); } return(Restriction.Content(ConvertHelper.ConvertToMapiPropTag(contentRestriction.PropertyTag), contentRestriction.PropertyTag.IsMultiValuedProperty, ConvertHelper.ConvertToMapiPropValue(contentRestriction.PropertyValue.Value), (ContentFlags)contentRestriction.FuzzyLevel)); } case RestrictionType.Property: { PropertyRestriction propertyRestriction = restriction as PropertyRestriction; if (propertyRestriction.PropertyValue == null) { throw new NspiException(NspiStatus.InvalidParameter, "Null PropertyValue is not valid for PropertyRestriction."); } return(Restriction.Property(ConvertHelper.ConvertToMapiRelOp(propertyRestriction.RelationOperator), ConvertHelper.ConvertToMapiPropTag(propertyRestriction.PropertyTag), propertyRestriction.PropertyTag.IsMultiValuedProperty, ConvertHelper.ConvertToMapiPropValue(propertyRestriction.PropertyValue.Value))); } case RestrictionType.CompareProps: { ComparePropsRestriction comparePropsRestriction = restriction as ComparePropsRestriction; return(Restriction.CompareProps(ConvertHelper.ConvertToMapiRelOp(comparePropsRestriction.RelationOperator), ConvertHelper.ConvertToMapiPropTag(comparePropsRestriction.Property1), ConvertHelper.ConvertToMapiPropTag(comparePropsRestriction.Property2))); } case RestrictionType.BitMask: { BitMaskRestriction bitMaskRestriction = restriction as BitMaskRestriction; return(Restriction.BitMask(ConvertHelper.ConvertToMapiRelBmr(bitMaskRestriction.BitMaskOperator), ConvertHelper.ConvertToMapiPropTag(bitMaskRestriction.PropertyTag), (int)bitMaskRestriction.BitMask)); } case RestrictionType.Size: { SizeRestriction sizeRestriction = restriction as SizeRestriction; return(Restriction.PropertySize(ConvertHelper.ConvertToMapiRelOp(sizeRestriction.RelationOperator), ConvertHelper.ConvertToMapiPropTag(sizeRestriction.PropertyTag), (int)sizeRestriction.Size)); } case RestrictionType.Exists: { ExistsRestriction existsRestriction = restriction as ExistsRestriction; return(Restriction.Exist(ConvertHelper.ConvertToMapiPropTag(existsRestriction.PropertyTag))); } case RestrictionType.SubRestriction: { SubRestriction subRestriction = restriction as SubRestriction; return(Restriction.Sub(ConvertHelper.ConvertToMapiPropTag(subRestriction.SubRestrictionType), ConvertHelper.ConvertToMapiRestriction(subRestriction.ChildRestriction))); } default: throw new NspiException(NspiStatus.InvalidParameter, string.Format("Invalid restriction type: {0}", restriction)); } }