Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / xsp / System / Web / Extensions / ui / ResourceDefaultValueAttribute.cs / 1 / ResourceDefaultValueAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Reflection; using System.Web.Resources; [AttributeUsage(AttributeTargets.All)] internal sealed class ResourceDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _resourceLoaded; internal ResourceDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal ResourceDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_resourceLoaded) { _resourceLoaded = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = AtlasWeb.ResourceManager.GetString(baseValue, AtlasWeb.Culture); 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.UI { using System; using System.ComponentModel; using System.Reflection; using System.Web.Resources; [AttributeUsage(AttributeTargets.All)] internal sealed class ResourceDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _resourceLoaded; internal ResourceDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal ResourceDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_resourceLoaded) { _resourceLoaded = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = AtlasWeb.ResourceManager.GetString(baseValue, AtlasWeb.Culture); 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
- TypeHelpers.cs
- Model3DGroup.cs
- BufferedStream.cs
- OrderedDictionaryStateHelper.cs
- ListDictionary.cs
- GeometryHitTestResult.cs
- SynchronizingStream.cs
- WebBodyFormatMessageProperty.cs
- GridEntry.cs
- DocumentPageViewAutomationPeer.cs
- CustomPopupPlacement.cs
- configsystem.cs
- StringStorage.cs
- objectresult_tresulttype.cs
- GPPOINTF.cs
- RelationshipWrapper.cs
- ProfileGroupSettings.cs
- OleDbMetaDataFactory.cs
- CatalogZoneDesigner.cs
- HitTestFilterBehavior.cs
- SourceInterpreter.cs
- TextRenderer.cs
- RuntimeWrappedException.cs
- SerializerProvider.cs
- Vector3DConverter.cs
- BasicExpandProvider.cs
- SHA1.cs
- Keyboard.cs
- NamespaceEmitter.cs
- BitmapEffectDrawingContextWalker.cs
- OpenTypeLayoutCache.cs
- System.Data.OracleClient_BID.cs
- WindowsSysHeader.cs
- RSAPKCS1SignatureDeformatter.cs
- UpdateCompiler.cs
- TcpDuplicateContext.cs
- FillBehavior.cs
- WebServiceEnumData.cs
- HandlerWithFactory.cs
- CallbackValidatorAttribute.cs
- ReadonlyMessageFilter.cs
- MSG.cs
- iisPickupDirectory.cs
- ImmutableCommunicationTimeouts.cs
- DynamicMethod.cs
- XD.cs
- RuntimeConfigurationRecord.cs
- ExceptionUtil.cs
- TransactionManager.cs
- StructuralComparisons.cs
- TemplatedWizardStep.cs
- Currency.cs
- FixedSOMTableCell.cs
- SqlInternalConnection.cs
- RawStylusInputCustomData.cs
- DrawListViewSubItemEventArgs.cs
- DataBoundLiteralControl.cs
- RequestUriProcessor.cs
- KeyboardEventArgs.cs
- DataGridViewColumn.cs
- TreeNodeCollectionEditorDialog.cs
- TransactedReceiveScope.cs
- NotifyInputEventArgs.cs
- SecureUICommand.cs
- WebPartDescription.cs
- OracleRowUpdatedEventArgs.cs
- SettingsAttributeDictionary.cs
- SecurityTraceRecordHelper.cs
- FontSizeConverter.cs
- SuppressMessageAttribute.cs
- XmlHierarchicalEnumerable.cs
- COM2IPerPropertyBrowsingHandler.cs
- View.cs
- ParsedAttributeCollection.cs
- DataBindingExpressionBuilder.cs
- StringFreezingAttribute.cs
- BrowserInteropHelper.cs
- PersonalizationStateInfoCollection.cs
- SqlDeflator.cs
- RowType.cs
- PropertyDescriptor.cs
- AdvancedBindingEditor.cs
- DependencyPropertyHelper.cs
- HttpHandler.cs
- ReadOnlyDataSource.cs
- XmlDownloadManager.cs
- DiscoveryClientOutputChannel.cs
- unsafenativemethodsother.cs
- XmlSiteMapProvider.cs
- GradientBrush.cs
- BamlLocalizableResource.cs
- M3DUtil.cs
- LinkArea.cs
- KeyedCollection.cs
- PointCollectionConverter.cs
- SiteMapDataSourceView.cs
- MenuItemBindingCollection.cs
- DefaultValueTypeConverter.cs
- TreePrinter.cs
- DataGridTable.cs