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
- Model3D.cs
- DataColumnMappingCollection.cs
- TextHidden.cs
- TabPage.cs
- PhysicalOps.cs
- MetadataItem_Static.cs
- DefaultWorkflowSchedulerService.cs
- ListBindingHelper.cs
- MethodBuilder.cs
- ProxyFragment.cs
- SingleConverter.cs
- EncryptedKeyHashIdentifierClause.cs
- SelectionItemPatternIdentifiers.cs
- Ops.cs
- PersonalizationStateQuery.cs
- XomlCompilerResults.cs
- XPathException.cs
- Documentation.cs
- ListViewItemMouseHoverEvent.cs
- SqlDataSourceCache.cs
- EntityCommandDefinition.cs
- NoneExcludedImageIndexConverter.cs
- WorkflowInstanceContextProvider.cs
- Facet.cs
- BackEase.cs
- BitmapPalettes.cs
- BCLDebug.cs
- NumericUpDown.cs
- TogglePatternIdentifiers.cs
- Timer.cs
- XmlSchemaObject.cs
- TextEmbeddedObject.cs
- DataMisalignedException.cs
- HostProtectionPermission.cs
- HtmlElementCollection.cs
- SettingsProperty.cs
- CdpEqualityComparer.cs
- PointConverter.cs
- TextMarkerSource.cs
- UnsafeNativeMethods.cs
- XmlSchemaGroup.cs
- UserControlCodeDomTreeGenerator.cs
- RemoteWebConfigurationHost.cs
- SafeIUnknown.cs
- NonClientArea.cs
- WebBrowserUriTypeConverter.cs
- EdmSchemaAttribute.cs
- GridViewRowPresenterBase.cs
- QueryGenerator.cs
- XmlElementList.cs
- HitTestParameters.cs
- Configuration.cs
- PropertyGridCommands.cs
- EntityDataSourceQueryBuilder.cs
- XmlUtil.cs
- CrossContextChannel.cs
- Validator.cs
- AllMembershipCondition.cs
- ReadOnlyDataSource.cs
- PageStatePersister.cs
- SubclassTypeValidatorAttribute.cs
- XhtmlBasicControlAdapter.cs
- DocobjHost.cs
- FileClassifier.cs
- TextTreeDeleteContentUndoUnit.cs
- XD.cs
- TypeGeneratedEventArgs.cs
- FormsIdentity.cs
- BehaviorDragDropEventArgs.cs
- SapiRecoContext.cs
- BitmapCache.cs
- UInt64Storage.cs
- WindowsRegion.cs
- TextSelection.cs
- NetworkInformationPermission.cs
- LinqToSqlWrapper.cs
- TextBreakpoint.cs
- sqlpipe.cs
- MediaTimeline.cs
- Thumb.cs
- GroupJoinQueryOperator.cs
- SoapCodeExporter.cs
- ServiceProviders.cs
- PartialTrustVisibleAssembly.cs
- Queue.cs
- FieldBuilder.cs
- TreeViewImageIndexConverter.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- HuffmanTree.cs
- ListenerServiceInstallComponent.cs
- SessionStateModule.cs
- MenuItem.cs
- MouseActionValueSerializer.cs
- ReliableDuplexSessionChannel.cs
- StatusBarPanel.cs
- Substitution.cs
- Matrix3DStack.cs
- HttpCookie.cs
- DecoderBestFitFallback.cs
- ScriptingProfileServiceSection.cs