Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Command / MouseActionValueSerializer.cs / 1305600 / MouseActionValueSerializer.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: MouseActionConverter - Serializes a MouseAction // // History: // 08/04/2005 : Chuck Jazdzewski - Created // //--------------------------------------------------------------------------- using System; using System.ComponentModel; // for TypeConverter using System.Globalization; // for CultureInfo using System.Reflection; using System.Windows; using System.Windows.Markup; using System.Windows.Input; namespace System.Windows.Input { ////// MouseActionValueSerializer - Serializes a MouseAction /// public class MouseActionValueSerializer : ValueSerializer { ////// CanConvertFromString() /// /// /// ////// public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } /// /// CanConvertToString() /// /// /// ////// public override bool CanConvertToString(object value, IValueSerializerContext context) { return value is MouseAction && MouseActionConverter.IsDefinedMouseAction((MouseAction)value); } /// /// ConvertFromString() /// /// /// ///public override object ConvertFromString(string value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertFromString(value); else return base.ConvertFromString(value, context); } /// /// ConvertToString() /// /// /// ///public override string ConvertToString(object value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertToInvariantString(value); else return base.ConvertToString(value, context); } } } // 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
- ConnectionPoint.cs
- XmlSchemaAny.cs
- ScrollChrome.cs
- ScriptHandlerFactory.cs
- ClipboardProcessor.cs
- RootAction.cs
- ImageField.cs
- NegationPusher.cs
- Drawing.cs
- DataGridViewBindingCompleteEventArgs.cs
- StaticExtensionConverter.cs
- ExecutionEngineException.cs
- ProvidersHelper.cs
- AssemblyInfo.cs
- TrustLevelCollection.cs
- AttachedPropertyBrowsableAttribute.cs
- ProcessHost.cs
- RunInstallerAttribute.cs
- ContractMapping.cs
- CachedPathData.cs
- ContainerVisual.cs
- WebPartDisplayModeCancelEventArgs.cs
- BamlTreeMap.cs
- DiscoveryDocumentSerializer.cs
- TextParagraphView.cs
- DataList.cs
- XmlResolver.cs
- safex509handles.cs
- DataViewSetting.cs
- WebServiceMethodData.cs
- DetailsViewInsertedEventArgs.cs
- ProtocolViolationException.cs
- ConfigXmlElement.cs
- WSFederationHttpSecurityElement.cs
- ActivityBindForm.cs
- ComponentEditorPage.cs
- TextRenderer.cs
- recordstatefactory.cs
- SourceFilter.cs
- XamlStyleSerializer.cs
- BindableTemplateBuilder.cs
- InheritanceRules.cs
- HttpRuntime.cs
- DLinqColumnProvider.cs
- DesignerVerbCollection.cs
- FontFamilyIdentifier.cs
- ResXResourceWriter.cs
- ContainerControlDesigner.cs
- InputElement.cs
- XPathBuilder.cs
- XmlRawWriter.cs
- PermissionAttributes.cs
- TablePatternIdentifiers.cs
- ModifierKeysConverter.cs
- XamlFilter.cs
- TCPClient.cs
- HMACRIPEMD160.cs
- DynamicAttribute.cs
- DbReferenceCollection.cs
- XmlAnyAttributeAttribute.cs
- RTLAwareMessageBox.cs
- SvcMapFile.cs
- DocumentPageViewAutomationPeer.cs
- HTMLTagNameToTypeMapper.cs
- ElementNotAvailableException.cs
- JsonServiceDocumentSerializer.cs
- httpserverutility.cs
- PreviewKeyDownEventArgs.cs
- CaseExpr.cs
- ContextTokenTypeConverter.cs
- ComponentDispatcher.cs
- ControlAdapter.cs
- QuinticEase.cs
- _BasicClient.cs
- AggregatePushdown.cs
- SQLBoolean.cs
- TransformCollection.cs
- SamlAuthenticationStatement.cs
- DefaultValueConverter.cs
- PersonalizationStateInfoCollection.cs
- MarginCollapsingState.cs
- TextComposition.cs
- SocketException.cs
- DataServiceProviderWrapper.cs
- CaretElement.cs
- Action.cs
- DeviceSpecific.cs
- GreenMethods.cs
- PathStreamGeometryContext.cs
- WizardForm.cs
- PermissionSet.cs
- ProtocolsConfiguration.cs
- ComponentResourceKey.cs
- PasswordTextContainer.cs
- RelationshipConstraintValidator.cs
- SigningCredentials.cs
- streamingZipPartStream.cs
- TreeNode.cs
- RSACryptoServiceProvider.cs
- ResourceWriter.cs