Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Input / Command / MouseActionValueSerializer.cs / 1 / 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. //---------------------------------------------------------------------------- // // // 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
- PolicyLevel.cs
- ContainerFilterService.cs
- BuilderInfo.cs
- InputReportEventArgs.cs
- XPathAncestorQuery.cs
- ListViewItemEventArgs.cs
- RelationshipNavigation.cs
- SpecularMaterial.cs
- TextServicesCompartmentEventSink.cs
- StyleBamlTreeBuilder.cs
- TextEffectResolver.cs
- ParsedAttributeCollection.cs
- PrimitiveDataContract.cs
- DateTimeSerializationSection.cs
- Parameter.cs
- SubpageParaClient.cs
- FormViewCommandEventArgs.cs
- CustomAttributeSerializer.cs
- BorderGapMaskConverter.cs
- TogglePattern.cs
- rsa.cs
- RSACryptoServiceProvider.cs
- WebEventCodes.cs
- BamlLocalizableResourceKey.cs
- XamlFigureLengthSerializer.cs
- OdbcError.cs
- GeneralTransform2DTo3DTo2D.cs
- Style.cs
- HttpInputStream.cs
- ClipboardData.cs
- FastPropertyAccessor.cs
- localization.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- ZoneLinkButton.cs
- XamlTypeMapperSchemaContext.cs
- PathSegment.cs
- SimpleApplicationHost.cs
- DesignerEditorPartChrome.cs
- File.cs
- WindowsFormsLinkLabel.cs
- ClientUrlResolverWrapper.cs
- IRCollection.cs
- DbReferenceCollection.cs
- PipelineModuleStepContainer.cs
- URLAttribute.cs
- ManifestResourceInfo.cs
- ContextInformation.cs
- ISCIIEncoding.cs
- KeyValuePairs.cs
- SourceFileBuildProvider.cs
- XamlGridLengthSerializer.cs
- Utilities.cs
- RSAPKCS1SignatureDeformatter.cs
- SQLUtility.cs
- MouseActionValueSerializer.cs
- XamlStyleSerializer.cs
- SqlCaseSimplifier.cs
- SecurityElement.cs
- Message.cs
- HttpServerVarsCollection.cs
- IdentityReference.cs
- KeyValueInternalCollection.cs
- CollectionViewGroup.cs
- QuaternionIndependentAnimationStorage.cs
- SimpleHandlerFactory.cs
- FileDataSourceCache.cs
- OleDbSchemaGuid.cs
- TypePropertyEditor.cs
- VectorCollectionConverter.cs
- FuncCompletionCallbackWrapper.cs
- Errors.cs
- ExtendedPropertyDescriptor.cs
- SmtpNtlmAuthenticationModule.cs
- AutomationPattern.cs
- XmlIlTypeHelper.cs
- WebPartDisplayModeCollection.cs
- OutKeywords.cs
- OdbcCommand.cs
- XmlProcessingInstruction.cs
- HttpConfigurationContext.cs
- NumberFormatInfo.cs
- ListSourceHelper.cs
- ColorTransformHelper.cs
- ZipIOExtraFieldZip64Element.cs
- ChtmlImageAdapter.cs
- StatusBarPanel.cs
- XmlMemberMapping.cs
- WindowsGraphics.cs
- QuadraticBezierSegment.cs
- ByteArrayHelperWithString.cs
- AsyncContentLoadedEventArgs.cs
- DynamicActivity.cs
- IsolationInterop.cs
- AxHostDesigner.cs
- ConnectionPoint.cs
- PropertyEmitter.cs
- ReceiveActivityDesigner.cs
- TreeViewBindingsEditor.cs
- OdbcPermission.cs
- ButtonBase.cs