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
- WithStatement.cs
- Literal.cs
- UnhandledExceptionEventArgs.cs
- XmlSchemaValidator.cs
- KeysConverter.cs
- SettingsPropertyWrongTypeException.cs
- DataColumnCollection.cs
- PageRanges.cs
- DataControlFieldCollection.cs
- XmlSchemaElement.cs
- DragDrop.cs
- EntityDataSourceDataSelection.cs
- CurrencyManager.cs
- ThousandthOfEmRealDoubles.cs
- ButtonBaseAdapter.cs
- TransformerConfigurationWizardBase.cs
- KeyValueConfigurationCollection.cs
- Size3D.cs
- DbgUtil.cs
- ObjectManager.cs
- SafeFileMappingHandle.cs
- _RequestCacheProtocol.cs
- ErrorStyle.cs
- CellPartitioner.cs
- VisualTarget.cs
- References.cs
- DropDownHolder.cs
- CodeAssignStatement.cs
- CriticalExceptions.cs
- StringUtil.cs
- HotCommands.cs
- AutoCompleteStringCollection.cs
- RemoveStoryboard.cs
- GenericUriParser.cs
- StylusOverProperty.cs
- DataGridViewColumnCollection.cs
- TouchesCapturedWithinProperty.cs
- SendActivityValidator.cs
- StringResourceManager.cs
- SafeMILHandle.cs
- UidPropertyAttribute.cs
- DateTimePicker.cs
- PropertyChangingEventArgs.cs
- MatrixKeyFrameCollection.cs
- FrameworkTextComposition.cs
- StrokeNodeData.cs
- ModelFactory.cs
- ConditionedDesigner.cs
- Color.cs
- SmuggledIUnknown.cs
- PrivilegedConfigurationManager.cs
- RelationshipEnd.cs
- XmlElementList.cs
- FlowDocumentReaderAutomationPeer.cs
- GeneralTransform3D.cs
- SchemaEntity.cs
- RoutedPropertyChangedEventArgs.cs
- CancellationTokenSource.cs
- ConstructorExpr.cs
- ConditionalExpression.cs
- SQLRoleProvider.cs
- SourceFilter.cs
- CriticalHandle.cs
- MessageBox.cs
- RegexMatch.cs
- XmlSchemaComplexContent.cs
- PrintPreviewDialog.cs
- AuthenticatedStream.cs
- MenuTracker.cs
- SafePointer.cs
- TreePrinter.cs
- TextWriterEngine.cs
- NamedPipeActivation.cs
- COAUTHINFO.cs
- MobilePage.cs
- ServiceBuildProvider.cs
- ListenerUnsafeNativeMethods.cs
- DataObjectSettingDataEventArgs.cs
- BinaryNode.cs
- XPathNodePointer.cs
- ProfileInfo.cs
- WebEventCodes.cs
- LabelTarget.cs
- SoapHeader.cs
- login.cs
- DragDropHelper.cs
- RemotingHelper.cs
- externdll.cs
- ScaleTransform.cs
- ImplicitInputBrush.cs
- CqlQuery.cs
- ChtmlFormAdapter.cs
- DelegatingTypeDescriptionProvider.cs
- MediaScriptCommandRoutedEventArgs.cs
- Module.cs
- GraphicsPath.cs
- Clause.cs
- BufferedGraphics.cs
- TranslateTransform.cs
- AutoGeneratedField.cs