static private FilterReplace ( ICollection |
||
col | ICollection |
Input |
map | string>.IDictionary | Replace mappings |
Результат | ICollection |
/// <summary> /// Implementation of SearchOp.ExecuteQuery /// </summary> /// <param name="oclass">Object class</param> /// <param name="query">Query to execute</param> /// <param name="handler">Results handler</param> /// <param name="options">Operation options</param> public override void ExecuteQuery( ObjectClass oclass, string query, ResultsHandler handler, OperationOptions options) { ExchangeUtility.NullCheck(oclass, "oclass", this.configuration); // we handle accounts only if (!oclass.Is(ObjectClass.ACCOUNT_NAME)) { base.ExecuteQuery(oclass, query, handler, options); return; } ICollection <string> attsToGet = null; if (options != null && options.AttributesToGet != null) { attsToGet = CollectionUtil.NewList(options.AttributesToGet); } // delegate to get the exchange attributes if requested ResultsHandler filter = delegate(ConnectorObject cobject) { ConnectorObject filtered = ExchangeUtility.ReplaceAttributes( cobject, attsToGet, AttMapFromAD); filtered = this.AddExchangeAttributes(oclass, filtered, attsToGet); return(handler(filtered)); }; ResultsHandler handler2use = handler; OperationOptions options2use = options; if (options != null && options.AttributesToGet != null) { if (attsToGet.Contains(AttDatabase) || attsToGet.Contains(AttExternalMail) || attsToGet.Contains(AttRecipientType)) { // replace Exchange attributes with AD names var newAttsToGet = ExchangeUtility.FilterReplace(attsToGet, AttMap2AD); // we have to remove recipient type, as it is unknown to AD newAttsToGet.Remove(AttRecipientType); // build new op options var builder = new OperationOptionsBuilder(options); string[] attributesToGet = new string[newAttsToGet.Count]; newAttsToGet.CopyTo(attributesToGet, 0); builder.AttributesToGet = attributesToGet; options2use = builder.Build(); handler2use = filter; } } base.ExecuteQuery(oclass, query, handler2use, options2use); }