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
- UIElementCollection.cs
- TableParagraph.cs
- CopyAction.cs
- embossbitmapeffect.cs
- ModuleBuilderData.cs
- JapaneseCalendar.cs
- OletxVolatileEnlistment.cs
- _SslSessionsCache.cs
- InheritanceService.cs
- XPathNodePointer.cs
- FreeFormDragDropManager.cs
- AsyncResult.cs
- RawUIStateInputReport.cs
- Focus.cs
- ArrangedElementCollection.cs
- SQLInt32Storage.cs
- ServiceConfigurationTraceRecord.cs
- ItemList.cs
- LinearGradientBrush.cs
- HttpBindingExtension.cs
- ControlFilterExpression.cs
- KeyedQueue.cs
- ApplicationHost.cs
- ThicknessConverter.cs
- AccessViolationException.cs
- _SslSessionsCache.cs
- HttpRuntime.cs
- Utils.cs
- RenderDataDrawingContext.cs
- EditBehavior.cs
- RMPublishingDialog.cs
- GreenMethods.cs
- SmiEventSink.cs
- SharedPerformanceCounter.cs
- ItemCollection.cs
- ArrayExtension.cs
- DataSetUtil.cs
- AnimationException.cs
- GridViewColumnCollection.cs
- InvalidProgramException.cs
- ConstantSlot.cs
- HasCopySemanticsAttribute.cs
- CustomAttributeFormatException.cs
- CachedFontFace.cs
- SqlSelectStatement.cs
- HtmlInputHidden.cs
- Exception.cs
- FieldMetadata.cs
- SchemaMapping.cs
- ProgressBarHighlightConverter.cs
- ContainerAction.cs
- Avt.cs
- DataGridViewEditingControlShowingEventArgs.cs
- AnnotationHelper.cs
- FormViewRow.cs
- InputLanguageManager.cs
- Schema.cs
- SourceItem.cs
- EntityCommandDefinition.cs
- _DomainName.cs
- TokenBasedSetEnumerator.cs
- EditorPartCollection.cs
- SoapAttributeOverrides.cs
- DotAtomReader.cs
- SQLInt16.cs
- SimpleType.cs
- DictionaryEntry.cs
- EditorPartChrome.cs
- ADMembershipProvider.cs
- AliasExpr.cs
- UnauthorizedWebPart.cs
- TextSpanModifier.cs
- SecurityPolicySection.cs
- ObjectHandle.cs
- HttpResponse.cs
- EmptyReadOnlyDictionaryInternal.cs
- DataBoundControlParameterTarget.cs
- CaseExpr.cs
- XsdDataContractExporter.cs
- PrincipalPermission.cs
- ListView.cs
- RecordConverter.cs
- WinInetCache.cs
- XmlSchemaAnyAttribute.cs
- AnimationClockResource.cs
- StringValueSerializer.cs
- IgnoreFileBuildProvider.cs
- SafeRightsManagementPubHandle.cs
- MissingMemberException.cs
- PageParser.cs
- ProfileParameter.cs
- InitializationEventAttribute.cs
- PipeSecurity.cs
- SmiXetterAccessMap.cs
- ModuleConfigurationInfo.cs
- MetadataException.cs
- DataGridViewMethods.cs
- NotifyCollectionChangedEventArgs.cs
- EnterpriseServicesHelper.cs
- AppDomainManager.cs