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
- OrCondition.cs
- SqlGatherConsumedAliases.cs
- RTTypeWrapper.cs
- Content.cs
- JsonSerializer.cs
- IndicFontClient.cs
- MembershipValidatePasswordEventArgs.cs
- NestPullup.cs
- AddInDeploymentState.cs
- BaseTemplateBuildProvider.cs
- DropSource.cs
- ImagingCache.cs
- PropertyInformation.cs
- ExitEventArgs.cs
- UndoEngine.cs
- ValidatingCollection.cs
- RequestCachingSection.cs
- SqlComparer.cs
- BamlTreeMap.cs
- ACL.cs
- RadialGradientBrush.cs
- SemanticResolver.cs
- RightsController.cs
- WebPartConnectionsConnectVerb.cs
- ReadOnlyCollectionBase.cs
- RegexReplacement.cs
- HttpClientProtocol.cs
- OdbcEnvironmentHandle.cs
- XPathBinder.cs
- DeobfuscatingStream.cs
- TextRangeEditTables.cs
- Vector.cs
- OpCodes.cs
- ServiceModelExtensionCollectionElement.cs
- ModelService.cs
- XamlDesignerSerializationManager.cs
- XmlSchemaSubstitutionGroup.cs
- NewExpression.cs
- TextEditorDragDrop.cs
- MultipleViewPattern.cs
- OSFeature.cs
- TextOutput.cs
- SpecularMaterial.cs
- ProxyGenerator.cs
- Calendar.cs
- XomlCompilerHelpers.cs
- FtpWebRequest.cs
- CacheManager.cs
- Parser.cs
- LinkedResourceCollection.cs
- StateItem.cs
- VisualStyleTypesAndProperties.cs
- RulePatternOps.cs
- RuleSetDialog.Designer.cs
- base64Transforms.cs
- FieldNameLookup.cs
- MetaForeignKeyColumn.cs
- ScriptHandlerFactory.cs
- EUCJPEncoding.cs
- followingsibling.cs
- DataObjectPastingEventArgs.cs
- AnimationStorage.cs
- XmlValidatingReaderImpl.cs
- formatter.cs
- SoapSchemaExporter.cs
- SessionEndedEventArgs.cs
- MessagePropertyVariants.cs
- Collection.cs
- WebPartConnectionsEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- Menu.cs
- PermissionToken.cs
- _OSSOCK.cs
- IgnoreFileBuildProvider.cs
- EmptyStringExpandableObjectConverter.cs
- DefaultClaimSet.cs
- PartialTrustValidationBehavior.cs
- Quaternion.cs
- WindowsGraphicsWrapper.cs
- ProviderConnectionPointCollection.cs
- XmlSchemaProviderAttribute.cs
- DataBindingCollection.cs
- WeakEventTable.cs
- AdapterUtil.cs
- ControlCachePolicy.cs
- PropertyGridEditorPart.cs
- ButtonColumn.cs
- DialogResultConverter.cs
- DefaultValidator.cs
- LongMinMaxAggregationOperator.cs
- DataBindingValueUIHandler.cs
- SmtpNetworkElement.cs
- SplineKeyFrames.cs
- TemplateBuilder.cs
- MissingFieldException.cs
- EntityClientCacheKey.cs
- GridViewColumnHeader.cs
- SymbolTable.cs
- DocumentViewer.cs
- AssemblyName.cs