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
- WebPartEditVerb.cs
- LinqDataSource.cs
- PrintController.cs
- DataServiceConfiguration.cs
- ScrollItemPattern.cs
- ApplicationDirectoryMembershipCondition.cs
- DrawToolTipEventArgs.cs
- sqlnorm.cs
- ConstructorExpr.cs
- LeafCellTreeNode.cs
- WorkflowDesignerColors.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- MSAAWinEventWrap.cs
- StrokeNode.cs
- SelectionRange.cs
- ScriptingWebServicesSectionGroup.cs
- PointAnimationUsingKeyFrames.cs
- CustomAttributeFormatException.cs
- ConnectionInterfaceCollection.cs
- WebServiceErrorEvent.cs
- GorillaCodec.cs
- TypedReference.cs
- XmlBinaryReader.cs
- SQLInt32Storage.cs
- ToolboxDataAttribute.cs
- EnumValidator.cs
- SmiRecordBuffer.cs
- DBSchemaRow.cs
- EnglishPluralizationService.cs
- RegexCode.cs
- DataRow.cs
- CallbackHandler.cs
- FamilyTypeface.cs
- HttpValueCollection.cs
- CustomErrorsSectionWrapper.cs
- GridViewSelectEventArgs.cs
- ReadContentAsBinaryHelper.cs
- DataGridViewTextBoxColumn.cs
- Translator.cs
- templategroup.cs
- ClientCredentialsElement.cs
- Listbox.cs
- X509Certificate2Collection.cs
- ExpressionNode.cs
- DataMemberListEditor.cs
- SizeKeyFrameCollection.cs
- ConnectionInterfaceCollection.cs
- CaseStatementSlot.cs
- GeneralTransform3DTo2D.cs
- DataKey.cs
- Rectangle.cs
- SqlConnectionStringBuilder.cs
- PartitionerQueryOperator.cs
- MethodBuilder.cs
- glyphs.cs
- BooleanSwitch.cs
- Win32PrintDialog.cs
- BufferedReadStream.cs
- DocumentViewerHelper.cs
- ReflectionHelper.cs
- StdValidatorsAndConverters.cs
- UniqueTransportManagerRegistration.cs
- CommandConverter.cs
- BitmapImage.cs
- WebPartZone.cs
- ColorPalette.cs
- TracedNativeMethods.cs
- ScriptReferenceBase.cs
- CompilerError.cs
- Calendar.cs
- BindingList.cs
- LayoutSettings.cs
- HostedController.cs
- FileInfo.cs
- ProxyWebPartManager.cs
- CurrentChangingEventArgs.cs
- BitSet.cs
- OdbcInfoMessageEvent.cs
- ProfilePropertySettingsCollection.cs
- cookie.cs
- ContainerCodeDomSerializer.cs
- SeverityFilter.cs
- BaseWebProxyFinder.cs
- WebPartZone.cs
- RemotingConfigParser.cs
- TaskDesigner.cs
- ProfileService.cs
- StorageBasedPackageProperties.cs
- CompoundFileStreamReference.cs
- RC2.cs
- PersistenceProviderFactory.cs
- SiteMapHierarchicalDataSourceView.cs
- _NtlmClient.cs
- Triplet.cs
- InstanceData.cs
- SyndicationFeed.cs
- DataTableReaderListener.cs
- Util.cs
- BinaryCommonClasses.cs
- CriticalFinalizerObject.cs