Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / Configuration / IdnElement.cs / 4 / 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
- SystemException.cs
- HitTestWithGeometryDrawingContextWalker.cs
- RequestQueryProcessor.cs
- MatrixAnimationBase.cs
- ChineseLunisolarCalendar.cs
- Compiler.cs
- ExpressionHelper.cs
- XPathScanner.cs
- InputProcessorProfilesLoader.cs
- RSAPKCS1KeyExchangeFormatter.cs
- UnsafeNativeMethodsPenimc.cs
- PhysicalOps.cs
- ChannelServices.cs
- TextOptionsInternal.cs
- LedgerEntryCollection.cs
- SelectQueryOperator.cs
- TypeSystem.cs
- HttpCapabilitiesSectionHandler.cs
- SqlConnectionManager.cs
- MethodExpr.cs
- IODescriptionAttribute.cs
- XsltLoader.cs
- PropertyValueUIItem.cs
- ObjectQueryProvider.cs
- TraceSection.cs
- PageAsyncTaskManager.cs
- BitmapPalettes.cs
- ScriptControlManager.cs
- XmlEntityReference.cs
- ZipFileInfoCollection.cs
- NGCSerializer.cs
- RuntimeWrappedException.cs
- IndependentAnimationStorage.cs
- PasswordDeriveBytes.cs
- Configuration.cs
- nulltextnavigator.cs
- ServiceModelSectionGroup.cs
- DefaultEventAttribute.cs
- RuntimeHelpers.cs
- RegistryKey.cs
- MissingMethodException.cs
- PublisherIdentityPermission.cs
- MobilePage.cs
- BasicCellRelation.cs
- SqlDataSourceDesigner.cs
- XmlRootAttribute.cs
- LinearGradientBrush.cs
- XXXInfos.cs
- PeerContact.cs
- RoutedEventValueSerializer.cs
- StringAnimationBase.cs
- FillBehavior.cs
- GregorianCalendar.cs
- SqlTrackingService.cs
- DataViewManagerListItemTypeDescriptor.cs
- WebConfigurationManager.cs
- NotifyCollectionChangedEventArgs.cs
- PaperSource.cs
- JournalEntryStack.cs
- invalidudtexception.cs
- Context.cs
- XNodeNavigator.cs
- NativeMethodsCLR.cs
- Padding.cs
- CodeAssignStatement.cs
- OdbcRowUpdatingEvent.cs
- XmlSchemaSimpleContentExtension.cs
- XmlDataDocument.cs
- SqlTriggerAttribute.cs
- BufferedWebEventProvider.cs
- RijndaelManagedTransform.cs
- FusionWrap.cs
- SchemaCreator.cs
- BCryptNative.cs
- _NetRes.cs
- DrawingVisual.cs
- WorkflowApplication.cs
- SpellCheck.cs
- VariableDesigner.xaml.cs
- HtmlEncodedRawTextWriter.cs
- Animatable.cs
- AbstractExpressions.cs
- MetadataHelper.cs
- ValueOfAction.cs
- ExeContext.cs
- hresults.cs
- EdmRelationshipRoleAttribute.cs
- WsiProfilesElement.cs
- HttpResponseInternalWrapper.cs
- EventTrigger.cs
- ControlPersister.cs
- CodeMemberMethod.cs
- odbcmetadatacolumnnames.cs
- XmlText.cs
- ServerIdentity.cs
- WebPartManager.cs
- CommunicationObjectManager.cs
- LinkUtilities.cs
- MatchNoneMessageFilter.cs
- WindowsSlider.cs