Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / TemplateBindingExpressionConverter.cs / 1 / TemplateBindingExpressionConverter.cs
/****************************************************************************\ * * File: TemplateBindingExpressionConverter.cs * * Class for serializing a TemplateBindingExpression. * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.ComponentModel; using System.Windows; using System.Windows.Data; using System.Windows.Markup; namespace System.Windows { ////// Converts a template binding expression into a MarkupExtension. This is used /// during serialization (the serializer native knows how to serialize an ME). /// public class TemplateBindingExpressionConverter: TypeConverter { ////// Returns true for MarkupExtension /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { return true; } return base.CanConvertTo(context, destinationType); } ////// Converts to a MarkupExtension /// public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { TemplateBindingExpression templateBindingExpression = value as TemplateBindingExpression; if (templateBindingExpression == null) throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "TemplateBindingExpression")); return templateBindingExpression.TemplateBindingExtension; } return base.ConvertTo(context, culture, value, destinationType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: TemplateBindingExpressionConverter.cs * * Class for serializing a TemplateBindingExpression. * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.ComponentModel; using System.Windows; using System.Windows.Data; using System.Windows.Markup; namespace System.Windows { ////// Converts a template binding expression into a MarkupExtension. This is used /// during serialization (the serializer native knows how to serialize an ME). /// public class TemplateBindingExpressionConverter: TypeConverter { ////// Returns true for MarkupExtension /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { return true; } return base.CanConvertTo(context, destinationType); } ////// Converts to a MarkupExtension /// public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { TemplateBindingExpression templateBindingExpression = value as TemplateBindingExpression; if (templateBindingExpression == null) throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "TemplateBindingExpression")); return templateBindingExpression.TemplateBindingExtension; } return base.ConvertTo(context, culture, value, 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
- DataMisalignedException.cs
- IntSecurity.cs
- JournalEntryListConverter.cs
- ResourceExpressionBuilder.cs
- InputMethodStateChangeEventArgs.cs
- XPathNodeList.cs
- ComplexTypeEmitter.cs
- LayoutTableCell.cs
- ExpressionQuoter.cs
- TransformerConfigurationWizardBase.cs
- TextTrailingCharacterEllipsis.cs
- MailDefinition.cs
- CanonicalizationDriver.cs
- IriParsingElement.cs
- TableLayoutCellPaintEventArgs.cs
- XmlnsCompatibleWithAttribute.cs
- AssemblyFilter.cs
- Literal.cs
- RSAPKCS1SignatureDeformatter.cs
- GenericNameHandler.cs
- unitconverter.cs
- X509SubjectKeyIdentifierClause.cs
- QueryStringHandler.cs
- FunctionDetailsReader.cs
- XmlDocumentFragment.cs
- ProfilePropertySettings.cs
- ScrollBarRenderer.cs
- IgnoreFileBuildProvider.cs
- ZipPackage.cs
- TableDetailsCollection.cs
- XmlDocumentSerializer.cs
- ColorMatrix.cs
- OleAutBinder.cs
- ObjectCloneHelper.cs
- InlineCollection.cs
- SplitterEvent.cs
- EntitySqlQueryState.cs
- DataGridViewSelectedRowCollection.cs
- SqlDataRecord.cs
- SHA256Managed.cs
- PeerContact.cs
- ResourceExpressionBuilder.cs
- DataControlReferenceCollection.cs
- SqlConnectionStringBuilder.cs
- ProvidersHelper.cs
- Trigger.cs
- FilterableAttribute.cs
- ConnectionPointCookie.cs
- IdentityReference.cs
- DataConnectionHelper.cs
- _SpnDictionary.cs
- EntitySqlQueryBuilder.cs
- MulticastOption.cs
- ExpressionWriter.cs
- FileDialog_Vista.cs
- TypefaceCollection.cs
- ListViewGroupConverter.cs
- PrimitiveDataContract.cs
- WebBrowserNavigatingEventHandler.cs
- MasterPageBuildProvider.cs
- PersonalizableAttribute.cs
- ToolStripCollectionEditor.cs
- BitmapEffectDrawing.cs
- DSACryptoServiceProvider.cs
- XsdBuildProvider.cs
- connectionpool.cs
- TypeInitializationException.cs
- BindingNavigator.cs
- Column.cs
- Module.cs
- MetaModel.cs
- DmlSqlGenerator.cs
- PersonalizableTypeEntry.cs
- ReadOnlyDataSource.cs
- ScrollItemProviderWrapper.cs
- TextHidden.cs
- StylusPointPropertyId.cs
- XsltLoader.cs
- ChameleonKey.cs
- versioninfo.cs
- ServiceProviders.cs
- PropertyNames.cs
- HttpCacheVaryByContentEncodings.cs
- RequestCachingSection.cs
- newitemfactory.cs
- DeferredBinaryDeserializerExtension.cs
- DBDataPermission.cs
- WebSysDescriptionAttribute.cs
- LinqDataSourceStatusEventArgs.cs
- SRef.cs
- Fx.cs
- StrokeNodeOperations.cs
- TargetFrameworkAttribute.cs
- ToolboxItemImageConverter.cs
- HierarchicalDataSourceConverter.cs
- WpfWebRequestHelper.cs
- MediaElementAutomationPeer.cs
- arclist.cs
- EventSinkHelperWriter.cs
- AccessDataSource.cs