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
- TdsParserStaticMethods.cs
- CodeAccessSecurityEngine.cs
- SqlProfileProvider.cs
- AttributeAction.cs
- CardSpacePolicyElement.cs
- AssemblyBuilder.cs
- TransformerConfigurationWizardBase.cs
- RoutedPropertyChangedEventArgs.cs
- ConnectionsZone.cs
- coordinatorfactory.cs
- ContentPlaceHolder.cs
- RestHandlerFactory.cs
- StringSorter.cs
- IApplicationTrustManager.cs
- UnsafeNativeMethods.cs
- BamlTreeNode.cs
- TableSectionStyle.cs
- XmlWriterTraceListener.cs
- Animatable.cs
- SpellerHighlightLayer.cs
- LogicalExpr.cs
- Qualifier.cs
- PageContent.cs
- SystemIcons.cs
- PolyBezierSegment.cs
- DependencyPropertyChangedEventArgs.cs
- PropertyManager.cs
- HtmlHead.cs
- Column.cs
- SqlDataSourceConfigureFilterForm.cs
- ExpressionBuilder.cs
- Help.cs
- TreeNodeStyleCollection.cs
- Calendar.cs
- PageCodeDomTreeGenerator.cs
- SaveFileDialog.cs
- XPathSelfQuery.cs
- ProviderSettings.cs
- XsltLibrary.cs
- TraceListener.cs
- RegexReplacement.cs
- XmlSchemaExternal.cs
- QueryConverter.cs
- SystemIPInterfaceStatistics.cs
- EdmToObjectNamespaceMap.cs
- TransformPatternIdentifiers.cs
- Line.cs
- XD.cs
- PropertyTabChangedEvent.cs
- GridViewDeletedEventArgs.cs
- SqlLiftIndependentRowExpressions.cs
- ShaderEffect.cs
- WindowsAltTab.cs
- PreviewPageInfo.cs
- XmlSchemaSet.cs
- CodeDelegateCreateExpression.cs
- ThrowHelper.cs
- SerializationInfo.cs
- CfgParser.cs
- ArcSegment.cs
- JsonWriterDelegator.cs
- NotFiniteNumberException.cs
- SchemaConstraints.cs
- DataRelationCollection.cs
- DataPagerFieldCollection.cs
- DataGridViewAccessibleObject.cs
- LinqTreeNodeEvaluator.cs
- _FtpDataStream.cs
- FlowPosition.cs
- Container.cs
- WebPartMovingEventArgs.cs
- ItemAutomationPeer.cs
- DictionaryTraceRecord.cs
- EdmComplexTypeAttribute.cs
- SmiEventSink.cs
- invalidudtexception.cs
- ConfigurationManagerHelper.cs
- TypeResolver.cs
- input.cs
- NegotiateStream.cs
- SQLBinary.cs
- NestedContainer.cs
- DrawListViewColumnHeaderEventArgs.cs
- Pen.cs
- AggregateNode.cs
- LambdaCompiler.Unary.cs
- DefaultEvaluationContext.cs
- BitStream.cs
- TypeToken.cs
- MinimizableAttributeTypeConverter.cs
- HitTestParameters3D.cs
- ObjectSpanRewriter.cs
- BinaryObjectInfo.cs
- SystemParameters.cs
- DiscoveryDefaults.cs
- OracleCommandSet.cs
- Predicate.cs
- DesignerDeviceConfig.cs
- SQLSingleStorage.cs
- TaskExtensions.cs