Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Role / DirectoryLocalQuery.cs / 1305376 / DirectoryLocalQuery.cs
#region Using directives using System; using System.Collections.Generic; using System.Text; using System.DirectoryServices; #endregion namespace System.Workflow.Activities { [Serializable] sealed internal class DirectoryLocalQuery : IDirectoryOperation { internal String m_name; internal String m_value; internal DirectoryQueryOperation m_operation; public DirectoryLocalQuery(String name, String value, DirectoryQueryOperation operation) { if (name == null) throw new ArgumentNullException("name"); if (value == null) throw new ArgumentNullException("value"); this.m_name = name; this.m_value = value; this.m_operation = operation; } public void GetResult(DirectoryEntry rootEntry, DirectoryEntry currentEntry, Listresponse) { if (rootEntry == null) throw new ArgumentNullException("rootEntry"); if (currentEntry == null) throw new ArgumentNullException("currentEntry"); if (response == null) throw new ArgumentNullException("response"); using (DirectorySearcher searcher = new DirectorySearcher(currentEntry)) { String strStart = "("; String strOperation = ""; String strEnd = ")"; switch (this.m_operation) { case DirectoryQueryOperation.Equal: strOperation = "="; break; case DirectoryQueryOperation.NotEqual: strStart = "(!("; strOperation = "="; strEnd = "))"; break; default: System.Diagnostics.Debug.Assert(false); break; } searcher.Filter = strStart + this.m_name + strOperation + this.m_value + strEnd; foreach (SearchResult result in searcher.FindAll()) { response.Add(result.GetDirectoryEntry()); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- sitestring.cs
- FrameSecurityDescriptor.cs
- DesignBindingValueUIHandler.cs
- RegexMatchCollection.cs
- EntityDataSourceContextCreatedEventArgs.cs
- Handle.cs
- SymmetricAlgorithm.cs
- TypefaceCollection.cs
- DataGridViewButtonCell.cs
- SqlMultiplexer.cs
- ProfileSection.cs
- XamlTreeBuilderBamlRecordWriter.cs
- FormParameter.cs
- BigInt.cs
- DiscoveryMessageSequenceGenerator.cs
- TextProperties.cs
- TableRowsCollectionEditor.cs
- KeyGestureValueSerializer.cs
- GifBitmapDecoder.cs
- ContentElement.cs
- CommandHelper.cs
- FontSizeConverter.cs
- CompilerInfo.cs
- cache.cs
- ErrorWrapper.cs
- __Filters.cs
- DataSourceGroupCollection.cs
- TableSectionStyle.cs
- _CommandStream.cs
- webclient.cs
- DBSqlParserTableCollection.cs
- LinqMaximalSubtreeNominator.cs
- Util.cs
- DPAPIProtectedConfigurationProvider.cs
- WorkflowFileItem.cs
- PerformanceCounterPermissionAttribute.cs
- AppDomainManager.cs
- TreeNodeCollection.cs
- UpdateTranslator.cs
- InstanceNotReadyException.cs
- SynchronizedDispatch.cs
- FontSourceCollection.cs
- EncodingNLS.cs
- DecimalFormatter.cs
- WebResourceAttribute.cs
- ByeOperation11AsyncResult.cs
- TimestampInformation.cs
- CatalogPart.cs
- ProvidePropertyAttribute.cs
- CodeAttributeArgumentCollection.cs
- SecureStringHasher.cs
- SafePointer.cs
- OrderedDictionaryStateHelper.cs
- AutoResetEvent.cs
- NetNamedPipeBinding.cs
- ImageMapEventArgs.cs
- XamlFilter.cs
- DefaultAssemblyResolver.cs
- Annotation.cs
- CallbackValidator.cs
- SettingsPropertyWrongTypeException.cs
- SmiRecordBuffer.cs
- SiteMapNodeItem.cs
- ExportFileRequest.cs
- XmlHelper.cs
- Win32KeyboardDevice.cs
- TextBounds.cs
- BamlTreeMap.cs
- BaseContextMenu.cs
- TypeInitializationException.cs
- HostDesigntimeLicenseContext.cs
- OleDragDropHandler.cs
- WmiPutTraceRecord.cs
- ReachDocumentPageSerializerAsync.cs
- ServicePointManagerElement.cs
- MenuItemBindingCollection.cs
- DataObjectAttribute.cs
- dtdvalidator.cs
- CriticalFinalizerObject.cs
- OverflowException.cs
- DataException.cs
- FontCollection.cs
- Merger.cs
- CachedFontFace.cs
- UrlMappingCollection.cs
- SqlConnectionFactory.cs
- CrossContextChannel.cs
- BindingElementExtensionElement.cs
- PropertyPathConverter.cs
- XmlLanguageConverter.cs
- InstanceDataCollectionCollection.cs
- Point4DConverter.cs
- Visitor.cs
- ColorBlend.cs
- ObjectIDGenerator.cs
- MultitargetUtil.cs
- RawStylusSystemGestureInputReport.cs
- TypeForwardedFromAttribute.cs
- MemoryRecordBuffer.cs
- SystemBrushes.cs