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
- RoleGroupCollectionEditor.cs
- glyphs.cs
- ClientRolePrincipal.cs
- CacheRequest.cs
- ReservationCollection.cs
- DataControlExtensions.cs
- ParameterEditorUserControl.cs
- SafeLibraryHandle.cs
- FlagsAttribute.cs
- CheckedPointers.cs
- DataGridCaption.cs
- TypedElement.cs
- FormViewCommandEventArgs.cs
- NavigationExpr.cs
- SvcMapFileSerializer.cs
- VirtualPathUtility.cs
- InplaceBitmapMetadataWriter.cs
- IndentedWriter.cs
- SqlIdentifier.cs
- TCEAdapterGenerator.cs
- XmlSchemaCompilationSettings.cs
- WindowsRebar.cs
- Application.cs
- ArgumentNullException.cs
- DataGridRowDetailsEventArgs.cs
- AudioLevelUpdatedEventArgs.cs
- DataGridAddNewRow.cs
- RtfToXamlReader.cs
- ToolBarButtonClickEvent.cs
- SqlExpressionNullability.cs
- ClientBuildManager.cs
- DataGridViewHitTestInfo.cs
- MimeParameterWriter.cs
- UInt32Storage.cs
- URLIdentityPermission.cs
- MultiAsyncResult.cs
- OdbcReferenceCollection.cs
- ToolStripLocationCancelEventArgs.cs
- TranslateTransform3D.cs
- DescendentsWalkerBase.cs
- DrawingVisualDrawingContext.cs
- DataPagerFieldItem.cs
- AbstractExpressions.cs
- RequestQueryParser.cs
- ObjectItemLoadingSessionData.cs
- ConstraintCollection.cs
- XmlSerializableReader.cs
- Renderer.cs
- RedistVersionInfo.cs
- TypeListConverter.cs
- CompModSwitches.cs
- DeclarativeCatalogPart.cs
- ListBindingConverter.cs
- BaseHashHelper.cs
- DecoderNLS.cs
- DiagnosticTraceSchemas.cs
- EnumerableCollectionView.cs
- DifferencingCollection.cs
- EventlogProvider.cs
- DataGridViewLinkColumn.cs
- PropertyGridCommands.cs
- DataDocumentXPathNavigator.cs
- CodeIdentifier.cs
- HttpModulesSection.cs
- EditorPartChrome.cs
- TaskFileService.cs
- RawKeyboardInputReport.cs
- FrameworkContextData.cs
- ProcessProtocolHandler.cs
- EntityContainerEntitySet.cs
- UserControl.cs
- WinFormsSpinner.cs
- ConditionalExpression.cs
- NameValueFileSectionHandler.cs
- ViewUtilities.cs
- KeySpline.cs
- Registry.cs
- HeaderedItemsControl.cs
- DataListItem.cs
- DataGridColumnCollectionEditor.cs
- documentation.cs
- URLIdentityPermission.cs
- TickBar.cs
- AppDomainResourcePerfCounters.cs
- ObjectSet.cs
- GridViewRowPresenter.cs
- EntitySqlQueryCacheKey.cs
- OleDbErrorCollection.cs
- SessionIDManager.cs
- GeometryHitTestResult.cs
- ItemMap.cs
- BindUriHelper.cs
- MemoryResponseElement.cs
- CalloutQueueItem.cs
- CallbackValidatorAttribute.cs
- FontCollection.cs
- DateTimeOffsetAdapter.cs
- AbstractSvcMapFileLoader.cs
- Attributes.cs
- ClickablePoint.cs