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
- PartialCachingAttribute.cs
- ConstraintCollection.cs
- WindowsStartMenu.cs
- StickyNoteAnnotations.cs
- DropShadowEffect.cs
- XmlQueryOutput.cs
- BinHexDecoder.cs
- VariableDesigner.xaml.cs
- _ListenerResponseStream.cs
- CustomAttributeBuilder.cs
- RichTextBox.cs
- MaterialGroup.cs
- UnsafeNativeMethods.cs
- XPathNavigatorKeyComparer.cs
- Base64Stream.cs
- TextTrailingCharacterEllipsis.cs
- GiveFeedbackEventArgs.cs
- LocatorBase.cs
- SynchronizedRandom.cs
- PropertyPushdownHelper.cs
- CopyNamespacesAction.cs
- QuestionEventArgs.cs
- DrawingState.cs
- DeferredElementTreeState.cs
- OleServicesContext.cs
- RemotingAttributes.cs
- TextBoxView.cs
- HttpBrowserCapabilitiesWrapper.cs
- ThreadStaticAttribute.cs
- AliasExpr.cs
- Variable.cs
- ActivityTypeDesigner.xaml.cs
- Activator.cs
- SoapElementAttribute.cs
- ThreadAbortException.cs
- WebPartCancelEventArgs.cs
- NavigationExpr.cs
- PaintValueEventArgs.cs
- ReliableOutputSessionChannel.cs
- SystemIPGlobalProperties.cs
- AVElementHelper.cs
- SerializationAttributes.cs
- SocketPermission.cs
- UdpDiscoveryEndpointElement.cs
- PageClientProxyGenerator.cs
- DataView.cs
- DesignerTransaction.cs
- FilterableAttribute.cs
- WebPartManager.cs
- PeerApplicationLaunchInfo.cs
- AlternateViewCollection.cs
- TemplatePagerField.cs
- DeferredReference.cs
- WebPartTransformerCollection.cs
- Symbol.cs
- HtmlHead.cs
- MdiWindowListItemConverter.cs
- FunctionNode.cs
- DataGridPagerStyle.cs
- DataRelationPropertyDescriptor.cs
- _CommandStream.cs
- Journal.cs
- errorpatternmatcher.cs
- SqlStream.cs
- KeysConverter.cs
- CultureSpecificCharacterBufferRange.cs
- EventMap.cs
- SubclassTypeValidator.cs
- _AutoWebProxyScriptHelper.cs
- WebRequest.cs
- SchemaImporterExtensionsSection.cs
- DbConnectionPool.cs
- AnimationClockResource.cs
- AlternationConverter.cs
- Matrix3DValueSerializer.cs
- PartialCachingAttribute.cs
- ViewStateException.cs
- DesignerLoader.cs
- ObjectHelper.cs
- DateTimeEditor.cs
- TypeForwardedToAttribute.cs
- RemoteHelper.cs
- UxThemeWrapper.cs
- ContactManager.cs
- ParallelEnumerableWrapper.cs
- TableStyle.cs
- Encoder.cs
- WinEventWrap.cs
- ToolStripItemClickedEventArgs.cs
- Roles.cs
- SuppressMergeCheckAttribute.cs
- InitializerFacet.cs
- WebSysDisplayNameAttribute.cs
- RoleGroupCollection.cs
- DataListItem.cs
- EventLogHandle.cs
- SoapHeaderException.cs
- ConfigurationValue.cs
- DesignerHost.cs
- DescendantOverDescendantQuery.cs