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
- glyphs.cs
- UnhandledExceptionEventArgs.cs
- WebRequestModuleElement.cs
- CommandLibraryHelper.cs
- LocalizabilityAttribute.cs
- ImpersonationContext.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- validationstate.cs
- MemberBinding.cs
- DbSetClause.cs
- SecurityState.cs
- ReferenceTypeElement.cs
- XpsFilter.cs
- ParameterElementCollection.cs
- DataGridColumn.cs
- LongTypeConverter.cs
- DocumentPage.cs
- RewritingSimplifier.cs
- AssemblyAttributes.cs
- WindowsIdentity.cs
- HtmlFormWrapper.cs
- CallbackValidatorAttribute.cs
- ADConnectionHelper.cs
- SizeFConverter.cs
- MoveSizeWinEventHandler.cs
- ScrollProviderWrapper.cs
- TypeUsageBuilder.cs
- SizeValueSerializer.cs
- UserNamePasswordValidator.cs
- ExtensionDataReader.cs
- sapiproxy.cs
- CreateCardRequest.cs
- UserPreferenceChangedEventArgs.cs
- HttpCapabilitiesSectionHandler.cs
- ArrangedElementCollection.cs
- InputElement.cs
- ListViewCommandEventArgs.cs
- XmlUrlResolver.cs
- CollectionEditVerbManager.cs
- ZipIOCentralDirectoryBlock.cs
- SafeMarshalContext.cs
- XmlQueryContext.cs
- PtsContext.cs
- SiteMapDataSource.cs
- GridPatternIdentifiers.cs
- BindingContext.cs
- Converter.cs
- DateTimeValueSerializerContext.cs
- ChameleonKey.cs
- recordstatescratchpad.cs
- StaticSiteMapProvider.cs
- WebException.cs
- XmlSiteMapProvider.cs
- CompModSwitches.cs
- CFStream.cs
- XsdSchemaFileEditor.cs
- OleAutBinder.cs
- SqlCharStream.cs
- DataGridViewRowEventArgs.cs
- GetRecipientRequest.cs
- RecordBuilder.cs
- ParentUndoUnit.cs
- ToolStripPanelRenderEventArgs.cs
- ExpressionHelper.cs
- CompiledQueryCacheEntry.cs
- TypeDelegator.cs
- SystemPens.cs
- Profiler.cs
- GrammarBuilderPhrase.cs
- SharedStatics.cs
- CommonXSendMessage.cs
- ReceiveSecurityHeader.cs
- XmlSchemaChoice.cs
- PrtTicket_Public_Simple.cs
- Token.cs
- OleDbPermission.cs
- ListViewUpdatedEventArgs.cs
- ProcessActivityTreeOptions.cs
- HttpListener.cs
- CodeTypeParameterCollection.cs
- LocalValueEnumerator.cs
- Span.cs
- NetworkCredential.cs
- AttachedAnnotation.cs
- DependencyObjectPropertyDescriptor.cs
- OutputCacheSettingsSection.cs
- UniqueEventHelper.cs
- ADConnectionHelper.cs
- UserControlCodeDomTreeGenerator.cs
- SafeArrayTypeMismatchException.cs
- DesignTimeDataBinding.cs
- BCLDebug.cs
- XPathScanner.cs
- InternalException.cs
- Pen.cs
- PageRequestManager.cs
- TreeNodeMouseHoverEvent.cs
- RequestTimeoutManager.cs
- DetailsViewInsertedEventArgs.cs
- CustomValidator.cs