Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Activation / Configuration / SecurityIdentifierConverter.cs / 1 / SecurityIdentifierConverter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Activation.Configuration { using System; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Security.Principal; class SecurityIdentifierConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (typeof(string) == sourceType) { return true; } return base.CanConvertFrom(context, sourceType); } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (typeof(InstanceDescriptor) == destinationType) { return true; } return base.CanConvertTo(context, destinationType); } public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { DiagnosticUtility.DebugAssert(this.CanConvertFrom(context, value.GetType()), ""); if (value is string) { return new SecurityIdentifier((string)value); } return base.ConvertFrom(context, culture, value); } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { DiagnosticUtility.DebugAssert(this.CanConvertTo(context, destinationType), ""); if (destinationType == typeof(string) && value is SecurityIdentifier) { SecurityIdentifier sid = (SecurityIdentifier)value; return sid.Value; } return base.ConvertTo(context, culture, value, destinationType); } } } // 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
- TreeChangeInfo.cs
- DatePickerAutomationPeer.cs
- StyleCollectionEditor.cs
- WebPartEditorApplyVerb.cs
- dbdatarecord.cs
- HtmlHead.cs
- GPRECTF.cs
- _SecureChannel.cs
- EndEvent.cs
- RepeatInfo.cs
- ImagingCache.cs
- StorageBasedPackageProperties.cs
- BooleanSwitch.cs
- NotSupportedException.cs
- DynamicExpression.cs
- VideoDrawing.cs
- DecimalStorage.cs
- XmlSchemaFacet.cs
- ParamArrayAttribute.cs
- Set.cs
- StringPropertyBuilder.cs
- _RequestCacheProtocol.cs
- TraceSection.cs
- GetCardDetailsRequest.cs
- XPathSingletonIterator.cs
- TimeSpanHelper.cs
- StringUtil.cs
- StreamInfo.cs
- EventDrivenDesigner.cs
- DivideByZeroException.cs
- ElapsedEventArgs.cs
- SemanticResolver.cs
- Function.cs
- PointValueSerializer.cs
- XmlSchemaGroup.cs
- base64Transforms.cs
- BitmapEffectDrawingContextWalker.cs
- HttpPostLocalhostServerProtocol.cs
- MimeTypeAttribute.cs
- autovalidator.cs
- PagerSettings.cs
- DesignerActionUIService.cs
- SafeIUnknown.cs
- Roles.cs
- BooleanConverter.cs
- StoragePropertyMapping.cs
- PropertyValueChangedEvent.cs
- HwndHost.cs
- BrushConverter.cs
- DateBoldEvent.cs
- DataObjectFieldAttribute.cs
- ImageDrawing.cs
- PointLightBase.cs
- TypeElement.cs
- DockingAttribute.cs
- SQLBinary.cs
- WinEventWrap.cs
- BaseDataListActionList.cs
- PropertyItem.cs
- TextTreeUndo.cs
- RenamedEventArgs.cs
- SimplePropertyEntry.cs
- Thickness.cs
- DPTypeDescriptorContext.cs
- XmlParserContext.cs
- PostBackOptions.cs
- KeyEventArgs.cs
- NumberFunctions.cs
- BuilderPropertyEntry.cs
- ComPlusInstanceProvider.cs
- ListViewAutomationPeer.cs
- SmtpCommands.cs
- _LocalDataStore.cs
- SafeNativeMethods.cs
- LogRecordSequence.cs
- DiscoveryMessageProperty.cs
- XmlSchemaType.cs
- GcSettings.cs
- SecUtil.cs
- XmlNamespaceDeclarationsAttribute.cs
- IsolatedStorageFileStream.cs
- SourceSwitch.cs
- MessageEventSubscriptionService.cs
- SchemaElementLookUpTable.cs
- XmlQueryRuntime.cs
- EvidenceBase.cs
- WinFormsSecurity.cs
- TextFormattingConverter.cs
- HyperLinkStyle.cs
- HostedHttpRequestAsyncResult.cs
- XmlLinkedNode.cs
- DateTimeConstantAttribute.cs
- ReadOnlyNameValueCollection.cs
- StateBag.cs
- MonikerHelper.cs
- RsaSecurityToken.cs
- dbenumerator.cs
- HwndSubclass.cs
- PerformanceCounterPermissionAttribute.cs
- TableLayoutStyle.cs