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
- RealProxy.cs
- HttpPostedFileWrapper.cs
- Tag.cs
- UrlPath.cs
- ConnectAlgorithms.cs
- _ConnectionGroup.cs
- TypeUnloadedException.cs
- TableParagraph.cs
- NavigationProgressEventArgs.cs
- OpCopier.cs
- BindingsCollection.cs
- DesignerTextBoxAdapter.cs
- Soap.cs
- DesignerToolboxInfo.cs
- TextTreeTextNode.cs
- Evidence.cs
- ChannelListenerBase.cs
- Int64Storage.cs
- assertwrapper.cs
- ZipIOLocalFileHeader.cs
- RequestCacheEntry.cs
- ColorKeyFrameCollection.cs
- UserPreferenceChangingEventArgs.cs
- BaseHashHelper.cs
- OptionalRstParameters.cs
- _SslState.cs
- ArrangedElement.cs
- EnumValAlphaComparer.cs
- SerializerProvider.cs
- MediaElement.cs
- ResizeGrip.cs
- QilName.cs
- TextEditorDragDrop.cs
- ContextBase.cs
- EntityDataSourceUtil.cs
- ArrangedElementCollection.cs
- ErrorFormatterPage.cs
- Serialization.cs
- UpnEndpointIdentityExtension.cs
- PropertyCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- ResourceManager.cs
- ProfessionalColorTable.cs
- FrugalList.cs
- DataGridViewSortCompareEventArgs.cs
- MultipartContentParser.cs
- SaveCardRequest.cs
- ObjectContext.cs
- ContextProperty.cs
- GeometryDrawing.cs
- DataGridViewCell.cs
- ListControlDataBindingHandler.cs
- ComboBoxRenderer.cs
- XpsImageSerializationService.cs
- SchemaObjectWriter.cs
- WorkflowNamespace.cs
- CustomErrorCollection.cs
- MailHeaderInfo.cs
- PropertyGeneratedEventArgs.cs
- RegexCharClass.cs
- LinqDataSourceInsertEventArgs.cs
- SQLInt16Storage.cs
- MetadataCache.cs
- OdbcConnectionFactory.cs
- WriteLine.cs
- HttpCapabilitiesBase.cs
- COSERVERINFO.cs
- HttpCachePolicyWrapper.cs
- SQLCharsStorage.cs
- PolicyStatement.cs
- DefaultHttpHandler.cs
- XmlSchemaNotation.cs
- BinaryReader.cs
- HtmlInputButton.cs
- DeclarationUpdate.cs
- FlowPanelDesigner.cs
- DeferredReference.cs
- AutomationFocusChangedEventArgs.cs
- FormViewUpdatedEventArgs.cs
- Binding.cs
- OdbcCommand.cs
- DescendantBaseQuery.cs
- WindowsScrollBar.cs
- Action.cs
- TimeSpan.cs
- ConfigXmlAttribute.cs
- NullExtension.cs
- TextSimpleMarkerProperties.cs
- GenericParameterDataContract.cs
- Socket.cs
- HttpCachePolicy.cs
- ListViewSortEventArgs.cs
- Empty.cs
- Pts.cs
- mactripleDES.cs
- Peer.cs
- AttachedAnnotation.cs
- EditorPartDesigner.cs
- ValidationSummaryDesigner.cs
- ScriptRegistrationManager.cs