Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- GenericAuthenticationEventArgs.cs
- HtmlInputFile.cs
- FixUpCollection.cs
- WorkflowHostingEndpoint.cs
- TextUtf8RawTextWriter.cs
- DictationGrammar.cs
- DataQuery.cs
- TargetConverter.cs
- WorkflowItemPresenter.cs
- HttpProcessUtility.cs
- KeyEvent.cs
- MD5.cs
- ConfigurationManagerHelper.cs
- ConnectionManagementElementCollection.cs
- IdleTimeoutMonitor.cs
- DebugView.cs
- UInt32Converter.cs
- SchemaMapping.cs
- HwndMouseInputProvider.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DataGridColumnCollection.cs
- FloaterBaseParagraph.cs
- Function.cs
- FormViewModeEventArgs.cs
- TextContainerChangeEventArgs.cs
- UIElement3D.cs
- Stack.cs
- Panel.cs
- TextTreeFixupNode.cs
- EventBookmark.cs
- ToolBarButtonClickEvent.cs
- IncrementalReadDecoders.cs
- ControlEvent.cs
- QilInvokeEarlyBound.cs
- TextPointer.cs
- RecommendedAsConfigurableAttribute.cs
- Comparer.cs
- ConfigXmlDocument.cs
- SelectionManager.cs
- SecurityContextSecurityTokenResolver.cs
- MetadataSource.cs
- ReliableDuplexSessionChannel.cs
- HotSpotCollection.cs
- Constraint.cs
- NetworkStream.cs
- TypedTableHandler.cs
- SpellerError.cs
- ConnectionStringsExpressionBuilder.cs
- RuleInfoComparer.cs
- ColumnWidthChangedEvent.cs
- CFStream.cs
- Rijndael.cs
- GridViewRowCollection.cs
- MissingMethodException.cs
- GridViewCancelEditEventArgs.cs
- HotSpotCollectionEditor.cs
- Update.cs
- ComponentDispatcher.cs
- DesignerAdRotatorAdapter.cs
- XmlReaderSettings.cs
- hwndwrapper.cs
- SingleStorage.cs
- ChunkedMemoryStream.cs
- SchemaMapping.cs
- FormViewInsertedEventArgs.cs
- ControlAdapter.cs
- MetabaseServerConfig.cs
- SerializationInfoEnumerator.cs
- WebControlsSection.cs
- DateTimeFormat.cs
- dbdatarecord.cs
- WindowsListBox.cs
- SessionIDManager.cs
- EngineSite.cs
- Missing.cs
- CalendarAutoFormatDialog.cs
- DataGridDetailsPresenter.cs
- XsdBuildProvider.cs
- ToolZone.cs
- ObjectStateManagerMetadata.cs
- FunctionImportElement.cs
- Style.cs
- DoubleCollection.cs
- AppSettingsReader.cs
- NumericUpDownAccelerationCollection.cs
- TableLayoutColumnStyleCollection.cs
- XPathNavigatorReader.cs
- ArgumentNullException.cs
- _AutoWebProxyScriptHelper.cs
- SizeFConverter.cs
- NativeMethods.cs
- NamespaceTable.cs
- StorageConditionPropertyMapping.cs
- AncestorChangedEventArgs.cs
- ConstrainedDataObject.cs
- WebBrowsableAttribute.cs
- NativeMethods.cs
- ErrorTolerantObjectWriter.cs
- CodeAttributeArgumentCollection.cs
- RequestSecurityTokenSerializer.cs