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
- Stack.cs
- ExceptionUtility.cs
- ObjectTypeMapping.cs
- ThreadSafeMessageFilterTable.cs
- ComNativeDescriptor.cs
- cryptoapiTransform.cs
- IisTraceWebEventProvider.cs
- SqlWorkflowPersistenceService.cs
- SqlTypeSystemProvider.cs
- Converter.cs
- BaseComponentEditor.cs
- RoleManagerModule.cs
- WindowsStatic.cs
- CellLabel.cs
- Resources.Designer.cs
- PrimitiveSchema.cs
- LogArchiveSnapshot.cs
- InsufficientMemoryException.cs
- HostingEnvironmentSection.cs
- HistoryEventArgs.cs
- XPathNavigatorKeyComparer.cs
- DateTimeOffset.cs
- UrlAuthFailedErrorFormatter.cs
- ViewKeyConstraint.cs
- XmlSignatureManifest.cs
- XmlDataLoader.cs
- OdbcConnectionPoolProviderInfo.cs
- PrivilegedConfigurationManager.cs
- RelationshipConverter.cs
- ContentPathSegment.cs
- ToolboxCategory.cs
- IsolatedStoragePermission.cs
- BinaryFormatter.cs
- DataGridAutoFormatDialog.cs
- XamlPointCollectionSerializer.cs
- OneOf.cs
- StandardCommands.cs
- TextBoxAutoCompleteSourceConverter.cs
- DragSelectionMessageFilter.cs
- ListView.cs
- ExpressionEditorAttribute.cs
- FontStyle.cs
- PerformanceCounterPermissionEntry.cs
- WizardForm.cs
- ButtonAutomationPeer.cs
- DataSvcMapFileSerializer.cs
- CfgParser.cs
- BinaryEditor.cs
- XmlAnyElementAttributes.cs
- ClientTargetCollection.cs
- BrushValueSerializer.cs
- Margins.cs
- JsonSerializer.cs
- TextEffect.cs
- DataGridBoolColumn.cs
- DocumentScope.cs
- ToggleProviderWrapper.cs
- JsonReaderWriterFactory.cs
- HashHelper.cs
- PeerTransportSecurityElement.cs
- SystemColors.cs
- OutputScopeManager.cs
- WebPartCatalogCloseVerb.cs
- TextParaClient.cs
- SoapServerProtocol.cs
- StoreConnection.cs
- HitTestWithPointDrawingContextWalker.cs
- DragCompletedEventArgs.cs
- WaveHeader.cs
- Brush.cs
- GeometryCombineModeValidation.cs
- GlobalItem.cs
- arabicshape.cs
- FixedFlowMap.cs
- Highlights.cs
- ToolStripDropDownDesigner.cs
- IfAction.cs
- StickyNoteContentControl.cs
- DefaultConfirmation.cs
- CodeArrayIndexerExpression.cs
- XamlNamespaceHelper.cs
- XmlValueConverter.cs
- QilFactory.cs
- MasterPageParser.cs
- Bits.cs
- PageParser.cs
- TextDecorationUnitValidation.cs
- log.cs
- PageHandlerFactory.cs
- TargetException.cs
- basevalidator.cs
- DesigntimeLicenseContextSerializer.cs
- HTTPNotFoundHandler.cs
- XmlBufferedByteStreamReader.cs
- XmlDocumentSurrogate.cs
- WebPartHelpVerb.cs
- CompilerInfo.cs
- SqlCacheDependency.cs
- typedescriptorpermissionattribute.cs
- TextFormatter.cs