Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / ComponentResourceKeyConverter.cs / 1 / ComponentResourceKeyConverter.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; using System.Diagnostics; namespace System.Windows.Markup { ////// TypeConverter for a resource value expression /// public class ComponentResourceKeyConverter : ExpressionConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == null) { throw new ArgumentNullException("sourceType"); } return base.CanConvertFrom(context, sourceType); } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { // Validate Input Arguments if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return base.ConvertFrom(context, culture, value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { // Validate Input Arguments ComponentResourceKey key = value as ComponentResourceKey; if (key == null) { throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "ComponentResourceKey")); } if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; using System.Diagnostics; namespace System.Windows.Markup { ////// TypeConverter for a resource value expression /// public class ComponentResourceKeyConverter : ExpressionConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == null) { throw new ArgumentNullException("sourceType"); } return base.CanConvertFrom(context, sourceType); } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { // Validate Input Arguments if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { return base.ConvertFrom(context, culture, value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { // Validate Input Arguments ComponentResourceKey key = value as ComponentResourceKey; if (key == null) { throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "ComponentResourceKey")); } if (destinationType == null) { throw new ArgumentNullException("destinationType"); } return base.CanConvertTo(context, destinationType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectDataSourceStatusEventArgs.cs
- WebConfigurationHostFileChange.cs
- InfoCardCryptoHelper.cs
- ValidatedControlConverter.cs
- ReadOnlyCollection.cs
- XmlSchemaAnnotation.cs
- DbConnectionStringBuilder.cs
- TailCallAnalyzer.cs
- BaseParaClient.cs
- Mutex.cs
- TemplateInstanceAttribute.cs
- Rijndael.cs
- TextReader.cs
- ResourceFallbackManager.cs
- ParameterToken.cs
- UnknownBitmapDecoder.cs
- AlphaSortedEnumConverter.cs
- UnsafeNativeMethods.cs
- ExpressionDumper.cs
- Label.cs
- InputBindingCollection.cs
- XhtmlBasicFormAdapter.cs
- JoinSymbol.cs
- DataGridTextBoxColumn.cs
- OdbcConnectionOpen.cs
- DataColumn.cs
- Switch.cs
- StrokeNodeOperations.cs
- StaticResourceExtension.cs
- BrowserDefinitionCollection.cs
- _UriTypeConverter.cs
- IChannel.cs
- ChameleonKey.cs
- X509WindowsSecurityToken.cs
- KeyedCollection.cs
- BasicExpressionVisitor.cs
- NativeMethods.cs
- NativeMethods.cs
- ToolStripOverflow.cs
- WebPartZoneBaseDesigner.cs
- FastEncoder.cs
- Empty.cs
- ParagraphVisual.cs
- Certificate.cs
- DateTimeOffsetStorage.cs
- ExpressionTable.cs
- WindowsFont.cs
- DataControlFieldCell.cs
- FormDesigner.cs
- SqlNodeAnnotations.cs
- AccessibleObject.cs
- CellRelation.cs
- XmlSchemaParticle.cs
- DetailsViewUpdatedEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- NameValuePair.cs
- Zone.cs
- DataConnectionHelper.cs
- SecurityUtils.cs
- FlowLayoutSettings.cs
- Label.cs
- DataGridViewBindingCompleteEventArgs.cs
- KoreanCalendar.cs
- TransformerConfigurationWizardBase.cs
- MouseActionValueSerializer.cs
- XXXOnTypeBuilderInstantiation.cs
- BaseTemplateParser.cs
- ResourceDictionaryCollection.cs
- LineMetrics.cs
- ToolStripItemClickedEventArgs.cs
- VisualProxy.cs
- LineInfo.cs
- ButtonAutomationPeer.cs
- LookupNode.cs
- StringExpressionSet.cs
- XPathNavigator.cs
- TextBoxRenderer.cs
- SeverityFilter.cs
- IPEndPointCollection.cs
- Int16AnimationBase.cs
- ObjectIDGenerator.cs
- XmlHierarchicalEnumerable.cs
- Knowncolors.cs
- BufferModesCollection.cs
- HttpApplication.cs
- XmlHierarchicalDataSourceView.cs
- RuntimeConfigurationRecord.cs
- Stack.cs
- WorkflowTransactionOptions.cs
- CheckedPointers.cs
- HttpCachePolicyBase.cs
- CodeDomConfigurationHandler.cs
- DrawingGroup.cs
- Fonts.cs
- VisualTreeHelper.cs
- QueryCacheEntry.cs
- PropertyCollection.cs
- EventMappingSettings.cs
- IDReferencePropertyAttribute.cs
- DispatcherExceptionEventArgs.cs