Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- EffectiveValueEntry.cs
- CellTreeSimplifier.cs
- RepeaterDataBoundAdapter.cs
- WebAdminConfigurationHelper.cs
- SerialPinChanges.cs
- DynamicAttribute.cs
- InstanceOwnerException.cs
- EditingCoordinator.cs
- OledbConnectionStringbuilder.cs
- TextReader.cs
- ClaimTypes.cs
- ScriptReference.cs
- Vector3DKeyFrameCollection.cs
- CqlWriter.cs
- SqlPersonalizationProvider.cs
- JumpList.cs
- FixedHyperLink.cs
- List.cs
- GeometryHitTestResult.cs
- ReferenceConverter.cs
- TextWriter.cs
- LocalValueEnumerator.cs
- FileRecordSequence.cs
- NavigationHelper.cs
- CodeEntryPointMethod.cs
- ResourceDictionaryCollection.cs
- DeleteHelper.cs
- DataGridViewImageCell.cs
- Util.cs
- SingleAnimation.cs
- DataGridViewTextBoxCell.cs
- DrawingGroup.cs
- DataGridParentRows.cs
- DesignerWithHeader.cs
- UIElementParagraph.cs
- Misc.cs
- EditorAttribute.cs
- ECDiffieHellman.cs
- StorageEntityContainerMapping.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- SqlFactory.cs
- DataRecordInfo.cs
- Model3D.cs
- BypassElementCollection.cs
- ProfileManager.cs
- ServerValidateEventArgs.cs
- MeshGeometry3D.cs
- MenuBase.cs
- UnknownBitmapEncoder.cs
- AsnEncodedData.cs
- _LocalDataStore.cs
- SqlDataSourceCommandEventArgs.cs
- MexHttpsBindingCollectionElement.cs
- XmlMtomReader.cs
- StructuredProperty.cs
- PageParserFilter.cs
- ActivitySurrogate.cs
- OdbcConnectionOpen.cs
- Separator.cs
- Paragraph.cs
- MessageQueueKey.cs
- XmlIlVisitor.cs
- DataControlFieldHeaderCell.cs
- XmlTypeMapping.cs
- NegationPusher.cs
- Decimal.cs
- EndpointNameMessageFilter.cs
- CodeIdentifier.cs
- PartialCachingControl.cs
- OuterGlowBitmapEffect.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- Style.cs
- Brush.cs
- DataObjectCopyingEventArgs.cs
- PeerEndPoint.cs
- XmlILIndex.cs
- CompositeFontParser.cs
- ObjectDataSourceStatusEventArgs.cs
- PLINQETWProvider.cs
- BoolExpr.cs
- SslStreamSecurityBindingElement.cs
- ObsoleteAttribute.cs
- ComponentConverter.cs
- EnumCodeDomSerializer.cs
- DataView.cs
- LeafCellTreeNode.cs
- SqlCaseSimplifier.cs
- ImageCollectionCodeDomSerializer.cs
- ListBindingConverter.cs
- MultiSelectRootGridEntry.cs
- DataListItemEventArgs.cs
- FixedPageProcessor.cs
- EventHandlerList.cs
- Stack.cs
- DynamicHyperLink.cs
- OneToOneMappingSerializer.cs
- AttributeEmitter.cs
- MultipartContentParser.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DataRecord.cs