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
- SvcMapFile.cs
- ConfigurationStrings.cs
- SqlDataSourceView.cs
- LinearKeyFrames.cs
- AssociatedControlConverter.cs
- PropertyNames.cs
- DbConnectionStringCommon.cs
- OdbcError.cs
- PauseStoryboard.cs
- DesignerTextWriter.cs
- HtmlGenericControl.cs
- CompilerTypeWithParams.cs
- ListBoxItemAutomationPeer.cs
- ExpressionSelection.cs
- TransformCollection.cs
- UnhandledExceptionEventArgs.cs
- AdvancedBindingEditor.cs
- GenericTypeParameterBuilder.cs
- LinkLabelLinkClickedEvent.cs
- ContentElement.cs
- WebResourceUtil.cs
- PropertyIdentifier.cs
- DiagnosticEventProvider.cs
- DataPager.cs
- _MultipleConnectAsync.cs
- ConfigViewGenerator.cs
- ListBindingHelper.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- ImageSource.cs
- FixedSOMTableCell.cs
- SemaphoreSlim.cs
- RouteTable.cs
- FullTrustAssemblyCollection.cs
- Transform3DGroup.cs
- MsdtcClusterUtils.cs
- ObjectConverter.cs
- CodeBinaryOperatorExpression.cs
- CodeCommentStatement.cs
- WebInvokeAttribute.cs
- DataGridViewImageColumn.cs
- CapabilitiesPattern.cs
- SortExpressionBuilder.cs
- GradientStop.cs
- XmlConvert.cs
- Thumb.cs
- Rule.cs
- DefaultValueTypeConverter.cs
- ThousandthOfEmRealPoints.cs
- HMAC.cs
- GridViewUpdatedEventArgs.cs
- ModuleBuilderData.cs
- TimeoutValidationAttribute.cs
- TextRangeBase.cs
- Column.cs
- AspNetSynchronizationContext.cs
- MobileRedirect.cs
- StringDictionary.cs
- COM2PropertyPageUITypeConverter.cs
- MediaPlayer.cs
- DataTemplateSelector.cs
- TemplateControlParser.cs
- TimeSpanValidator.cs
- StateMachineSubscriptionManager.cs
- SortKey.cs
- ClassDataContract.cs
- SymbolEqualComparer.cs
- SqlRowUpdatingEvent.cs
- bindurihelper.cs
- SamlConstants.cs
- ModelProperty.cs
- WebService.cs
- NetworkInformationException.cs
- InkCanvasAutomationPeer.cs
- StylusPointDescription.cs
- NameValueCollection.cs
- XmlSerializerAssemblyAttribute.cs
- HotCommands.cs
- TypeBuilderInstantiation.cs
- VirtualDirectoryMapping.cs
- TaskSchedulerException.cs
- XmlSchemaComplexType.cs
- KnownColorTable.cs
- SerializationFieldInfo.cs
- TextViewSelectionProcessor.cs
- Vector.cs
- ErrorWebPart.cs
- HostedHttpContext.cs
- DbDataReader.cs
- VBIdentifierDesigner.xaml.cs
- PropertyEntry.cs
- LostFocusEventManager.cs
- ScriptingRoleServiceSection.cs
- WriteTimeStream.cs
- ProtocolViolationException.cs
- ResourceAttributes.cs
- ReadWriteSpinLock.cs
- DataGrid.cs
- SessionStateContainer.cs
- RuntimeWrappedException.cs
- StylusPointPropertyInfoDefaults.cs