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
- Size.cs
- StandardBindingReliableSessionElement.cs
- EventItfInfo.cs
- BitFlagsGenerator.cs
- StatusBarPanel.cs
- PageCatalogPart.cs
- DiscoveryCallbackBehavior.cs
- AccessDataSourceView.cs
- DataControlPagerLinkButton.cs
- RemoteWebConfigurationHostServer.cs
- PreviousTrackingServiceAttribute.cs
- XsdBuilder.cs
- RefreshEventArgs.cs
- DirectoryObjectSecurity.cs
- DataGridSortCommandEventArgs.cs
- EditorZone.cs
- SecurityTokenReferenceStyle.cs
- XmlUtil.cs
- TransactionFlowOption.cs
- WebPartHelpVerb.cs
- SafeNativeMethodsCLR.cs
- AsyncCodeActivityContext.cs
- MessageDecoder.cs
- DodSequenceMerge.cs
- WebServiceErrorEvent.cs
- InternalConfigEventArgs.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ValueQuery.cs
- Typeface.cs
- TransactionManagerProxy.cs
- SmtpCommands.cs
- CaseStatement.cs
- DataSpaceManager.cs
- SmtpSection.cs
- BridgeDataReader.cs
- VoiceInfo.cs
- FormatterConverter.cs
- LinqToSqlWrapper.cs
- COM2PictureConverter.cs
- ResourcePart.cs
- BlurEffect.cs
- baseaxisquery.cs
- ConfigurationSettings.cs
- TreeNodeClickEventArgs.cs
- _HeaderInfo.cs
- ExcCanonicalXml.cs
- SpellerStatusTable.cs
- BitmapDecoder.cs
- XmlSchemaSequence.cs
- SymbolType.cs
- ReadContentAsBinaryHelper.cs
- ContextDataSourceContextData.cs
- TableProviderWrapper.cs
- _FtpControlStream.cs
- WebReferencesBuildProvider.cs
- XPathItem.cs
- _Connection.cs
- HttpHeaderCollection.cs
- StringValidatorAttribute.cs
- Dump.cs
- UnmanagedBitmapWrapper.cs
- XmlResolver.cs
- AxHost.cs
- ChangeToolStripParentVerb.cs
- BaseParagraph.cs
- UnsafeNativeMethods.cs
- LoadMessageLogger.cs
- ProfileEventArgs.cs
- SortFieldComparer.cs
- _NestedMultipleAsyncResult.cs
- ComponentEditorPage.cs
- XslNumber.cs
- AuthenticationSection.cs
- IdentityHolder.cs
- ExpressionPrefixAttribute.cs
- OpenTypeLayout.cs
- PropertyToken.cs
- ConnectionInterfaceCollection.cs
- ThicknessAnimation.cs
- HostSecurityManager.cs
- WSSecurityPolicy11.cs
- Transform.cs
- BitmapEffectInput.cs
- SelectedGridItemChangedEvent.cs
- DataGridViewHeaderCell.cs
- DetailsViewModeEventArgs.cs
- XmlComplianceUtil.cs
- SystemWebSectionGroup.cs
- FormsAuthentication.cs
- MailHeaderInfo.cs
- WindowsListViewItemStartMenu.cs
- Assert.cs
- ManagementClass.cs
- BindableTemplateBuilder.cs
- CatalogZone.cs
- IsolatedStoragePermission.cs
- UnmanagedMemoryStream.cs
- TabItem.cs
- Visual3DCollection.cs
- DataControlPagerLinkButton.cs