Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / Floater.cs / 1305600 / Floater.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Floater element. // //--------------------------------------------------------------------------- using System.ComponentModel; using MS.Internal; using MS.Internal.PtsHost.UnsafeNativeMethods; // PTS restrictions namespace System.Windows.Documents { ////// Floater element /// public class Floater : AnchoredBlock { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Static ctor. Initializes property metadata. /// static Floater() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Floater), new FrameworkPropertyMetadata(typeof(Floater))); } ////// Initialized the new instance of a Floater /// public Floater() : this(null, null) { } ////// Initialized the new instance of a Floater specifying a Block added /// to a Floater as its first child. /// /// /// Block added as a first initial child of the Floater. /// public Floater(Block childBlock) : this(childBlock, null) { } ////// Creates a new Floater instance. /// /// /// Optional child of the new Floater, may be null. /// /// /// Optional position at which to insert the new Floater. May /// be null. /// public Floater(Block childBlock, TextPointer insertionPosition) : base(childBlock, insertionPosition) { } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Public Properties ////// DependencyProperty for public static readonly DependencyProperty HorizontalAlignmentProperty = FrameworkElement.HorizontalAlignmentProperty.AddOwner( typeof(Floater), new FrameworkPropertyMetadata( HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsMeasure)); ///property. /// /// /// public HorizontalAlignment HorizontalAlignment { get { return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty); } set { SetValue(HorizontalAlignmentProperty, value); } } ////// DependencyProperty for public static readonly DependencyProperty WidthProperty = DependencyProperty.Register( "Width", typeof(double), typeof(Floater), new FrameworkPropertyMetadata( Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), new ValidateValueCallback(IsValidWidth)); ///property. /// /// The Width property specifies the width of the element. /// [TypeConverter(typeof(LengthConverter))] public double Width { get { return (double)GetValue(WidthProperty); } set { SetValue(WidthProperty, value); } } #endregion Public Properties //-------------------------------------------------------------------- // // Private Methods // //-------------------------------------------------------------------- #region Private Methods private static bool IsValidWidth(object o) { double width = (double)o; double maxWidth = Math.Min(1000000, PTS.MaxPageSize); if (Double.IsNaN(width)) { // Default value of width is NaN return true; } if (width < 0 || width > maxWidth) { return false; } return true; } #endregion Private Methods } } // 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
- RegistrationServices.cs
- XmlSchemaParticle.cs
- ReliableMessagingHelpers.cs
- ScrollItemPattern.cs
- sitestring.cs
- SqlDataSourceSelectingEventArgs.cs
- SettingsProperty.cs
- Directory.cs
- _ListenerAsyncResult.cs
- ApplicationGesture.cs
- InfiniteIntConverter.cs
- AssociationSetMetadata.cs
- DelayedRegex.cs
- OdbcEnvironmentHandle.cs
- PathFigureCollectionConverter.cs
- ColorEditor.cs
- FillBehavior.cs
- TreeNode.cs
- XmlIncludeAttribute.cs
- TextFormattingConverter.cs
- RepeaterDesigner.cs
- Popup.cs
- StructuralType.cs
- ColorAnimationBase.cs
- CriticalHandle.cs
- UnsafeNativeMethods.cs
- CodeSnippetTypeMember.cs
- FunctionOverloadResolver.cs
- TagPrefixCollection.cs
- RowBinding.cs
- HMACSHA1.cs
- TransactionOptions.cs
- RefExpr.cs
- SystemColors.cs
- NameTable.cs
- ObjectDataSourceMethodEventArgs.cs
- ConnectionInterfaceCollection.cs
- ContentWrapperAttribute.cs
- XpsS0ValidatingLoader.cs
- EndpointNameMessageFilter.cs
- DbConnectionOptions.cs
- TemplateBindingExtension.cs
- AuthenticationModulesSection.cs
- ItemsControlAutomationPeer.cs
- MimeMultiPart.cs
- ListBindingHelper.cs
- BaseCodeDomTreeGenerator.cs
- XmlDocument.cs
- ObjectDesignerDataSourceView.cs
- AppAction.cs
- Gdiplus.cs
- Debugger.cs
- DataGridLinkButton.cs
- TextPenaltyModule.cs
- FloaterBaseParagraph.cs
- CryptoConfig.cs
- TreeNodeMouseHoverEvent.cs
- TiffBitmapDecoder.cs
- OrthographicCamera.cs
- Win32MouseDevice.cs
- ProfileServiceManager.cs
- StringValidator.cs
- CodeSnippetExpression.cs
- DetailsViewRow.cs
- ApplyTemplatesAction.cs
- SafeNativeMethods.cs
- CacheOutputQuery.cs
- _ListenerRequestStream.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- VideoDrawing.cs
- AttributeQuery.cs
- SignHashRequest.cs
- regiisutil.cs
- TargetException.cs
- CapabilitiesAssignment.cs
- TagMapCollection.cs
- sqlinternaltransaction.cs
- MimeMultiPart.cs
- EnumUnknown.cs
- _ListenerAsyncResult.cs
- ConfigurationStrings.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ToolBarPanel.cs
- OdbcHandle.cs
- HttpResponseMessageProperty.cs
- DecimalStorage.cs
- FastEncoderWindow.cs
- LOSFormatter.cs
- ExceptionValidationRule.cs
- ObfuscateAssemblyAttribute.cs
- NeutralResourcesLanguageAttribute.cs
- NamespaceQuery.cs
- MailSettingsSection.cs
- HyperLinkField.cs
- CustomExpression.cs
- ReadOnlyDictionary.cs
- XmlDeclaration.cs
- GiveFeedbackEvent.cs
- NativeMethods.cs
- PartManifestEntry.cs