Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Role / DirectoryRootQuery.cs / 1305376 / DirectoryRootQuery.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 DirectoryRootQuery : IDirectoryOperation { private String m_name; private String m_value; private DirectoryQueryOperation m_operation; public DirectoryRootQuery(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(rootEntry)) { 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
- OverlappedAsyncResult.cs
- Item.cs
- OdbcUtils.cs
- ResourceDefaultValueAttribute.cs
- OdbcTransaction.cs
- Pens.cs
- Claim.cs
- SmtpNetworkElement.cs
- ExtentKey.cs
- XPathDocument.cs
- HelloMessageApril2005.cs
- XpsManager.cs
- Restrictions.cs
- QilGeneratorEnv.cs
- GenericEnumerator.cs
- SiteMapNodeItemEventArgs.cs
- DataServiceResponse.cs
- FragmentQueryKB.cs
- XPathNavigatorReader.cs
- SmtpCommands.cs
- DesignerVerbToolStripMenuItem.cs
- DataFormat.cs
- MessageAction.cs
- CompilerResults.cs
- SimpleTextLine.cs
- Assembly.cs
- ConstraintConverter.cs
- ConnectionProviderAttribute.cs
- RepeatButtonAutomationPeer.cs
- SqlResolver.cs
- MessageBodyMemberAttribute.cs
- EndpointReference.cs
- CannotUnloadAppDomainException.cs
- ObjectDataSourceMethodEditor.cs
- ObjectDataSourceStatusEventArgs.cs
- FlowPosition.cs
- XmlSiteMapProvider.cs
- ArraySegment.cs
- TextRangeProviderWrapper.cs
- MessageEncoderFactory.cs
- BufferedGraphics.cs
- Geometry.cs
- HtmlElement.cs
- QilNode.cs
- VirtualStackFrame.cs
- infer.cs
- Process.cs
- KeyInstance.cs
- Font.cs
- HttpModuleAction.cs
- CompareValidator.cs
- XmlUTF8TextWriter.cs
- ValidationEventArgs.cs
- _SSPISessionCache.cs
- webbrowsersite.cs
- Directory.cs
- HttpContextBase.cs
- WebPartUserCapability.cs
- ObjectDataSourceFilteringEventArgs.cs
- WorkflowApplicationCompletedException.cs
- HierarchicalDataSourceControl.cs
- XmlBinaryReader.cs
- WebPart.cs
- RawStylusInputReport.cs
- HTMLTextWriter.cs
- ReadOnlyPropertyMetadata.cs
- RoutedUICommand.cs
- EnumerableRowCollection.cs
- SqlOuterApplyReducer.cs
- SafeCryptContextHandle.cs
- PathSegmentCollection.cs
- IntegerValidatorAttribute.cs
- XmlValueConverter.cs
- CheckableControlBaseAdapter.cs
- WeakReadOnlyCollection.cs
- XmlEventCache.cs
- ExclusiveCanonicalizationTransform.cs
- compensatingcollection.cs
- Interfaces.cs
- HtmlUtf8RawTextWriter.cs
- InternalBase.cs
- FunctionQuery.cs
- ToolStripDropDownButton.cs
- FileReservationCollection.cs
- DefaultTraceListener.cs
- DataGridViewMethods.cs
- CultureData.cs
- FileDialogCustomPlace.cs
- ExcludePathInfo.cs
- SimpleTypesSurrogate.cs
- ArcSegment.cs
- ToolboxItemFilterAttribute.cs
- ReferenceConverter.cs
- XmlEnumAttribute.cs
- IdentityReference.cs
- ChannelSinkStacks.cs
- Parser.cs
- NullableDoubleSumAggregationOperator.cs
- InputBinding.cs
- MsmqIntegrationChannelFactory.cs