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
- ValidatingPropertiesEventArgs.cs
- WinFormsComponentEditor.cs
- BindingSourceDesigner.cs
- UnsafeNativeMethods.cs
- EndOfStreamException.cs
- MenuItem.cs
- DataViewSettingCollection.cs
- AsyncCompletedEventArgs.cs
- GenericEnumConverter.cs
- PartialTrustValidationBehavior.cs
- SamlEvidence.cs
- HostedHttpTransportManager.cs
- WebPageTraceListener.cs
- CodeDefaultValueExpression.cs
- ServiceOperationUIEditor.cs
- TextTreeExtractElementUndoUnit.cs
- _ConnectionGroup.cs
- StreamingContext.cs
- EnumerableCollectionView.cs
- SystemWebCachingSectionGroup.cs
- OleDbDataReader.cs
- ExpressionBuilderContext.cs
- RunWorkerCompletedEventArgs.cs
- StringBlob.cs
- EdmFunction.cs
- _DomainName.cs
- AppDomainUnloadedException.cs
- OrderedEnumerableRowCollection.cs
- SourceCollection.cs
- QilGenerator.cs
- LinkTarget.cs
- DynamicDiscoveryDocument.cs
- BaseProcessor.cs
- QilChoice.cs
- ObjectConverter.cs
- DataPagerFieldCollection.cs
- FactoryRecord.cs
- XmlDataCollection.cs
- SelectorAutomationPeer.cs
- Utils.cs
- CounterCreationData.cs
- UIElement3D.cs
- TableLayoutPanel.cs
- CfgParser.cs
- AnimationClockResource.cs
- CodeStatementCollection.cs
- SecurityBindingElementImporter.cs
- IntSumAggregationOperator.cs
- ClientScriptManager.cs
- ProcessManager.cs
- PieceDirectory.cs
- PersonalizationProviderHelper.cs
- TypographyProperties.cs
- XmlTypeMapping.cs
- SqlGatherConsumedAliases.cs
- XpsFontSerializationService.cs
- EntityExpressionVisitor.cs
- ConfigPathUtility.cs
- CatalogPart.cs
- ProxyGenerator.cs
- EmbeddedMailObjectCollectionEditor.cs
- FixedSchema.cs
- ShutDownListener.cs
- LifetimeServices.cs
- GeometryValueSerializer.cs
- Exceptions.cs
- TransactionManager.cs
- BuildProvider.cs
- Keywords.cs
- EdmRelationshipRoleAttribute.cs
- UserThread.cs
- CodeCommentStatement.cs
- MutexSecurity.cs
- ContentDisposition.cs
- UserNameSecurityTokenProvider.cs
- SoapSchemaMember.cs
- ButtonFieldBase.cs
- UIElement3D.cs
- IIS7WorkerRequest.cs
- ConnectionPoolManager.cs
- DesignerDataTableBase.cs
- MdiWindowListItemConverter.cs
- PerspectiveCamera.cs
- DataColumnChangeEvent.cs
- DesignTimeParseData.cs
- WebBrowserEvent.cs
- FormsAuthenticationEventArgs.cs
- MyContact.cs
- EncoderNLS.cs
- ConfigurationErrorsException.cs
- BasePropertyDescriptor.cs
- WebBrowserDesigner.cs
- LineProperties.cs
- MsmqIntegrationProcessProtocolHandler.cs
- OTFRasterizer.cs
- LocatorBase.cs
- XPathQilFactory.cs
- PasswordBox.cs
- MemberRelationshipService.cs
- DataObject.cs