Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- ColumnHeader.cs
- CachedTypeface.cs
- MasterPageParser.cs
- SamlConstants.cs
- AdPostCacheSubstitution.cs
- SystemNetworkInterface.cs
- EventLogInformation.cs
- ObjectDataSourceEventArgs.cs
- DataObjectFieldAttribute.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- externdll.cs
- User.cs
- XmlSchemaComplexContentExtension.cs
- WebInvokeAttribute.cs
- BigInt.cs
- EntityProviderFactory.cs
- Condition.cs
- ShutDownListener.cs
- TreeBuilder.cs
- mactripleDES.cs
- HttpModulesSection.cs
- InputManager.cs
- MailDefinitionBodyFileNameEditor.cs
- Query.cs
- SingleSelectRootGridEntry.cs
- DSACryptoServiceProvider.cs
- Speller.cs
- EntityDataSourceMemberPath.cs
- TextElementCollectionHelper.cs
- StylusPlugInCollection.cs
- ImageField.cs
- TextTreeObjectNode.cs
- LabelLiteral.cs
- XD.cs
- Int64KeyFrameCollection.cs
- WindowsFormsHelpers.cs
- StructuralCache.cs
- Exceptions.cs
- StagingAreaInputItem.cs
- NameTable.cs
- IisTraceWebEventProvider.cs
- CLSCompliantAttribute.cs
- SQLByteStorage.cs
- ParagraphResult.cs
- SystemIPInterfaceStatistics.cs
- ToolStripPanelRenderEventArgs.cs
- StrokeRenderer.cs
- XamlClipboardData.cs
- XmlAttributeCache.cs
- CodeTypeMember.cs
- RequestCacheManager.cs
- ResourcesChangeInfo.cs
- PlaceHolder.cs
- AttributedMetaModel.cs
- EntityDataSourceWrapperCollection.cs
- InvalidAsynchronousStateException.cs
- TraceProvider.cs
- DataTableTypeConverter.cs
- ChildChangedEventArgs.cs
- DispatcherHooks.cs
- GridToolTip.cs
- XmlCharCheckingWriter.cs
- SettingsAttributes.cs
- DesignBindingPropertyDescriptor.cs
- ScrollChrome.cs
- SoapAttributes.cs
- CacheDependency.cs
- Token.cs
- SoapUnknownHeader.cs
- DataGridViewCellParsingEventArgs.cs
- ImageListUtils.cs
- MenuItemStyle.cs
- DataGridItem.cs
- Debugger.cs
- ObjectListFieldCollection.cs
- PageSetupDialog.cs
- DataRowView.cs
- TreeViewCancelEvent.cs
- SplitterCancelEvent.cs
- CaretElement.cs
- WindowsRichEdit.cs
- EntityEntry.cs
- CoTaskMemHandle.cs
- NegotiateStream.cs
- CodeGroup.cs
- SqlBulkCopy.cs
- XmlDocumentFragment.cs
- BasePropertyDescriptor.cs
- SqlCacheDependency.cs
- XmlProcessingInstruction.cs
- COM2PropertyBuilderUITypeEditor.cs
- FileAuthorizationModule.cs
- SettingsPropertyCollection.cs
- GetFileNameResult.cs
- MethodResolver.cs
- XmlUnspecifiedAttribute.cs
- ProviderSettings.cs
- Matrix3D.cs
- CustomGrammar.cs
- ObjectListField.cs