Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Configuration / IdnElement.cs / 1 / 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); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripDropDown.cs
- Message.cs
- RC2.cs
- StorageScalarPropertyMapping.cs
- CTreeGenerator.cs
- EditingMode.cs
- HTMLTextWriter.cs
- DateTimeFormatInfoScanner.cs
- DataPointer.cs
- OrderedDictionaryStateHelper.cs
- ObjectAnimationUsingKeyFrames.cs
- Process.cs
- _SpnDictionary.cs
- ExportException.cs
- Vector3dCollection.cs
- EncoderParameter.cs
- XPathNodePointer.cs
- MethodExpr.cs
- WebPartsSection.cs
- RefreshEventArgs.cs
- Trace.cs
- RijndaelCryptoServiceProvider.cs
- DefaultProxySection.cs
- TypeUtil.cs
- Int32.cs
- TaskFileService.cs
- AssemblyHash.cs
- EntityDataSourceDataSelectionPanel.cs
- ConfigErrorGlyph.cs
- __Error.cs
- ServiceContractDetailViewControl.cs
- XmlLanguage.cs
- QilDataSource.cs
- Menu.cs
- DataSpaceManager.cs
- DataSourceCache.cs
- InputReportEventArgs.cs
- CopyAction.cs
- ScriptRegistrationManager.cs
- DataGridViewHitTestInfo.cs
- FieldTemplateUserControl.cs
- PbrsForward.cs
- TextEndOfLine.cs
- HttpListenerPrefixCollection.cs
- Root.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- CuspData.cs
- StateManagedCollection.cs
- NetworkStream.cs
- FontWeights.cs
- UpdatePanelControlTrigger.cs
- MemoryPressure.cs
- DataChangedEventManager.cs
- Config.cs
- Trace.cs
- Int16.cs
- dbenumerator.cs
- QueryExtender.cs
- XmlElementAttribute.cs
- TiffBitmapEncoder.cs
- IteratorFilter.cs
- NameValuePermission.cs
- GetPolicyDetailsRequest.cs
- HttpModuleActionCollection.cs
- SystemException.cs
- ExpressionDumper.cs
- MissingSatelliteAssemblyException.cs
- Geometry3D.cs
- ManagedFilter.cs
- _SSPISessionCache.cs
- LineServicesCallbacks.cs
- DoubleAnimationClockResource.cs
- SettingsSection.cs
- FormsAuthenticationConfiguration.cs
- ConfigXmlElement.cs
- DbConnectionPoolOptions.cs
- MetabaseServerConfig.cs
- AppDomainProtocolHandler.cs
- SiteOfOriginPart.cs
- SendActivityDesignerTheme.cs
- CfgRule.cs
- AlternationConverter.cs
- CounterSample.cs
- RC2.cs
- CollectionViewGroup.cs
- BrowserCapabilitiesFactory.cs
- XPathNavigatorKeyComparer.cs
- DBNull.cs
- UnmanagedBitmapWrapper.cs
- DurationConverter.cs
- WorkflowCommandExtensionItem.cs
- UnmanagedMemoryStreamWrapper.cs
- ViewGenerator.cs
- WebSysDescriptionAttribute.cs
- XmlSchemaNotation.cs
- Empty.cs
- TextControlDesigner.cs
- KeyGestureConverter.cs
- _AcceptOverlappedAsyncResult.cs
- TextViewSelectionProcessor.cs