Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DecimalAverageAggregationOperator.cs
- DefaultTextStoreTextComposition.cs
- MobileCategoryAttribute.cs
- Quaternion.cs
- SerializationInfo.cs
- DataMemberFieldEditor.cs
- MdiWindowListStrip.cs
- FreezableDefaultValueFactory.cs
- ImageList.cs
- VectorCollectionValueSerializer.cs
- DataGridViewRowStateChangedEventArgs.cs
- DependencyPropertyChangedEventArgs.cs
- AutomationElementCollection.cs
- TextSearch.cs
- SoapReflectionImporter.cs
- PrinterSettings.cs
- AssemblyAssociatedContentFileAttribute.cs
- DrawToolTipEventArgs.cs
- WebPartZone.cs
- ZoneLinkButton.cs
- SyndicationDeserializer.cs
- SqlRecordBuffer.cs
- ToolStripRenderer.cs
- TemplateControlCodeDomTreeGenerator.cs
- AutomationEvent.cs
- WsdlInspector.cs
- ListControl.cs
- SchemaName.cs
- NamespaceEmitter.cs
- SequenceFullException.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- LoginNameDesigner.cs
- Span.cs
- AppSecurityManager.cs
- DocumentPageHost.cs
- TreeNodeStyleCollection.cs
- ExpressionBuilderCollection.cs
- DataGridTextBox.cs
- DecimalAnimationBase.cs
- SqlConnectionFactory.cs
- Scheduler.cs
- ChannelSinkStacks.cs
- ByteStream.cs
- DataGridViewRowCancelEventArgs.cs
- Win32MouseDevice.cs
- RIPEMD160Managed.cs
- ValidationSummary.cs
- UIElement.cs
- BamlLocalizabilityResolver.cs
- Comparer.cs
- DoubleAnimationUsingKeyFrames.cs
- FixedSOMTableCell.cs
- StrokeNodeData.cs
- SocketInformation.cs
- OrderedDictionary.cs
- EditorZone.cs
- SspiHelper.cs
- TemplatedEditableDesignerRegion.cs
- DataGridViewCellParsingEventArgs.cs
- UnsafeNativeMethodsTablet.cs
- Scene3D.cs
- GlyphingCache.cs
- CollectionType.cs
- IPGlobalProperties.cs
- WmlPanelAdapter.cs
- HtmlElementCollection.cs
- Pen.cs
- Msec.cs
- XmlNotation.cs
- SerTrace.cs
- Pick.cs
- RepeaterDesigner.cs
- PageHandlerFactory.cs
- RetrieveVirtualItemEventArgs.cs
- KnownColorTable.cs
- ProviderSettings.cs
- AssociativeAggregationOperator.cs
- SchemaTableColumn.cs
- SettingsPropertyValue.cs
- DetailsView.cs
- StateManagedCollection.cs
- HatchBrush.cs
- TdsParameterSetter.cs
- HashHelper.cs
- HwndKeyboardInputProvider.cs
- PrintPreviewControl.cs
- RegisteredDisposeScript.cs
- EntityCommandCompilationException.cs
- ConfigWriter.cs
- TraceData.cs
- DataViewSetting.cs
- BlockExpression.cs
- EventWaitHandleSecurity.cs
- SmtpMail.cs
- FileVersionInfo.cs
- hebrewshape.cs
- DesignTimeSiteMapProvider.cs
- GcSettings.cs
- ISessionStateStore.cs
- LogStore.cs