Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SqlDataSourceSummaryPanel.cs
- Util.cs
- TextRunCacheImp.cs
- BaseParser.cs
- FontSizeConverter.cs
- ScopedKnownTypes.cs
- SqlBulkCopyColumnMapping.cs
- EdmMember.cs
- WindowsScrollBar.cs
- _ScatterGatherBuffers.cs
- FlowDocumentScrollViewer.cs
- Int32AnimationBase.cs
- CellParaClient.cs
- JobDuplex.cs
- WrappedIUnknown.cs
- AppLevelCompilationSectionCache.cs
- RouteItem.cs
- SerializationFieldInfo.cs
- TransformerTypeCollection.cs
- VersionedStreamOwner.cs
- QilLiteral.cs
- PropertyMapper.cs
- HtmlContainerControl.cs
- ClientTargetCollection.cs
- HttpModuleCollection.cs
- hebrewshape.cs
- WorkflowMarkupSerializationException.cs
- WmlPanelAdapter.cs
- SessionStateSection.cs
- SerialErrors.cs
- InternalMappingException.cs
- VariableExpressionConverter.cs
- MulticastOption.cs
- XmlSchemaObjectCollection.cs
- TemplateXamlParser.cs
- WorkflowDesignerColors.cs
- GuidTagList.cs
- UpDownEvent.cs
- ParameterCollection.cs
- AssemblyName.cs
- InvalidDataException.cs
- SslStream.cs
- DesignerSerializationVisibilityAttribute.cs
- ProfileSettingsCollection.cs
- EventMap.cs
- CachedBitmap.cs
- AnnotationStore.cs
- TableAdapterManagerNameHandler.cs
- DesignTimeParseData.cs
- DataServiceException.cs
- RadioButtonFlatAdapter.cs
- IndexedSelectQueryOperator.cs
- FacetChecker.cs
- CheckBoxBaseAdapter.cs
- Application.cs
- Debug.cs
- Int32Collection.cs
- ExceptionHelpers.cs
- ComponentGlyph.cs
- InputLangChangeRequestEvent.cs
- ParseChildrenAsPropertiesAttribute.cs
- Application.cs
- PartManifestEntry.cs
- TraceSection.cs
- XmlSerializerOperationBehavior.cs
- Table.cs
- LocationEnvironment.cs
- WmpBitmapDecoder.cs
- SettingsAttributeDictionary.cs
- PageBreakRecord.cs
- NamespaceTable.cs
- PageContent.cs
- Set.cs
- Pair.cs
- BufferModesCollection.cs
- TableTextElementCollectionInternal.cs
- DataGridViewSelectedRowCollection.cs
- Application.cs
- listitem.cs
- SqlDataSourceSummaryPanel.cs
- WhitespaceRule.cs
- WebControlAdapter.cs
- Unit.cs
- RequestQueryParser.cs
- ListControlConvertEventArgs.cs
- SecurityPolicySection.cs
- DateTimeEditor.cs
- ContentPresenter.cs
- EmptyStringExpandableObjectConverter.cs
- SecurityElement.cs
- WindowsComboBox.cs
- Effect.cs
- OrderedDictionary.cs
- ManualResetEvent.cs
- BinHexEncoder.cs
- NavigationProperty.cs
- Rotation3DAnimationBase.cs
- TextFormatter.cs
- WindowsGraphicsWrapper.cs
- SystemIcons.cs