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
- ListItem.cs
- BorderSidesEditor.cs
- ClipboardData.cs
- FixedPageAutomationPeer.cs
- CommandHelpers.cs
- HtmlLink.cs
- StateRuntime.cs
- BitHelper.cs
- ConnectionConsumerAttribute.cs
- RouteItem.cs
- CapabilitiesUse.cs
- CellPartitioner.cs
- ChannelManager.cs
- SimpleHandlerFactory.cs
- AssociatedControlConverter.cs
- OracleDateTime.cs
- Point3DKeyFrameCollection.cs
- Accessors.cs
- SqlVersion.cs
- ResponseBodyWriter.cs
- ICspAsymmetricAlgorithm.cs
- Thumb.cs
- UnsafeNativeMethods.cs
- ComIntegrationManifestGenerator.cs
- XslTransform.cs
- SchemaSetCompiler.cs
- DataServiceQueryProvider.cs
- ScalarType.cs
- PrinterUnitConvert.cs
- Fonts.cs
- MatrixStack.cs
- ParameterBuilder.cs
- CalloutQueueItem.cs
- StateBag.cs
- HMACRIPEMD160.cs
- PropertyBuilder.cs
- COM2EnumConverter.cs
- PolyBezierSegmentFigureLogic.cs
- CompressStream.cs
- FamilyTypefaceCollection.cs
- BitmapEffectDrawingContextState.cs
- ArrayWithOffset.cs
- BatchStream.cs
- TraceProvider.cs
- CryptoApi.cs
- GZipDecoder.cs
- WebZone.cs
- TaskFormBase.cs
- EncoderParameters.cs
- ConnectionStringsSection.cs
- InternalsVisibleToAttribute.cs
- listviewsubitemcollectioneditor.cs
- PartManifestEntry.cs
- MoveSizeWinEventHandler.cs
- SecurityTokenException.cs
- ResourcePermissionBaseEntry.cs
- SeverityFilter.cs
- hebrewshape.cs
- HTMLTextWriter.cs
- WebServiceFaultDesigner.cs
- TimerEventSubscriptionCollection.cs
- ManagementObjectSearcher.cs
- ReaderWriterLockWrapper.cs
- SecureStringHasher.cs
- PermissionSet.cs
- BaseHashHelper.cs
- SqlTransaction.cs
- ProcessingInstructionAction.cs
- QueryConverter.cs
- Rijndael.cs
- FieldToken.cs
- typedescriptorpermission.cs
- FormViewDeletedEventArgs.cs
- basevalidator.cs
- XPathMultyIterator.cs
- ProcessRequestAsyncResult.cs
- XmlBinaryReader.cs
- PassportIdentity.cs
- SystemSounds.cs
- OutputChannel.cs
- CodeIdentifiers.cs
- MultipleViewPatternIdentifiers.cs
- UInt16Converter.cs
- GZipUtils.cs
- DataGridViewColumnCollection.cs
- MissingFieldException.cs
- WindowsScrollBar.cs
- XmlSchemaAnnotation.cs
- TraceSection.cs
- ManifestResourceInfo.cs
- BooleanExpr.cs
- PrintDocument.cs
- MembershipSection.cs
- AlternateViewCollection.cs
- XPathDescendantIterator.cs
- RsaSecurityToken.cs
- hebrewshape.cs
- AdapterUtil.cs
- ContentIterators.cs
- TimeSpanConverter.cs