Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Role / WebWorkflowRole.cs / 1305376 / WebWorkflowRole.cs
using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Workflow.Runtime; using System.Workflow.Runtime.Hosting; using System.Web.Security; using System.Security.Principal; using System.Configuration.Provider; namespace System.Workflow.Activities { [Serializable] public class WebWorkflowRole : WorkflowRole { private string m_roleName; private string m_roleProvider; public override string Name { get { return this.m_roleName; } set { if (value == null) throw new ArgumentNullException("value"); this.m_roleName = value; } } public string RoleProvider { get { return this.m_roleProvider; } set { this.m_roleProvider = value; } } public WebWorkflowRole(string roleName) { if (null == roleName) { throw new ArgumentNullException("roleName"); } this.m_roleName = roleName; this.m_roleProvider = null; } public WebWorkflowRole(string roleName, string provider) { if (null == roleName) { throw new ArgumentNullException("roleName"); } this.m_roleName = roleName; this.m_roleProvider = provider; } public override IListGetIdentities() { List identities = new List (); System.Web.Security.RoleProvider rp = GetRoleProvider(); identities.AddRange(rp.GetUsersInRole(Name)); return identities; } public override bool IncludesIdentity(string identity) { System.Web.Security.RoleProvider rp = GetRoleProvider(); return rp.IsUserInRole(identity, Name); } private System.Web.Security.RoleProvider GetRoleProvider() { if (this.RoleProvider == null) return System.Web.Security.Roles.Provider; RoleProvider rp = Roles.Providers[this.RoleProvider]; if (rp == null) throw new ProviderException(SR.GetString(SR.Error_RoleProviderNotAvailableOrEnabled, this.RoleProvider)); return rp; } } } // 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
- IApplicationTrustManager.cs
- EnumMemberAttribute.cs
- StylusButtonEventArgs.cs
- ClassHandlersStore.cs
- StatusStrip.cs
- PartBasedPackageProperties.cs
- BamlStream.cs
- ProviderIncompatibleException.cs
- NavigationPropertySingletonExpression.cs
- EventProvider.cs
- SoapWriter.cs
- UserValidatedEventArgs.cs
- GridSplitterAutomationPeer.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ReaderWriterLock.cs
- RemotingSurrogateSelector.cs
- HttpListenerContext.cs
- safesecurityhelperavalon.cs
- SqlDataSourceConfigureSortForm.cs
- SmiGettersStream.cs
- EventSinkActivityDesigner.cs
- ResizingMessageFilter.cs
- DataComponentMethodGenerator.cs
- OdbcConnectionPoolProviderInfo.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Padding.cs
- Roles.cs
- WinFormsSpinner.cs
- ParameterBinding.cs
- contentDescriptor.cs
- ImageSource.cs
- CollectionView.cs
- HtmlAnchor.cs
- BaseCodeDomTreeGenerator.cs
- ObjectComplexPropertyMapping.cs
- CommandDevice.cs
- Mapping.cs
- DropShadowBitmapEffect.cs
- ServicePoint.cs
- Vector3DAnimationUsingKeyFrames.cs
- ClockGroup.cs
- ReferenceSchema.cs
- SystemIPv4InterfaceProperties.cs
- Vector3DConverter.cs
- FeatureSupport.cs
- EntityCommandExecutionException.cs
- WebPartDisplayMode.cs
- FastPropertyAccessor.cs
- ReadOnlyDictionary.cs
- DeflateStream.cs
- BindingWorker.cs
- MLangCodePageEncoding.cs
- PropertyTabAttribute.cs
- RijndaelManaged.cs
- ObjectListField.cs
- LocalClientSecuritySettings.cs
- DataGridViewTextBoxColumn.cs
- SHA512Managed.cs
- ArrayConverter.cs
- AnnotationObservableCollection.cs
- PointAnimationUsingPath.cs
- AnimationException.cs
- TableItemProviderWrapper.cs
- LayoutDump.cs
- DataGridViewRowConverter.cs
- Pool.cs
- MemberHolder.cs
- LineServicesCallbacks.cs
- SerializationInfoEnumerator.cs
- DesignerActionService.cs
- ActivityInstanceReference.cs
- CachedRequestParams.cs
- XPathCompileException.cs
- DataGridViewRowsAddedEventArgs.cs
- ActivityExecutorSurrogate.cs
- AccessorTable.cs
- TypeSystemProvider.cs
- SimpleTypesSurrogate.cs
- FontCacheLogic.cs
- Console.cs
- Helper.cs
- WebPartConnectionsCloseVerb.cs
- PropertyTabChangedEvent.cs
- DataServiceQueryException.cs
- XpsS0ValidatingLoader.cs
- ConnectionStringsExpressionEditor.cs
- ServiceNameElement.cs
- BindingCompleteEventArgs.cs
- HtmlTernaryTree.cs
- DataGridPageChangedEventArgs.cs
- OverflowException.cs
- Encoding.cs
- TemplatedMailWebEventProvider.cs
- TextTreeTextBlock.cs
- HtmlLink.cs
- XmlParser.cs
- Preprocessor.cs
- Manipulation.cs
- hresults.cs
- Predicate.cs