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
- EndPoint.cs
- ClickablePoint.cs
- Panel.cs
- TableItemPattern.cs
- BulletedList.cs
- SecurityElement.cs
- _ListenerResponseStream.cs
- Options.cs
- TokenBasedSetEnumerator.cs
- HyperlinkAutomationPeer.cs
- RotateTransform.cs
- UntrustedRecipientException.cs
- DataFormats.cs
- UrlUtility.cs
- PropertyGridCommands.cs
- FlowchartDesigner.xaml.cs
- SqlBinder.cs
- DecoderFallbackWithFailureFlag.cs
- srgsitem.cs
- WebServiceTypeData.cs
- PkcsUtils.cs
- ConnectionString.cs
- CodeAssignStatement.cs
- XmlNode.cs
- UnsafeNativeMethods.cs
- EndOfStreamException.cs
- ButtonChrome.cs
- MatchAllMessageFilter.cs
- SqlErrorCollection.cs
- LinqDataSourceEditData.cs
- AvTraceDetails.cs
- TextPointerBase.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- OleDbWrapper.cs
- PagerSettings.cs
- ZoneLinkButton.cs
- OleDbMetaDataFactory.cs
- WebPartManager.cs
- WinInet.cs
- HtmlInputCheckBox.cs
- TypeConverterAttribute.cs
- AutomationIdentifier.cs
- MobileUITypeEditor.cs
- IOException.cs
- StandardCommandToolStripMenuItem.cs
- SymbolEqualComparer.cs
- ObjectItemCollection.cs
- ProfileSettings.cs
- InternalConfigEventArgs.cs
- BitSet.cs
- NamespaceList.cs
- WmiInstallComponent.cs
- ZoneLinkButton.cs
- ItemType.cs
- PlainXmlWriter.cs
- Line.cs
- KeyFrames.cs
- AssemblyInfo.cs
- DesignerAttribute.cs
- DataGridViewHeaderCell.cs
- BulletedList.cs
- URLIdentityPermission.cs
- DbConnectionPool.cs
- StubHelpers.cs
- SerialErrors.cs
- PathSegmentCollection.cs
- ListItemsCollectionEditor.cs
- OperationGenerator.cs
- DictionaryEditChange.cs
- ExceptionHelpers.cs
- CodeStatementCollection.cs
- Matrix3DStack.cs
- SqlTypeSystemProvider.cs
- WorkflowDebuggerSteppingAttribute.cs
- CipherData.cs
- WindowsSlider.cs
- DataGridViewAccessibleObject.cs
- Panel.cs
- CrossSiteScriptingValidation.cs
- XmlDocumentViewSchema.cs
- XmlSchemaGroup.cs
- DataServiceQuery.cs
- BuildProviderCollection.cs
- DrawingContextDrawingContextWalker.cs
- DataDocumentXPathNavigator.cs
- MasterPageBuildProvider.cs
- TcpProcessProtocolHandler.cs
- Range.cs
- HtmlObjectListAdapter.cs
- AssemblyInfo.cs
- LogicalExpr.cs
- COM2PictureConverter.cs
- Grid.cs
- ElementMarkupObject.cs
- HostingEnvironment.cs
- XmlSchemaSimpleTypeUnion.cs
- DataListAutoFormat.cs
- XmlBaseReader.cs
- COM2ExtendedUITypeEditor.cs
- SerializationStore.cs