Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / Floater.cs / 1 / 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
- AbsoluteQuery.cs
- Converter.cs
- Expressions.cs
- DataGridViewCellEventArgs.cs
- ConnectionManagementElement.cs
- IISUnsafeMethods.cs
- IdSpace.cs
- Helpers.cs
- CodeMemberEvent.cs
- DataObject.cs
- MetadataCollection.cs
- XmlSchemaImport.cs
- LineServicesCallbacks.cs
- FileDialog_Vista.cs
- ForeignConstraint.cs
- GeneralTransformGroup.cs
- RepeaterCommandEventArgs.cs
- WsdlInspector.cs
- ConstraintCollection.cs
- ComProxy.cs
- EncoderParameter.cs
- HttpRequestCacheValidator.cs
- PartManifestEntry.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ErrorFormatter.cs
- GridItemPatternIdentifiers.cs
- IgnoreFileBuildProvider.cs
- TriggerBase.cs
- TextBounds.cs
- ConvertBinder.cs
- FontUnit.cs
- FacetDescription.cs
- XPathNavigator.cs
- XsltException.cs
- ParseChildrenAsPropertiesAttribute.cs
- GenericWebPart.cs
- HierarchicalDataBoundControl.cs
- ZipIOFileItemStream.cs
- GlyphShapingProperties.cs
- MethodInfo.cs
- ContentOperations.cs
- DSGeneratorProblem.cs
- MarkupProperty.cs
- ValidatorCompatibilityHelper.cs
- ValidatorCompatibilityHelper.cs
- X509InitiatorCertificateServiceElement.cs
- UserControlAutomationPeer.cs
- TextTreeDeleteContentUndoUnit.cs
- DesignTimeParseData.cs
- SystemTcpConnection.cs
- AppDomainInfo.cs
- SpoolingTaskBase.cs
- UdpDiscoveryMessageFilter.cs
- TrustExchangeException.cs
- DiffuseMaterial.cs
- AnonymousIdentificationModule.cs
- ListViewInsertionMark.cs
- DescendantBaseQuery.cs
- UnhandledExceptionEventArgs.cs
- DocobjHost.cs
- RenderData.cs
- CultureMapper.cs
- HierarchicalDataBoundControl.cs
- RoleServiceManager.cs
- UnmanagedHandle.cs
- Point3DCollection.cs
- ContainerControlDesigner.cs
- Image.cs
- RegexStringValidator.cs
- ToolStripSettings.cs
- Vector3DConverter.cs
- StringPropertyBuilder.cs
- AnnotationResourceChangedEventArgs.cs
- LocatorPart.cs
- RowCache.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- AssemblyInfo.cs
- TypeInitializationException.cs
- Stopwatch.cs
- EmptyQuery.cs
- WebUtil.cs
- SQlBooleanStorage.cs
- AssemblyAttributesGoHere.cs
- Config.cs
- TcpStreams.cs
- AutomationIdentifierGuids.cs
- ComplexObject.cs
- TableLayoutStyleCollection.cs
- ThrowHelper.cs
- ActivitySurrogateSelector.cs
- AsyncOperation.cs
- ReliableReplySessionChannel.cs
- URL.cs
- HostedElements.cs
- SHA384.cs
- ReadOnlyDataSource.cs
- ListItemParagraph.cs
- ScriptingWebServicesSectionGroup.cs
- DataGridViewHitTestInfo.cs
- Pair.cs