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
- PasswordRecovery.cs
- TableParaClient.cs
- List.cs
- BrowserCapabilitiesFactory.cs
- InnerItemCollectionView.cs
- ToolZone.cs
- PrintPreviewGraphics.cs
- UnaryExpression.cs
- VirtualizedContainerService.cs
- BigIntegerStorage.cs
- StrokeSerializer.cs
- SafeNativeMemoryHandle.cs
- XmlSchemaSimpleContentRestriction.cs
- XPathBinder.cs
- Variable.cs
- SiteMapDataSource.cs
- ProcessModuleCollection.cs
- XamlDesignerSerializationManager.cs
- SqlBulkCopyColumnMapping.cs
- DataKeyPropertyAttribute.cs
- KernelTypeValidation.cs
- ConsoleTraceListener.cs
- TextChangedEventArgs.cs
- TreeNodeConverter.cs
- METAHEADER.cs
- ProxyElement.cs
- MatrixConverter.cs
- ClientScriptItem.cs
- ConnectionsZone.cs
- StrokeNodeEnumerator.cs
- HebrewCalendar.cs
- AsyncPostBackTrigger.cs
- NativeMethods.cs
- KnownIds.cs
- MinMaxParagraphWidth.cs
- StreamMarshaler.cs
- Literal.cs
- Convert.cs
- Utils.cs
- PageHandlerFactory.cs
- ISAPIRuntime.cs
- VisualTransition.cs
- ConnectivityStatus.cs
- TemplateBamlTreeBuilder.cs
- ImpersonationContext.cs
- ListParaClient.cs
- FileInfo.cs
- WebPartConnectionsDisconnectVerb.cs
- ArithmeticException.cs
- SoapAttributes.cs
- ComPlusSynchronizationContext.cs
- Formatter.cs
- PrincipalPermission.cs
- EntityViewGenerationAttribute.cs
- XmlExtensionFunction.cs
- Popup.cs
- QueryStringParameter.cs
- ScalarOps.cs
- MostlySingletonList.cs
- NameObjectCollectionBase.cs
- ViewPort3D.cs
- KeyGesture.cs
- HttpProcessUtility.cs
- UIntPtr.cs
- SymbolMethod.cs
- DesignRelation.cs
- Transaction.cs
- Transactions.cs
- SchemaImporter.cs
- RelationshipNavigation.cs
- NumberSubstitution.cs
- Point4D.cs
- WindowsAltTab.cs
- FontSourceCollection.cs
- HyperLink.cs
- WebServiceBindingAttribute.cs
- AsyncContentLoadedEventArgs.cs
- OleAutBinder.cs
- IntSecurity.cs
- SecurityContextCookieSerializer.cs
- DrawingContextDrawingContextWalker.cs
- MoveSizeWinEventHandler.cs
- FileSecurity.cs
- TransformGroup.cs
- LOSFormatter.cs
- ValidatingReaderNodeData.cs
- CheckPair.cs
- ReadOnlyDictionary.cs
- Debug.cs
- DockPatternIdentifiers.cs
- KeyToListMap.cs
- ReadOnlyDataSourceView.cs
- SessionConnectionReader.cs
- updateconfighost.cs
- PerformanceCounterPermissionEntry.cs
- PriorityRange.cs
- DataRecordObjectView.cs
- SystemColors.cs
- CurrentTimeZone.cs
- CapiSymmetricAlgorithm.cs