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
- EntityDataSourceDesigner.cs
- InkCanvasSelectionAdorner.cs
- ImportOptions.cs
- Util.cs
- Trace.cs
- ThreadStateException.cs
- PrivilegeNotHeldException.cs
- TextRangeSerialization.cs
- EditingScopeUndoUnit.cs
- __ComObject.cs
- SqlProvider.cs
- TriggerBase.cs
- WorkItem.cs
- OleDbConnection.cs
- GenericTypeParameterConverter.cs
- SignedXml.cs
- XmlSchemaSimpleTypeUnion.cs
- TimelineClockCollection.cs
- ResourceDescriptionAttribute.cs
- RulePatternOps.cs
- UnsafeNativeMethods.cs
- GiveFeedbackEventArgs.cs
- ValueTypeFixupInfo.cs
- ToolStripContentPanel.cs
- ProcessStartInfo.cs
- RoleGroupCollection.cs
- ThousandthOfEmRealPoints.cs
- XmlTextReaderImpl.cs
- EdmItemCollection.cs
- Facet.cs
- TraceHandlerErrorFormatter.cs
- KeyEvent.cs
- StatusBar.cs
- ZipFileInfo.cs
- ContentIterators.cs
- WebControlsSection.cs
- PerformanceCounterPermission.cs
- AttachedPropertyBrowsableAttribute.cs
- DataSourceGeneratorException.cs
- CapabilitiesUse.cs
- MetaModel.cs
- ScalarConstant.cs
- ImageConverter.cs
- DataTableMapping.cs
- HttpHostedTransportConfiguration.cs
- DataGridViewCellValidatingEventArgs.cs
- ServiceBehaviorAttribute.cs
- XmlDictionaryReaderQuotas.cs
- ReadOnlyDictionary.cs
- DoubleUtil.cs
- DoubleIndependentAnimationStorage.cs
- AssemblyNameProxy.cs
- ConstNode.cs
- InstanceNotReadyException.cs
- Cloud.cs
- PixelFormatConverter.cs
- CompoundFileStreamReference.cs
- BooleanFunctions.cs
- AstTree.cs
- FileClassifier.cs
- StringAttributeCollection.cs
- RowToFieldTransformer.cs
- DictionaryGlobals.cs
- ImageButton.cs
- ImageDrawing.cs
- GenericTypeParameterBuilder.cs
- DocumentEventArgs.cs
- BackgroundWorker.cs
- BStrWrapper.cs
- FontConverter.cs
- SqlServer2KCompatibilityAnnotation.cs
- CacheDict.cs
- SystemEvents.cs
- _FixedSizeReader.cs
- ManipulationDevice.cs
- VoiceInfo.cs
- PrePrepareMethodAttribute.cs
- KeyValuePairs.cs
- _NegoState.cs
- HttpProfileGroupBase.cs
- DropDownButton.cs
- SchemaInfo.cs
- StringFormat.cs
- DesignerSerializationVisibilityAttribute.cs
- GenericRootAutomationPeer.cs
- TitleStyle.cs
- PasswordRecoveryDesigner.cs
- OdbcEnvironment.cs
- VBCodeProvider.cs
- TdsParser.cs
- SrgsDocument.cs
- MetadataAssemblyHelper.cs
- DataTemplate.cs
- ToolBarButtonClickEvent.cs
- GradientBrush.cs
- FormatConvertedBitmap.cs
- MatrixConverter.cs
- DataGridViewCellStyleConverter.cs
- ObjectAnimationUsingKeyFrames.cs
- DetailsViewCommandEventArgs.cs