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
- IPGlobalProperties.cs
- PrivilegedConfigurationManager.cs
- SafeRightsManagementPubHandle.cs
- HtmlSelectionListAdapter.cs
- SendActivityDesigner.cs
- CatalogZone.cs
- ControlBuilderAttribute.cs
- ObjectDataSource.cs
- SizeF.cs
- FilterQueryOptionExpression.cs
- ButtonFieldBase.cs
- SubqueryRules.cs
- Classification.cs
- WebHttpBehavior.cs
- WmfPlaceableFileHeader.cs
- SqlUserDefinedTypeAttribute.cs
- NumberSubstitution.cs
- BitmapMetadata.cs
- SchemaElement.cs
- KeyValueSerializer.cs
- HttpPostedFile.cs
- TemplatedMailWebEventProvider.cs
- PackageRelationship.cs
- Pair.cs
- TypeContext.cs
- ListView.cs
- EntityCommand.cs
- DateTimeConverter.cs
- TreeViewImageIndexConverter.cs
- MetafileHeaderWmf.cs
- RawTextInputReport.cs
- DictionaryItemsCollection.cs
- GridEntryCollection.cs
- TdsRecordBufferSetter.cs
- ConfigXmlReader.cs
- DataGridTextBox.cs
- WebRequestModulesSection.cs
- ThicknessAnimationUsingKeyFrames.cs
- CustomCredentialPolicy.cs
- EventEntry.cs
- ComEventsInfo.cs
- BamlTreeMap.cs
- SafeRightsManagementQueryHandle.cs
- DataGridViewCellLinkedList.cs
- ParsedAttributeCollection.cs
- RenderingEventArgs.cs
- ConnectionPoint.cs
- GPPOINT.cs
- HashSetDebugView.cs
- Accessors.cs
- AutoCompleteStringCollection.cs
- SBCSCodePageEncoding.cs
- StorageAssociationTypeMapping.cs
- UniqueIdentifierService.cs
- DoubleUtil.cs
- XmlRootAttribute.cs
- TextRenderer.cs
- Workspace.cs
- XmlSequenceWriter.cs
- UrlPropertyAttribute.cs
- FontUnit.cs
- Configuration.cs
- ObjectStateFormatter.cs
- Menu.cs
- FileUtil.cs
- MimeFormatter.cs
- MinimizableAttributeTypeConverter.cs
- ObjectHandle.cs
- ReachFixedPageSerializerAsync.cs
- LogWriteRestartAreaState.cs
- BitmapSource.cs
- BatchParser.cs
- BindingContext.cs
- ContractMapping.cs
- ListenerElementsCollection.cs
- NativeRecognizer.cs
- OleStrCAMarshaler.cs
- MaterialGroup.cs
- MsmqMessageSerializationFormat.cs
- ProxySimple.cs
- Rfc2898DeriveBytes.cs
- TextTrailingCharacterEllipsis.cs
- XmlMembersMapping.cs
- EastAsianLunisolarCalendar.cs
- basevalidator.cs
- PublisherMembershipCondition.cs
- CurrencyManager.cs
- TextParaLineResult.cs
- PersistenceParticipant.cs
- LocalizationParserHooks.cs
- WinFormsComponentEditor.cs
- ToolStripContainerActionList.cs
- JsonDeserializer.cs
- CreateInstanceBinder.cs
- ComponentChangingEvent.cs
- PropertyTabChangedEvent.cs
- FillRuleValidation.cs
- AddingNewEventArgs.cs
- Listen.cs
- ReadOnlyHierarchicalDataSourceView.cs