Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / WebSysDefaultValueAttribute.cs / 1305376 / 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
- NativeMethods.cs
- PropertyContainer.cs
- HwndHostAutomationPeer.cs
- Stackframe.cs
- CallbackValidatorAttribute.cs
- GenericTypeParameterConverter.cs
- PrinterResolution.cs
- XmlSchemaValidationException.cs
- ParameterBuilder.cs
- PathFigure.cs
- Emitter.cs
- StrongBox.cs
- AlternateView.cs
- UserControl.cs
- SectionUpdates.cs
- DirectoryRedirect.cs
- WebPartDisplayModeCancelEventArgs.cs
- WebResourceAttribute.cs
- PropertyGridEditorPart.cs
- ActivityDesignerResources.cs
- ByteKeyFrameCollection.cs
- Root.cs
- SoapEnumAttribute.cs
- XmlSchemaValidationException.cs
- SelectionListDesigner.cs
- DateTimeOffsetConverter.cs
- ToolStripContainer.cs
- PkcsUtils.cs
- TargetException.cs
- AuthenticationConfig.cs
- SubordinateTransaction.cs
- StorageScalarPropertyMapping.cs
- Enlistment.cs
- TreeViewItem.cs
- HtmlMobileTextWriter.cs
- NotImplementedException.cs
- ProfileEventArgs.cs
- PropertyEntry.cs
- MetadataSource.cs
- Privilege.cs
- NamespaceDisplay.xaml.cs
- LineSegment.cs
- NativeRightsManagementAPIsStructures.cs
- SoapAttributes.cs
- HMACRIPEMD160.cs
- Win32KeyboardDevice.cs
- App.cs
- XmlIlVisitor.cs
- DecoderNLS.cs
- HashRepartitionEnumerator.cs
- ProvidersHelper.cs
- EpmAttributeNameBuilder.cs
- FileUtil.cs
- PersonalizationState.cs
- ImageDrawing.cs
- SrgsRulesCollection.cs
- TextEffect.cs
- Activator.cs
- ConfigDefinitionUpdates.cs
- CompatibleComparer.cs
- ComponentGuaranteesAttribute.cs
- ImageMap.cs
- ADMembershipUser.cs
- UIElement3D.cs
- DrawingCollection.cs
- BindStream.cs
- SqlCommand.cs
- TextFormatterImp.cs
- XmlSerializationGeneratedCode.cs
- BufferBuilder.cs
- ProtocolsConfigurationHandler.cs
- DataTableClearEvent.cs
- RegionIterator.cs
- AuthenticationService.cs
- xmlformatgeneratorstatics.cs
- PagerSettings.cs
- NamespaceInfo.cs
- ViewManager.cs
- LayoutTableCell.cs
- VirtualStackFrame.cs
- NavigationWindowAutomationPeer.cs
- SingleKeyFrameCollection.cs
- BamlLocalizabilityResolver.cs
- VisualStyleTypesAndProperties.cs
- TransformerTypeCollection.cs
- ClientSettings.cs
- ComponentCommands.cs
- PathBox.cs
- DeferrableContent.cs
- WebZoneDesigner.cs
- RemotingConfigParser.cs
- CustomWebEventKey.cs
- XmlHierarchyData.cs
- XmlCountingReader.cs
- UpdateCompiler.cs
- Encoder.cs
- Span.cs
- CustomLineCap.cs
- AuthenticationService.cs
- StrongNameMembershipCondition.cs