Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / Converters / Generated / SizeValueSerializer.cs / 1 / SizeValueSerializer.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // This file was generated, please do not edit it directly. // // Please see [....]/default.aspx/Microsoft.Projects.Avalon/MilCodeGen.html for more information. // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.WindowsBase; using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.ComponentModel.Design.Serialization; using System.Windows.Markup; using System.Windows.Converters; using System.Windows; #pragma warning disable 1634, 1691 // suppressing PreSharp warnings namespace System.Windows.Converters { ////// SizeValueSerializer - ValueSerializer class for converting instances of strings to and from Size instances /// This is used by the MarkupWriter class. /// public class SizeValueSerializer : ValueSerializer { ////// Returns true. /// public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } ////// Returns true if the given value can be converted into a string /// public override bool CanConvertToString(object value, IValueSerializerContext context) { // Validate the input type if (!(value is Size)) { throw new ArgumentException(SR.Get(SRID.General_Expected_Type, "Size"), "value"); } return true; } ////// Converts a string into a Size. /// public override object ConvertFromString(string value, IValueSerializerContext context) { if (value != null) { return Size.Parse(value ); } else { return base.ConvertFromString( value, context ); } } ////// Converts the value into a string. /// public override string ConvertToString(object value, IValueSerializerContext context) { if (value is Size) { Size instance = (Size) value; #pragma warning suppress 6506 // instance is obviously not null return instance.ConvertToString(null, CultureInfo.GetCultureInfo("en-us") ); } 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
- NavigatorInput.cs
- HttpListener.cs
- CaseCqlBlock.cs
- RegexParser.cs
- HwndHostAutomationPeer.cs
- XPathExpr.cs
- Typography.cs
- InvokeProviderWrapper.cs
- ScrollChangedEventArgs.cs
- Highlights.cs
- HtmlHistory.cs
- FloatSumAggregationOperator.cs
- SAPIEngineTypes.cs
- TextEditorContextMenu.cs
- DataGridItemCollection.cs
- PrintPreviewDialog.cs
- ParserStreamGeometryContext.cs
- propertytag.cs
- XsltArgumentList.cs
- RightsManagementEncryptionTransform.cs
- DmlSqlGenerator.cs
- IndexedEnumerable.cs
- PageVisual.cs
- EntityRecordInfo.cs
- ThreadSafeList.cs
- SqlServer2KCompatibilityAnnotation.cs
- BrushValueSerializer.cs
- DataControlFieldCell.cs
- ObjectSet.cs
- RangeValidator.cs
- SymDocumentType.cs
- PageTheme.cs
- _StreamFramer.cs
- TcpClientCredentialType.cs
- ObservableCollection.cs
- FormsAuthenticationConfiguration.cs
- LogPolicy.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- EmbeddedMailObject.cs
- SecureEnvironment.cs
- ProfileGroupSettings.cs
- ViewGenResults.cs
- RoutedCommand.cs
- RegistrationServices.cs
- XmlName.cs
- XamlWriter.cs
- MD5CryptoServiceProvider.cs
- DataSourceExpressionCollection.cs
- ObjectManager.cs
- XsltArgumentList.cs
- RoleExceptions.cs
- FileClassifier.cs
- Array.cs
- CheckBoxPopupAdapter.cs
- Win32Native.cs
- FrameworkContentElement.cs
- ViewSimplifier.cs
- DefaultEventAttribute.cs
- HttpListener.cs
- ImmutableAssemblyCacheEntry.cs
- XmlSignificantWhitespace.cs
- RouteUrlExpressionBuilder.cs
- ResourceType.cs
- StrongName.cs
- TimeSpanValidatorAttribute.cs
- ValueType.cs
- RawStylusInputCustomDataList.cs
- ListItemConverter.cs
- HelpFileFileNameEditor.cs
- DataGridAutoFormat.cs
- webproxy.cs
- UIElementCollection.cs
- Label.cs
- UnSafeCharBuffer.cs
- LocalizeDesigner.cs
- File.cs
- AttributedMetaModel.cs
- XmlConverter.cs
- DBConnection.cs
- AppSettingsReader.cs
- CellIdBoolean.cs
- InvokeAction.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- SettingsPropertyValueCollection.cs
- TriggerActionCollection.cs
- ServicePointManagerElement.cs
- IUnknownConstantAttribute.cs
- CreateParams.cs
- XmlWriterSettings.cs
- SchemaType.cs
- OutputCacheModule.cs
- IsolatedStorage.cs
- AuthenticationServiceManager.cs
- _SpnDictionary.cs
- ApplicationId.cs
- BitmapDownload.cs
- TargetInvocationException.cs
- SetIterators.cs
- ImageList.cs
- EntityProviderServices.cs