Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / TemplateKeyConverter.cs / 1305600 / TemplateKeyConverter.cs
/****************************************************************************\ * * File: TemplateKeyConverter.cs * * Class for converting a given TemplateKey to a string * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.ComponentModel; // for TypeConverter using System.Globalization; // for CultureInfo using System.Reflection; using MS.Utility; using MS.Internal; using System.Windows; using System.ComponentModel.Design.Serialization; using System.Windows.Documents; #pragma warning disable 1634, 1691 // suppressing PreSharp warnings namespace System.Windows.Markup { ////// Class for converting a given TemplateKey to a string /// public sealed class TemplateKeyConverter : TypeConverter { #region Public Methods ////// CanConvertFrom() /// /// ITypeDescriptorContext /// type to convert from ///true if the given type can be converted, flase otherwise public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return false; } ////// TypeConverter method override. /// /// ITypeDescriptorContext /// Type to convert to ///true if conversion is possible public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return false; } ////// ConvertFrom() -TypeConverter method override. using the givein name to return DependencyProperty /// /// ITypeDescriptorContext /// CultureInfo /// Object to convert from ///instance of Command public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object source) { throw GetConvertFromException(source); } ////// ConvertTo() - Serialization purposes, returns the string from Command.Name by adding ownerType.FullName /// /// ITypeDescriptorContext /// CultureInfo /// the object to convert from /// the type to convert to ///string object, if the destination type is string public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { throw GetConvertToException(value, destinationType); } #endregion Public Methods } } // 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
- TcpClientSocketManager.cs
- TypeResolvingOptions.cs
- XPathPatternParser.cs
- FixedTextPointer.cs
- WindowsListViewGroup.cs
- Substitution.cs
- EventItfInfo.cs
- Ref.cs
- ContentPresenter.cs
- OrderedDictionary.cs
- ImageSourceConverter.cs
- mediaeventshelper.cs
- TextTreeObjectNode.cs
- TraceRecord.cs
- NameValueConfigurationElement.cs
- ZoneLinkButton.cs
- FrameworkElement.cs
- EdmToObjectNamespaceMap.cs
- ComponentChangedEvent.cs
- RemotingConfiguration.cs
- TextPointerBase.cs
- HandlerBase.cs
- SecurityTokenException.cs
- EndpointDispatcherTable.cs
- BitConverter.cs
- DbProviderFactories.cs
- Properties.cs
- ListQueryResults.cs
- DllNotFoundException.cs
- RequestBringIntoViewEventArgs.cs
- TextElement.cs
- FirstMatchCodeGroup.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DataStreamFromComStream.cs
- WindowsTab.cs
- EnumType.cs
- PagePropertiesChangingEventArgs.cs
- SerializationObjectManager.cs
- SafeMemoryMappedViewHandle.cs
- VisualStyleElement.cs
- SerializationHelper.cs
- HttpWrapper.cs
- ToolStripDesignerAvailabilityAttribute.cs
- MessageCredentialType.cs
- RsaSecurityKey.cs
- DbException.cs
- AssemblyFilter.cs
- PagesSection.cs
- WhiteSpaceTrimStringConverter.cs
- DBConnectionString.cs
- RectangleConverter.cs
- DocumentsTrace.cs
- SamlSubject.cs
- ProgramNode.cs
- ObjectStateEntry.cs
- FileDialog.cs
- EndpointNameMessageFilter.cs
- System.Data.OracleClient_BID.cs
- PackWebRequest.cs
- IsolationInterop.cs
- ApplyImportsAction.cs
- WinFormsSecurity.cs
- Symbol.cs
- MinimizableAttributeTypeConverter.cs
- ClientRolePrincipal.cs
- QilReplaceVisitor.cs
- ImmutableObjectAttribute.cs
- SmiSettersStream.cs
- RawMouseInputReport.cs
- DependencyPropertyChangedEventArgs.cs
- InvalidOleVariantTypeException.cs
- FloaterBaseParagraph.cs
- ScrollPatternIdentifiers.cs
- ItemCheckEvent.cs
- ProjectionAnalyzer.cs
- ExtractedStateEntry.cs
- BitmapCodecInfo.cs
- SchemaImporterExtensionElement.cs
- XsltConvert.cs
- Viewport3DAutomationPeer.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- MetadataItemSerializer.cs
- RetrieveVirtualItemEventArgs.cs
- DrawingGroup.cs
- SchemaTypeEmitter.cs
- StrongNameIdentityPermission.cs
- BStrWrapper.cs
- Vector3DKeyFrameCollection.cs
- AttachInfo.cs
- isolationinterop.cs
- PrimitiveType.cs
- DirectionalLight.cs
- BindingSource.cs
- COAUTHINFO.cs
- LazyTextWriterCreator.cs
- GridViewDeletedEventArgs.cs
- CodeEventReferenceExpression.cs
- xsdvalidator.cs
- WindowPattern.cs
- HtmlShim.cs