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
- CacheEntry.cs
- CheckableControlBaseAdapter.cs
- BulletedListEventArgs.cs
- BaseHashHelper.cs
- PauseStoryboard.cs
- listviewsubitemcollectioneditor.cs
- DragEventArgs.cs
- AsyncOperationManager.cs
- WebPartEditorApplyVerb.cs
- DesignerSelectionListAdapter.cs
- OleStrCAMarshaler.cs
- AutomationElementIdentifiers.cs
- TokenDescriptor.cs
- X509CertificateCollection.cs
- DbConnectionPoolGroup.cs
- DataServiceQueryProvider.cs
- DbFunctionCommandTree.cs
- DocumentViewerBase.cs
- ApplicationActivator.cs
- CorrelationManager.cs
- SqlDependencyListener.cs
- CodeNamespaceImport.cs
- MediaElementAutomationPeer.cs
- ReadOnlyHierarchicalDataSource.cs
- CompiledQueryCacheEntry.cs
- HashCodeCombiner.cs
- HandlerFactoryWrapper.cs
- SpecialTypeDataContract.cs
- CellPartitioner.cs
- CreateDataSourceDialog.cs
- InputLangChangeRequestEvent.cs
- Oci.cs
- AsyncPostBackTrigger.cs
- ManipulationStartingEventArgs.cs
- SmiMetaDataProperty.cs
- SiteMapDataSource.cs
- AssemblyAttributesGoHere.cs
- DependencyPropertyHelper.cs
- PathFigure.cs
- SerialPort.cs
- SessionIDManager.cs
- CursorEditor.cs
- ComPlusThreadInitializer.cs
- FormsAuthenticationCredentials.cs
- ProtectedConfigurationSection.cs
- DataColumnChangeEvent.cs
- LogAppendAsyncResult.cs
- TablePatternIdentifiers.cs
- PolyBezierSegmentFigureLogic.cs
- XPathAncestorQuery.cs
- LinkLabel.cs
- HttpRequestBase.cs
- CoTaskMemUnicodeSafeHandle.cs
- X509Certificate.cs
- Pair.cs
- DesignerVerbCollection.cs
- ConnectionPoolManager.cs
- DataGridAddNewRow.cs
- QueryOperatorEnumerator.cs
- ProfilePropertyNameValidator.cs
- ZipPackage.cs
- documentsequencetextview.cs
- AdornerHitTestResult.cs
- CardSpaceSelector.cs
- ExpressionVisitorHelpers.cs
- ReadOnlyCollectionBase.cs
- LoginDesigner.cs
- RequiredFieldValidator.cs
- Environment.cs
- RealProxy.cs
- MultiSelectRootGridEntry.cs
- ManagementScope.cs
- PeerInputChannel.cs
- Accessible.cs
- TypeDescriptionProvider.cs
- PropertyGridEditorPart.cs
- Stack.cs
- PrinterResolution.cs
- HttpCapabilitiesSectionHandler.cs
- MethodMessage.cs
- FileLevelControlBuilderAttribute.cs
- BatchServiceHost.cs
- InternalsVisibleToAttribute.cs
- OleDbErrorCollection.cs
- TraceShell.cs
- SiteMapDataSource.cs
- PreservationFileReader.cs
- MetricEntry.cs
- LambdaCompiler.ControlFlow.cs
- CodeBlockBuilder.cs
- CreateUserWizardAutoFormat.cs
- HtmlHistory.cs
- FrugalList.cs
- XmlSchemaCollection.cs
- Matrix.cs
- SmiContext.cs
- MeasurementDCInfo.cs
- UpDownBase.cs
- TransformationRules.cs
- AccessDataSourceWizardForm.cs