Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / ComponentResourceKeyConverter.cs / 1305600 / 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
- FloatUtil.cs
- InstanceDataCollection.cs
- EllipticalNodeOperations.cs
- DateTimeFormat.cs
- DataObjectEventArgs.cs
- LambdaExpression.cs
- EditorPartCollection.cs
- DirectionalLight.cs
- CultureMapper.cs
- oledbmetadatacollectionnames.cs
- PeerHelpers.cs
- ConfigurationManagerHelperFactory.cs
- DbConnectionPoolIdentity.cs
- OleCmdHelper.cs
- StateRuntime.cs
- HttpCachePolicyBase.cs
- TextServicesCompartmentContext.cs
- XmlSchemaFacet.cs
- WmiEventSink.cs
- ServiceBuildProvider.cs
- WebPartVerbCollection.cs
- HierarchicalDataSourceControl.cs
- ComponentEvent.cs
- EventItfInfo.cs
- ApplicationDirectory.cs
- SapiRecoInterop.cs
- DrawingCollection.cs
- QueryPageSettingsEventArgs.cs
- ApplicationActivator.cs
- CompiledXpathExpr.cs
- DocumentOutline.cs
- OleDbParameter.cs
- CSharpCodeProvider.cs
- ApplicationServiceHelper.cs
- HighlightComponent.cs
- DateTimeOffsetAdapter.cs
- MapPathBasedVirtualPathProvider.cs
- HttpBrowserCapabilitiesWrapper.cs
- MailMessageEventArgs.cs
- GenericEnumConverter.cs
- WorkflowOwnerAsyncResult.cs
- SerializationInfo.cs
- IisTraceListener.cs
- DbProviderFactory.cs
- EventDescriptor.cs
- WebPartConnectionCollection.cs
- LeafCellTreeNode.cs
- TransactionTraceIdentifier.cs
- _CacheStreams.cs
- SignatureHelper.cs
- DataControlPagerLinkButton.cs
- LinqDataView.cs
- HttpClientCertificate.cs
- SafeEventLogWriteHandle.cs
- WebPartConnectionsCloseVerb.cs
- HMACSHA256.cs
- TypeBuilderInstantiation.cs
- XmlSchemaObjectTable.cs
- AssemblyAttributesGoHere.cs
- SurrogateSelector.cs
- TimelineGroup.cs
- TokenizerHelper.cs
- UpdateException.cs
- TcpProcessProtocolHandler.cs
- DoubleKeyFrameCollection.cs
- XmlCharType.cs
- OneOfTypeConst.cs
- XmlEnumAttribute.cs
- MarkedHighlightComponent.cs
- XmlSchemaObjectCollection.cs
- FormViewPageEventArgs.cs
- PatternMatchRules.cs
- CacheSection.cs
- PixelFormatConverter.cs
- SimpleHandlerFactory.cs
- HttpException.cs
- StylusSystemGestureEventArgs.cs
- DataSourceHelper.cs
- ObjectDataSourceEventArgs.cs
- UTF32Encoding.cs
- BulletedList.cs
- TrackingRecord.cs
- ObjectConverter.cs
- ValueUtilsSmi.cs
- BrowserTree.cs
- LocalFileSettingsProvider.cs
- ListBoxAutomationPeer.cs
- BindingContext.cs
- ExtenderControl.cs
- DataGridViewCellStyleBuilderDialog.cs
- ZipPackage.cs
- XmlSchemaComplexContentRestriction.cs
- URL.cs
- NullRuntimeConfig.cs
- ActivityInterfaces.cs
- SqlStream.cs
- FlatButtonAppearance.cs
- CodeTypeConstructor.cs
- XmlSchemaObjectTable.cs
- EntityDataReader.cs