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
- _KerberosClient.cs
- QfeChecker.cs
- StandardTransformFactory.cs
- AutomationTextAttribute.cs
- Vector3DCollection.cs
- RegexCompiler.cs
- PropertyIdentifier.cs
- OAVariantLib.cs
- ResourcePool.cs
- TextDecorations.cs
- ContentPathSegment.cs
- DataGridViewColumnConverter.cs
- HttpCacheVary.cs
- AutomationEvent.cs
- SystemIPAddressInformation.cs
- SchemaSetCompiler.cs
- OdbcDataReader.cs
- BrowserTree.cs
- ChangeConflicts.cs
- ComplexPropertyEntry.cs
- ContentDesigner.cs
- formatter.cs
- Mappings.cs
- ReferenceEqualityComparer.cs
- RSAPKCS1SignatureDeformatter.cs
- SqlDataSourceConfigureSortForm.cs
- TransformProviderWrapper.cs
- ItemsControl.cs
- HtmlButton.cs
- Site.cs
- FormsAuthentication.cs
- ActivityExecutor.cs
- ProgressiveCrcCalculatingStream.cs
- XmlDocumentSerializer.cs
- UnsafeNativeMethods.cs
- ExceptionRoutedEventArgs.cs
- BufferCache.cs
- XamlReaderHelper.cs
- GeometryHitTestParameters.cs
- SecureUICommand.cs
- XmlSchemaSimpleTypeList.cs
- SessionEndingEventArgs.cs
- SqlConnectionHelper.cs
- WebBrowserContainer.cs
- Queue.cs
- Point3DConverter.cs
- WebPartChrome.cs
- SystemUnicastIPAddressInformation.cs
- WebPartDescriptionCollection.cs
- WsdlBuildProvider.cs
- WrappedIUnknown.cs
- EllipseGeometry.cs
- OptimalTextSource.cs
- AvTraceDetails.cs
- ProxyWebPart.cs
- XmlSchemaGroupRef.cs
- ScalarConstant.cs
- FtpRequestCacheValidator.cs
- FormsIdentity.cs
- SoapConverter.cs
- EventMetadata.cs
- RowVisual.cs
- XmlNode.cs
- DoubleCollection.cs
- XmlSchemaCompilationSettings.cs
- Utils.cs
- XmlQualifiedName.cs
- ResourceAssociationType.cs
- RawStylusInputReport.cs
- BasicBrowserDialog.designer.cs
- Propagator.Evaluator.cs
- ClientSettingsProvider.cs
- OleDbFactory.cs
- Calendar.cs
- PieceDirectory.cs
- TcpConnectionPoolSettings.cs
- XmlILIndex.cs
- DataAdapter.cs
- XmlParserContext.cs
- FormViewPagerRow.cs
- SectionInput.cs
- CompilerInfo.cs
- controlskin.cs
- NextPreviousPagerField.cs
- IgnoreFileBuildProvider.cs
- DataBoundControl.cs
- regiisutil.cs
- String.cs
- NamedPipeTransportManager.cs
- ToolStripArrowRenderEventArgs.cs
- AsymmetricAlgorithm.cs
- UpdatePanel.cs
- BatchParser.cs
- WinOEToolBoxItem.cs
- OleDbParameter.cs
- TypeConverterHelper.cs
- ResXResourceWriter.cs
- RewritingProcessor.cs
- ListComponentEditor.cs
- InternalsVisibleToAttribute.cs