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
- XmlTypeAttribute.cs
- IpcChannelHelper.cs
- TTSEvent.cs
- VariableReference.cs
- SmiTypedGetterSetter.cs
- returneventsaver.cs
- DeploymentExceptionMapper.cs
- _Connection.cs
- XmlIlGenerator.cs
- Evidence.cs
- SharedUtils.cs
- SplayTreeNode.cs
- OleDbCommand.cs
- WebRequest.cs
- System.Data_BID.cs
- ProgressBar.cs
- RolePrincipal.cs
- XamlInt32CollectionSerializer.cs
- UpdatePanelTrigger.cs
- IPAddress.cs
- BindingExpressionBase.cs
- ListViewCommandEventArgs.cs
- WinInet.cs
- BypassElement.cs
- HealthMonitoringSectionHelper.cs
- invalidudtexception.cs
- SessionChannels.cs
- WebServiceTypeData.cs
- FontInfo.cs
- SEHException.cs
- RtfToXamlReader.cs
- BoolExpressionVisitors.cs
- WebConvert.cs
- BufferedOutputStream.cs
- _KerberosClient.cs
- TreeWalker.cs
- RowParagraph.cs
- ScaleTransform3D.cs
- TreeBuilder.cs
- SafeCertificateStore.cs
- validationstate.cs
- ItemCheckEvent.cs
- CommandBindingCollection.cs
- Events.cs
- HwndSourceParameters.cs
- ExpressionBuilderCollection.cs
- DecoderNLS.cs
- VirtualizedItemProviderWrapper.cs
- URLIdentityPermission.cs
- Utils.cs
- HttpClientCertificate.cs
- CellIdBoolean.cs
- TraceLog.cs
- ObjectHandle.cs
- ToolStripGripRenderEventArgs.cs
- SettingsSection.cs
- TCEAdapterGenerator.cs
- IListConverters.cs
- RangeValueProviderWrapper.cs
- BeginStoryboard.cs
- SerialErrors.cs
- SamlEvidence.cs
- XmlSchemaObjectTable.cs
- BamlBinaryWriter.cs
- ArgIterator.cs
- InstanceDataCollectionCollection.cs
- XPathParser.cs
- ConditionCollection.cs
- ProvidePropertyAttribute.cs
- ReplacementText.cs
- Part.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- GcHandle.cs
- DesignerWebPartChrome.cs
- GridViewEditEventArgs.cs
- HyperLinkColumn.cs
- WebHeaderCollection.cs
- BooleanKeyFrameCollection.cs
- TypeDescriptorContext.cs
- ContravarianceAdapter.cs
- SafeUserTokenHandle.cs
- DataControlFieldCell.cs
- SharedDp.cs
- StreamWriter.cs
- COAUTHIDENTITY.cs
- XmlC14NWriter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- HttpListenerResponse.cs
- ValidatingReaderNodeData.cs
- FunctionImportElement.cs
- ObjectResult.cs
- Condition.cs
- SessionPageStatePersister.cs
- RC2.cs
- TryExpression.cs
- ImageCodecInfoPrivate.cs
- XamlTypeMapperSchemaContext.cs
- PowerStatus.cs
- OdbcConnection.cs
- TextServicesPropertyRanges.cs