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
- Interfaces.cs
- RSAPKCS1SignatureDeformatter.cs
- PowerStatus.cs
- DictionaryGlobals.cs
- List.cs
- diagnosticsswitches.cs
- Point3DConverter.cs
- InsufficientMemoryException.cs
- MarkupCompilePass1.cs
- UrlPath.cs
- _WebProxyDataBuilder.cs
- OdbcPermission.cs
- RemoteWebConfigurationHostServer.cs
- HtmlLinkAdapter.cs
- QilValidationVisitor.cs
- NamespaceEmitter.cs
- PrintDialogException.cs
- DataGridViewColumnConverter.cs
- List.cs
- CommandLineParser.cs
- Hash.cs
- IApplicationTrustManager.cs
- NamespaceListProperty.cs
- MexServiceChannelBuilder.cs
- PointKeyFrameCollection.cs
- Utility.cs
- Slider.cs
- CounterSample.cs
- BindingSource.cs
- EncoderReplacementFallback.cs
- NetworkInformationPermission.cs
- QuerySafeNavigator.cs
- RuntimeResourceSet.cs
- PropertySourceInfo.cs
- HitTestParameters3D.cs
- GeometryGroup.cs
- JpegBitmapDecoder.cs
- HtmlInputText.cs
- ShaperBuffers.cs
- WebPartActionVerb.cs
- SupportsEventValidationAttribute.cs
- WebScriptServiceHost.cs
- _CommandStream.cs
- smtppermission.cs
- FixedTextPointer.cs
- FieldNameLookup.cs
- SymbolDocumentGenerator.cs
- XPathException.cs
- SoapRpcMethodAttribute.cs
- RotateTransform3D.cs
- ProjectionCamera.cs
- Directory.cs
- WebPartZone.cs
- ProxyWebPart.cs
- TableParaClient.cs
- InputScope.cs
- PoisonMessageException.cs
- ConnectionManagementElement.cs
- CharacterHit.cs
- IPipelineRuntime.cs
- BaseContextMenu.cs
- GridViewCancelEditEventArgs.cs
- DecoderReplacementFallback.cs
- QueryPageSettingsEventArgs.cs
- XmlImplementation.cs
- QueryCacheKey.cs
- StorageEndPropertyMapping.cs
- XmlCharacterData.cs
- WpfPayload.cs
- ConnectionManagementSection.cs
- VariantWrapper.cs
- BindingManagerDataErrorEventArgs.cs
- PasswordRecovery.cs
- FilterException.cs
- ContractTypeNameCollection.cs
- EventWaitHandleSecurity.cs
- AssociationTypeEmitter.cs
- _ListenerAsyncResult.cs
- GlyphInfoList.cs
- SecurityContext.cs
- HyperLinkDataBindingHandler.cs
- Odbc32.cs
- ResourceReferenceKeyNotFoundException.cs
- MetadataItemEmitter.cs
- StringConverter.cs
- CommandTreeTypeHelper.cs
- DockPattern.cs
- TrackBarRenderer.cs
- ModuleElement.cs
- CopyOnWriteList.cs
- MailWebEventProvider.cs
- PermissionRequestEvidence.cs
- AssociativeAggregationOperator.cs
- Scripts.cs
- XamlTemplateSerializer.cs
- DefaultSerializationProviderAttribute.cs
- JulianCalendar.cs
- TypeDependencyAttribute.cs
- ApplicationDirectory.cs
- CodeComment.cs