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
- SystemDropShadowChrome.cs
- BitmapEffectDrawing.cs
- FontDriver.cs
- NetworkStream.cs
- GuidConverter.cs
- BamlMapTable.cs
- KeyValuePairs.cs
- StrokeCollection2.cs
- StatusStrip.cs
- BuilderPropertyEntry.cs
- BStrWrapper.cs
- ComponentChangingEvent.cs
- _DisconnectOverlappedAsyncResult.cs
- BooleanSwitch.cs
- XmlException.cs
- DataTableNameHandler.cs
- MethodToken.cs
- CookieHandler.cs
- SecurityTokenRequirement.cs
- HashHelpers.cs
- PartialTrustVisibleAssembliesSection.cs
- LicenseProviderAttribute.cs
- PanelContainerDesigner.cs
- Span.cs
- HttpCapabilitiesSectionHandler.cs
- RegexWriter.cs
- DataGridColumnDropSeparator.cs
- SmiEventStream.cs
- AssemblyName.cs
- HttpCapabilitiesSectionHandler.cs
- SqlPersonalizationProvider.cs
- GroupStyle.cs
- TrustSection.cs
- TextContainer.cs
- RectangleHotSpot.cs
- SetterBase.cs
- Property.cs
- WindowsAltTab.cs
- FilterUserControlBase.cs
- Wizard.cs
- StateRuntime.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- RoutedEventValueSerializer.cs
- TextWriter.cs
- TextEndOfParagraph.cs
- QuotedPairReader.cs
- WizardPanel.cs
- ProxyWebPartConnectionCollection.cs
- Condition.cs
- Encoder.cs
- CodeTypeMemberCollection.cs
- XsdBuilder.cs
- XmlSchemaFacet.cs
- FrameworkTemplate.cs
- StateDesigner.CommentLayoutGlyph.cs
- followingsibling.cs
- tooltip.cs
- TextBoxRenderer.cs
- PropertyToken.cs
- ScaleTransform.cs
- NamedElement.cs
- ClientConfigPaths.cs
- _BufferOffsetSize.cs
- _LocalDataStore.cs
- ConfigurationException.cs
- Misc.cs
- DeleteMemberBinder.cs
- WebBrowserContainer.cs
- SudsCommon.cs
- TextParaClient.cs
- MethodBuilder.cs
- ScrollItemPattern.cs
- CTreeGenerator.cs
- Int32AnimationBase.cs
- UInt16.cs
- ObjectCloneHelper.cs
- FaultCode.cs
- VScrollProperties.cs
- HttpCapabilitiesBase.cs
- EnvironmentPermission.cs
- ConnectionStringSettings.cs
- SynchronizedReadOnlyCollection.cs
- Rule.cs
- BooleanAnimationBase.cs
- Vector3DConverter.cs
- ListViewUpdatedEventArgs.cs
- DesignerActionKeyboardBehavior.cs
- QilChoice.cs
- MetadataHelper.cs
- Italic.cs
- LedgerEntry.cs
- ServiceDescription.cs
- Evaluator.cs
- ColorConvertedBitmap.cs
- ListArgumentProvider.cs
- CompModSwitches.cs
- SessionStateContainer.cs
- Executor.cs
- StringFreezingAttribute.cs
- UidPropertyAttribute.cs