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
- ActivityTypeResolver.xaml.cs
- Image.cs
- DateTimeParse.cs
- ScrollBar.cs
- NavigationProperty.cs
- CollectionViewGroupRoot.cs
- StringUtil.cs
- ConnectionStringsExpressionBuilder.cs
- XmlUrlEditor.cs
- FormsAuthenticationConfiguration.cs
- MonitorWrapper.cs
- MessageTraceRecord.cs
- Utils.cs
- AttributeAction.cs
- CqlLexerHelpers.cs
- CodeRemoveEventStatement.cs
- CodeArgumentReferenceExpression.cs
- CodePrimitiveExpression.cs
- SerializationFieldInfo.cs
- Assembly.cs
- XPathNodePointer.cs
- SecurityHeaderLayout.cs
- ECDiffieHellmanCng.cs
- CompositeActivityMarkupSerializer.cs
- ToolStripItemRenderEventArgs.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DocumentApplication.cs
- StandardToolWindows.cs
- NumberAction.cs
- GACIdentityPermission.cs
- ValueChangedEventManager.cs
- WebControlParameterProxy.cs
- LingerOption.cs
- TraceInternal.cs
- EmptyImpersonationContext.cs
- _DisconnectOverlappedAsyncResult.cs
- DesignerLoader.cs
- DesignerTransaction.cs
- LinqDataSourceContextEventArgs.cs
- TextEvent.cs
- HtmlHead.cs
- WizardForm.cs
- CompilerInfo.cs
- VisualSerializer.cs
- TdsParserSessionPool.cs
- FixedSchema.cs
- ObjectConverter.cs
- InstanceCompleteException.cs
- DocumentScope.cs
- MeshGeometry3D.cs
- Span.cs
- LinkLabelLinkClickedEvent.cs
- SubMenuStyleCollection.cs
- TableLayoutStyle.cs
- XmlQualifiedName.cs
- MetadataResolver.cs
- MarshalByRefObject.cs
- PropertyEmitter.cs
- ConfigurationSection.cs
- ResourceDisplayNameAttribute.cs
- ResourcePool.cs
- Query.cs
- AutomationIdentifierGuids.cs
- KeyEventArgs.cs
- WebDescriptionAttribute.cs
- ScriptResourceInfo.cs
- QuadraticBezierSegment.cs
- CultureInfo.cs
- Rotation3DAnimationUsingKeyFrames.cs
- SystemResourceKey.cs
- HMACSHA512.cs
- SubordinateTransaction.cs
- ServerReliableChannelBinder.cs
- XmlDataSourceNodeDescriptor.cs
- DataContractSet.cs
- FixedPageStructure.cs
- SoapEnumAttribute.cs
- TypedReference.cs
- smtppermission.cs
- PolyBezierSegment.cs
- Thumb.cs
- SecurityDocument.cs
- ErrorReporting.cs
- RootAction.cs
- ExtendedProtectionPolicyTypeConverter.cs
- ChildrenQuery.cs
- IIS7WorkerRequest.cs
- ListViewUpdatedEventArgs.cs
- TCPClient.cs
- ClickablePoint.cs
- BaseDataBoundControl.cs
- CustomPopupPlacement.cs
- DateTimeUtil.cs
- HttpStreamXmlDictionaryWriter.cs
- DynamicHyperLink.cs
- ExecutionContext.cs
- LinqDataSourceUpdateEventArgs.cs
- ScrollViewer.cs
- TextChange.cs
- ToolboxItemAttribute.cs