Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DetailsViewPageEventArgs.cs
- ListBox.cs
- BooleanExpr.cs
- QueryRelOp.cs
- MembershipValidatePasswordEventArgs.cs
- ArrangedElementCollection.cs
- ClientBuildManagerCallback.cs
- RegexMatch.cs
- DocumentPageViewAutomationPeer.cs
- PinnedBufferMemoryStream.cs
- RectangleHotSpot.cs
- xmlsaver.cs
- TextSelectionHighlightLayer.cs
- XmlWrappingReader.cs
- LocatorPartList.cs
- UnsafeNativeMethods.cs
- OptimalBreakSession.cs
- FixedHyperLink.cs
- TypeUtil.cs
- DependencyPropertyChangedEventArgs.cs
- FormViewUpdateEventArgs.cs
- CodeRegionDirective.cs
- OdbcException.cs
- ReferencedType.cs
- ObjectItemLoadingSessionData.cs
- SchemaImporter.cs
- RankException.cs
- BindingManagerDataErrorEventArgs.cs
- SpecialNameAttribute.cs
- DefaultEventAttribute.cs
- RpcAsyncResult.cs
- ZipIORawDataFileBlock.cs
- NotSupportedException.cs
- GifBitmapEncoder.cs
- BaseValidator.cs
- CatalogPartChrome.cs
- CodeSnippetCompileUnit.cs
- Table.cs
- DependencyObject.cs
- DbSetClause.cs
- OletxTransactionManager.cs
- GridViewCancelEditEventArgs.cs
- ControlEvent.cs
- TargetPerspective.cs
- UserNamePasswordValidator.cs
- WebPartConnectionsCancelEventArgs.cs
- WebBrowser.cs
- SimpleRecyclingCache.cs
- BrowserCapabilitiesCompiler.cs
- MetadataCacheItem.cs
- InputDevice.cs
- SolidColorBrush.cs
- HtmlTableRowCollection.cs
- TimeoutException.cs
- SoapElementAttribute.cs
- StrokeCollection2.cs
- RequestReplyCorrelator.cs
- HtmlInputControl.cs
- DetailsViewUpdatedEventArgs.cs
- X509Logo.cs
- GrammarBuilderRuleRef.cs
- BookmarkUndoUnit.cs
- ProcessInputEventArgs.cs
- _ListenerAsyncResult.cs
- MatrixUtil.cs
- PerfService.cs
- PropertyMapper.cs
- HttpContext.cs
- OptimisticConcurrencyException.cs
- EntityRecordInfo.cs
- DesignerUtility.cs
- HierarchicalDataBoundControlAdapter.cs
- FragmentQueryProcessor.cs
- HtmlInputSubmit.cs
- DbConnectionStringCommon.cs
- IsolationInterop.cs
- Types.cs
- TypeDescriptor.cs
- X500Name.cs
- AssertSection.cs
- SelectionWordBreaker.cs
- Label.cs
- XmlUrlResolver.cs
- DBPropSet.cs
- EmptyEnumerator.cs
- PenContexts.cs
- ConfigurationErrorsException.cs
- SqlDataRecord.cs
- GestureRecognitionResult.cs
- InkCanvasSelectionAdorner.cs
- XmlElementAttributes.cs
- oledbmetadatacollectionnames.cs
- PropertyMapper.cs
- EntityDataSourceReferenceGroup.cs
- GridViewRowEventArgs.cs
- IndependentlyAnimatedPropertyMetadata.cs
- TypeRestriction.cs
- ConfigurationSettings.cs
- Update.cs
- HttpListenerResponse.cs