Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InstanceKeyCompleteException.cs
- ProcessHost.cs
- CodeCompileUnit.cs
- EntityUtil.cs
- GridProviderWrapper.cs
- UnitControl.cs
- _HeaderInfo.cs
- BoundingRectTracker.cs
- Point3D.cs
- DateTimeConverter.cs
- ParenthesizePropertyNameAttribute.cs
- PropertyDescriptor.cs
- ProtocolsConfigurationHandler.cs
- WebBrowsableAttribute.cs
- TemplateControl.cs
- TypeDependencyAttribute.cs
- GPPOINTF.cs
- RadialGradientBrush.cs
- CapabilitiesRule.cs
- EntityDataSourceEntityTypeFilterItem.cs
- State.cs
- ProfilePropertyNameValidator.cs
- DataRowView.cs
- TdsParameterSetter.cs
- NumberAction.cs
- ProxyHelper.cs
- SqlGatherConsumedAliases.cs
- ListSourceHelper.cs
- SerializationAttributes.cs
- WorkflowPersistenceContext.cs
- SerializationException.cs
- DataExpression.cs
- WpfPayload.cs
- ListComponentEditorPage.cs
- ValueProviderWrapper.cs
- DataGridViewRow.cs
- Color.cs
- GridItem.cs
- Compiler.cs
- Cast.cs
- NetTcpBinding.cs
- AttributeUsageAttribute.cs
- IImplicitResourceProvider.cs
- LinkLabel.cs
- HyperLinkStyle.cs
- DesignerRegionMouseEventArgs.cs
- XmlSchemaCompilationSettings.cs
- StrongName.cs
- MeshGeometry3D.cs
- WindowCollection.cs
- XmlHierarchyData.cs
- ApplicationTrust.cs
- CircleHotSpot.cs
- EnvironmentPermission.cs
- SecurityUtils.cs
- XmlObjectSerializerWriteContext.cs
- DataGridItemEventArgs.cs
- StreamGeometryContext.cs
- RotateTransform3D.cs
- AnyAllSearchOperator.cs
- ByteStorage.cs
- XPathNavigatorReader.cs
- XPathItem.cs
- DataGridViewRowsRemovedEventArgs.cs
- RoutedUICommand.cs
- HttpContext.cs
- ReturnType.cs
- SourceChangedEventArgs.cs
- StyleHelper.cs
- HttpCacheVaryByContentEncodings.cs
- FlowDocumentView.cs
- DelayLoadType.cs
- InboundActivityHelper.cs
- SizeKeyFrameCollection.cs
- InvocationExpression.cs
- IODescriptionAttribute.cs
- UriTemplateQueryValue.cs
- CollectionType.cs
- Serializer.cs
- AssemblyCollection.cs
- DbConnectionStringCommon.cs
- EncoderReplacementFallback.cs
- WebPartExportVerb.cs
- BinaryMessageEncoder.cs
- TableRowCollection.cs
- SettingsBase.cs
- ExtendLockCommand.cs
- PathParser.cs
- GPPOINTF.cs
- ContentControl.cs
- XsltException.cs
- PieceNameHelper.cs
- DataControlReferenceCollection.cs
- ByteViewer.cs
- LinkLabelLinkClickedEvent.cs
- DragAssistanceManager.cs
- List.cs
- WebPartVerbCollection.cs
- KeyTimeConverter.cs
- Assert.cs