Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NavigationProperty.cs
- CounterCreationData.cs
- ParserHooks.cs
- HtmlInputSubmit.cs
- DrawingAttributes.cs
- MembershipSection.cs
- ReturnType.cs
- Model3D.cs
- TemplateModeChangedEventArgs.cs
- RemotingConfigParser.cs
- CriticalHandle.cs
- ParsedRoute.cs
- ArraySubsetEnumerator.cs
- ConfigurationStrings.cs
- MergablePropertyAttribute.cs
- BufferedGraphicsManager.cs
- SafeEventLogReadHandle.cs
- _HeaderInfoTable.cs
- LayoutEngine.cs
- WpfKnownMemberInvoker.cs
- DataServiceRequestOfT.cs
- FixedLineResult.cs
- SplitContainer.cs
- Rectangle.cs
- InlineUIContainer.cs
- PenCursorManager.cs
- SQLUtility.cs
- XmlWellformedWriter.cs
- LogExtentCollection.cs
- EdgeProfileValidation.cs
- ToolStripItemClickedEventArgs.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DurableRuntimeValidator.cs
- XPathDocumentBuilder.cs
- Menu.cs
- ZoneIdentityPermission.cs
- FormsAuthenticationCredentials.cs
- DataSourceHelper.cs
- DesignerGenericWebPart.cs
- Primitive.cs
- DBBindings.cs
- HttpRequestCacheValidator.cs
- SHA1Managed.cs
- BulletDecorator.cs
- PeerApplicationLaunchInfo.cs
- UnsafeNativeMethods.cs
- BlockUIContainer.cs
- ZoneMembershipCondition.cs
- WrapPanel.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- Process.cs
- ScrollBar.cs
- JpegBitmapDecoder.cs
- HashCryptoHandle.cs
- XmlArrayItemAttribute.cs
- SafeRegistryHandle.cs
- UnmanagedMemoryStreamWrapper.cs
- ObjectIDGenerator.cs
- TextSelection.cs
- EntityDataSourceDesignerHelper.cs
- AnonymousIdentificationModule.cs
- SqlGatherConsumedAliases.cs
- Int64AnimationBase.cs
- OptimalBreakSession.cs
- AxParameterData.cs
- odbcmetadatafactory.cs
- InvalidPrinterException.cs
- ErrorTolerantObjectWriter.cs
- GeometryCombineModeValidation.cs
- EntityDataSourceSelectedEventArgs.cs
- BamlMapTable.cs
- AttributeSetAction.cs
- IgnoreDeviceFilterElement.cs
- CompiledQueryCacheEntry.cs
- RangeValidator.cs
- EFColumnProvider.cs
- FixedTextPointer.cs
- DirectionalLight.cs
- IOThreadTimer.cs
- TextEditorDragDrop.cs
- PageStatePersister.cs
- SimpleTextLine.cs
- HttpResponseHeader.cs
- UnsafeNativeMethods.cs
- TimeEnumHelper.cs
- AddInControllerImpl.cs
- BuilderElements.cs
- XmlILOptimizerVisitor.cs
- SchemaName.cs
- SignerInfo.cs
- InlineCollection.cs
- FileVersion.cs
- ColumnBinding.cs
- ButtonChrome.cs
- MetadataArtifactLoader.cs
- DragEvent.cs
- CompositeCollection.cs
- PreloadedPackages.cs
- ReliabilityContractAttribute.cs
- TeredoHelper.cs