Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / WebSysDefaultValueAttribute.cs / 1 / WebSysDefaultValueAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web { using System; using System.ComponentModel; [AttributeUsage(AttributeTargets.All)] internal sealed class WebSysDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _localized; internal WebSysDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal WebSysDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_localized) { _localized = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = SR.GetString(baseValue); if (_type != null) { try { value = TypeDescriptor.GetConverter(_type).ConvertFromInvariantString((string) value); } catch (NotSupportedException) { value = null; } } base.SetValue(value); } } return base.Value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web { using System; using System.ComponentModel; [AttributeUsage(AttributeTargets.All)] internal sealed class WebSysDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _localized; internal WebSysDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal WebSysDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_localized) { _localized = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = SR.GetString(baseValue); if (_type != null) { try { value = TypeDescriptor.GetConverter(_type).ConvertFromInvariantString((string) value); } catch (NotSupportedException) { value = null; } } base.SetValue(value); } } return base.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
- XmlDataCollection.cs
- ExtendedTransformFactory.cs
- DataGridHeaderBorder.cs
- PersonalizationProvider.cs
- IOException.cs
- DataGridState.cs
- GACIdentityPermission.cs
- CheckBoxRenderer.cs
- DataGridViewCellStyle.cs
- Triplet.cs
- MultiSelector.cs
- OneToOneMappingSerializer.cs
- BindingMAnagerBase.cs
- TypeForwardedToAttribute.cs
- WebConvert.cs
- OAVariantLib.cs
- MultiTouchSystemGestureLogic.cs
- _ScatterGatherBuffers.cs
- SoapMessage.cs
- UnsupportedPolicyOptionsException.cs
- IgnoreFileBuildProvider.cs
- XmlCharType.cs
- PrePrepareMethodAttribute.cs
- EdmItemCollection.OcAssemblyCache.cs
- XPathNodeInfoAtom.cs
- MatrixTransform3D.cs
- ElementFactory.cs
- ThreadExceptionDialog.cs
- SplitterDesigner.cs
- CompilerLocalReference.cs
- FileSystemInfo.cs
- SiteMapNodeCollection.cs
- ApplicationSettingsBase.cs
- HttpCapabilitiesEvaluator.cs
- EntityKey.cs
- DrawToolTipEventArgs.cs
- BitmapPalette.cs
- SegmentInfo.cs
- ContentPathSegment.cs
- Page.cs
- KnownTypes.cs
- WmpBitmapDecoder.cs
- CollectionView.cs
- CharacterMetrics.cs
- FilterableAttribute.cs
- CodeTypeOfExpression.cs
- HotSpot.cs
- AnnotationService.cs
- WindowsFormsHostPropertyMap.cs
- NumberFormatter.cs
- SqlWebEventProvider.cs
- HttpHeaderCollection.cs
- ArrayTypeMismatchException.cs
- InternalTransaction.cs
- GlobalProxySelection.cs
- TemplateControl.cs
- HealthMonitoringSectionHelper.cs
- SpellerError.cs
- Package.cs
- Publisher.cs
- ComponentCommands.cs
- HighContrastHelper.cs
- BamlReader.cs
- PropertiesTab.cs
- EntityConnectionStringBuilder.cs
- mediaeventshelper.cs
- Parser.cs
- OdbcEnvironment.cs
- CrossSiteScriptingValidation.cs
- TextContainerHelper.cs
- TemplateControlBuildProvider.cs
- Transform.cs
- EntityTypeBase.cs
- RelationshipEnd.cs
- LocalBuilder.cs
- XmlElementAttribute.cs
- HMACSHA384.cs
- QilStrConcat.cs
- BitmapEffectInputData.cs
- DerivedKeySecurityToken.cs
- StoreContentChangedEventArgs.cs
- ParentQuery.cs
- XomlCompilerError.cs
- RequestUriProcessor.cs
- SectionRecord.cs
- ListSurrogate.cs
- DropShadowEffect.cs
- EnumBuilder.cs
- MiniMapControl.xaml.cs
- CompiledRegexRunner.cs
- ParameterDataSourceExpression.cs
- CompilerTypeWithParams.cs
- PropertyRef.cs
- Soap12ProtocolReflector.cs
- PageHandlerFactory.cs
- DataTable.cs
- BindingObserver.cs
- HttpResponseInternalWrapper.cs
- Dynamic.cs
- BinaryObjectWriter.cs