Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Configuration / IdnElement.cs / 2 / IdnElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; using System.Reflection; using System.ComponentModel; using System.Globalization; public sealed class IdnElement : ConfigurationElement { public IdnElement() { this.properties.Add(this.enabled); } protected override ConfigurationPropertyCollection Properties { get{ return this.properties; } } [ConfigurationProperty(CommonConfigurationStrings.Enabled, DefaultValue = (UriIdnScope)UriIdnScope.None)] public UriIdnScope Enabled { get { return (UriIdnScope)this[this.enabled]; } set { this[this.enabled] = value; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty enabled = new ConfigurationProperty(CommonConfigurationStrings.Enabled, typeof(UriIdnScope), UriIdnScope.None, new UriIdnScopeTypeConverter(), null, ConfigurationPropertyOptions.None); class UriIdnScopeTypeConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string)){ return true; } return base.CanConvertFrom(context, sourceType); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string s = value as string; if (s != null){ s = s.ToLower(CultureInfo.InvariantCulture); switch (s){ case "all": return UriIdnScope.All; case "none": return UriIdnScope.None; case "allexceptintranet": return UriIdnScope.AllExceptIntranet; } } return base.ConvertFrom(context, culture, value); } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- listitem.cs
- ExpandedWrapper.cs
- ModelVisual3D.cs
- SplineKeyFrames.cs
- GroupJoinQueryOperator.cs
- CqlIdentifiers.cs
- ThreadStartException.cs
- XmlWrappingReader.cs
- BindingContext.cs
- _NegoState.cs
- CodeGroup.cs
- AttributeConverter.cs
- TransactionTraceIdentifier.cs
- SqlTriggerAttribute.cs
- TagMapCollection.cs
- IncomingWebResponseContext.cs
- ObjRef.cs
- XPathExpr.cs
- XmlCountingReader.cs
- XmlSchemaResource.cs
- GlyphsSerializer.cs
- AvTrace.cs
- StatusBar.cs
- WebHttpSecurity.cs
- MasterPageCodeDomTreeGenerator.cs
- PrincipalPermission.cs
- XmlSchemaDocumentation.cs
- WebBrowserSiteBase.cs
- MaskedTextBox.cs
- RandomNumberGenerator.cs
- UriSection.cs
- SystemColors.cs
- SymDocumentType.cs
- JpegBitmapEncoder.cs
- FormsAuthenticationCredentials.cs
- Padding.cs
- ClientRoleProvider.cs
- CheckPair.cs
- SiteMapDataSource.cs
- RedistVersionInfo.cs
- SerializationSectionGroup.cs
- CreateUserWizardStep.cs
- ActivityCodeDomReferenceService.cs
- TCPClient.cs
- NameValuePermission.cs
- ChunkedMemoryStream.cs
- Parallel.cs
- TextDecorationLocationValidation.cs
- GregorianCalendarHelper.cs
- _ShellExpression.cs
- XmlSchemaSimpleTypeUnion.cs
- DetailsViewRowCollection.cs
- Attributes.cs
- TargetPerspective.cs
- ToolStripDropDownMenu.cs
- RoutedCommand.cs
- EntityDataSourceChangedEventArgs.cs
- TextFormatter.cs
- DocumentsTrace.cs
- ParseChildrenAsPropertiesAttribute.cs
- UniformGrid.cs
- MimeFormReflector.cs
- WrappingXamlSchemaContext.cs
- GenericsNotImplementedException.cs
- oledbmetadatacollectionnames.cs
- PathTooLongException.cs
- BitmapFrameEncode.cs
- SimpleRecyclingCache.cs
- COSERVERINFO.cs
- RtfNavigator.cs
- ProtocolsConfigurationEntry.cs
- TransformValueSerializer.cs
- MappingException.cs
- EditorPartChrome.cs
- SqlError.cs
- WebZone.cs
- WmlPanelAdapter.cs
- ServiceControllerDesigner.cs
- ItemAutomationPeer.cs
- Lease.cs
- Span.cs
- LineBreak.cs
- HttpCacheVaryByContentEncodings.cs
- WriteTimeStream.cs
- Int16Storage.cs
- CaseStatement.cs
- HorizontalAlignConverter.cs
- Setter.cs
- LineServices.cs
- ConfigXmlElement.cs
- CorrelationHandle.cs
- XmlComment.cs
- HighlightVisual.cs
- OptimisticConcurrencyException.cs
- AnnotationObservableCollection.cs
- StyleHelper.cs
- ToolStripMenuItem.cs
- OutputScopeManager.cs
- EdmSchemaError.cs
- ReadOnlyObservableCollection.cs