Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StorageMappingFragment.cs
- IndexedString.cs
- RuntimeConfigurationRecord.cs
- ArrayExtension.cs
- Command.cs
- XmlDigitalSignatureProcessor.cs
- RSAOAEPKeyExchangeFormatter.cs
- ActivityBindForm.Designer.cs
- WebPartsPersonalization.cs
- XmlDesignerDataSourceView.cs
- CodeAttributeArgument.cs
- XPathNavigator.cs
- InfocardInteractiveChannelInitializer.cs
- SqlConnectionStringBuilder.cs
- HtmlForm.cs
- ExtendedPropertyDescriptor.cs
- TypeNameConverter.cs
- ExpressionEvaluator.cs
- FtpWebRequest.cs
- IDataContractSurrogate.cs
- StringAttributeCollection.cs
- WindowsFormsSynchronizationContext.cs
- _FixedSizeReader.cs
- CustomLineCap.cs
- PaginationProgressEventArgs.cs
- TableCell.cs
- _HTTPDateParse.cs
- EditBehavior.cs
- CharAnimationBase.cs
- DomainUpDown.cs
- input.cs
- PropertyBuilder.cs
- TraceSource.cs
- RenderData.cs
- XmlSchemaInfo.cs
- PageEventArgs.cs
- BuildProviderUtils.cs
- ResetableIterator.cs
- DataException.cs
- NavigationWindow.cs
- XLinq.cs
- StylusPoint.cs
- MetaForeignKeyColumn.cs
- DataBindingValueUIHandler.cs
- PointHitTestResult.cs
- BlobPersonalizationState.cs
- WCFServiceClientProxyGenerator.cs
- XPathAxisIterator.cs
- DisplayNameAttribute.cs
- GridLength.cs
- Typography.cs
- OutKeywords.cs
- _ProxyRegBlob.cs
- ChangeDirector.cs
- PluralizationServiceUtil.cs
- MimeParameterWriter.cs
- ServiceDesigner.cs
- SchemaInfo.cs
- MostlySingletonList.cs
- SystemBrushes.cs
- HyperlinkAutomationPeer.cs
- TdsParserSessionPool.cs
- CodeTypeMemberCollection.cs
- OperationPickerDialog.cs
- SqlEnums.cs
- IndexOutOfRangeException.cs
- FixedTextPointer.cs
- SectionVisual.cs
- XmlQualifiedName.cs
- DocumentApplication.cs
- ChunkedMemoryStream.cs
- SecureUICommand.cs
- DockAndAnchorLayout.cs
- GridViewDeleteEventArgs.cs
- DataBoundControlHelper.cs
- CmsInterop.cs
- FormViewPageEventArgs.cs
- ImageMetadata.cs
- GenericTypeParameterConverter.cs
- SystemColors.cs
- Walker.cs
- TiffBitmapDecoder.cs
- AnnouncementClient.cs
- DependentList.cs
- ModuleConfigurationInfo.cs
- MetadataArtifactLoaderCompositeFile.cs
- Menu.cs
- WebBrowserSiteBase.cs
- PackagingUtilities.cs
- CapabilitiesAssignment.cs
- EntityWrapper.cs
- Set.cs
- ProxyElement.cs
- ReadWriteSpinLock.cs
- HostedHttpContext.cs
- connectionpool.cs
- TrimSurroundingWhitespaceAttribute.cs
- KoreanLunisolarCalendar.cs
- HttpModuleAction.cs
- MultiByteCodec.cs