Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Documents / Inline.cs / 1 / Inline.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Inline element. // // History: // 06/06/2002 : MikeOrr - Created. // 07/10/2002 : MikeOrr - Renamed element/class 'Phrase' -> 'Inline'. // 06/25/2003 : ZhenbinX - Ported to /Rewrote for WCP tree // 10/28/2004 : grzegorz - ContentElements refactoring. // //--------------------------------------------------------------------------- using MS.Internal; namespace System.Windows.Documents { ////// Inline element. /// [TextElementEditingBehaviorAttribute(IsMergeable = true, IsTypographicOnly = true)] public abstract class Inline : TextElement { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Public constructor. /// protected Inline() : base() { } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Public Properties ////// A collection of Inlines containing this one in its sequential tree. /// May return null if an element is not inserted into any tree. /// public InlineCollection SiblingInlines { get { if (this.Parent == null) { return null; } return new InlineCollection(this, /*isOwnerParent*/false); } } ////// Returns an Inline immediately following this one /// on the same level of siblings /// public Inline NextInline { get { return this.NextElement as Inline; } } ////// Returns an Inline immediately preceding this one /// on the same level of siblings /// public Inline PreviousInline { get { return this.PreviousElement as Inline; } } ////// DependencyProperty for public static readonly DependencyProperty BaselineAlignmentProperty = DependencyProperty.Register( "BaselineAlignment", typeof(BaselineAlignment), typeof(Inline), new FrameworkPropertyMetadata( BaselineAlignment.Baseline, FrameworkPropertyMetadataOptions.AffectsParentMeasure), new ValidateValueCallback(IsValidBaselineAlignment)); ///property. /// /// /// public BaselineAlignment BaselineAlignment { get { return (BaselineAlignment) GetValue(BaselineAlignmentProperty); } set { SetValue(BaselineAlignmentProperty, value); } } ////// DependencyProperty for public static readonly DependencyProperty TextDecorationsProperty = DependencyProperty.Register( "TextDecorations", typeof(TextDecorationCollection), typeof(Inline), new FrameworkPropertyMetadata( new FreezableDefaultValueFactory(TextDecorationCollection.Empty), FrameworkPropertyMetadataOptions.AffectsRender )); ///property. /// /// The TextDecorations property specifies decorations that are added to the text of an element. /// public TextDecorationCollection TextDecorations { get { return (TextDecorationCollection) GetValue(TextDecorationsProperty); } set { SetValue(TextDecorationsProperty, value); } } ////// DependencyProperty for public static readonly DependencyProperty FlowDirectionProperty = FrameworkElement.FlowDirectionProperty.AddOwner(typeof(Inline)); ///property. /// /// The FlowDirection property specifies the flow direction of the element. /// public FlowDirection FlowDirection { get { return (FlowDirection)GetValue(FlowDirectionProperty); } set { SetValue(FlowDirectionProperty, value); } } #endregion Public Properties //-------------------------------------------------------------------- // // Internal Methods // //-------------------------------------------------------------------- #region Internal Methods internal static Run CreateImplicitRun(DependencyObject parent) { return new Run(); } internal static InlineUIContainer CreateImplicitInlineUIContainer(DependencyObject parent) { return new InlineUIContainer(); } #endregion Internal Methods //------------------------------------------------------------------- // // Private Methods // //-------------------------------------------------------------------- #region Private Methods private static bool IsValidBaselineAlignment(object o) { BaselineAlignment value = (BaselineAlignment)o; return value == BaselineAlignment.Baseline || value == BaselineAlignment.Bottom || value == BaselineAlignment.Center || value == BaselineAlignment.Subscript || value == BaselineAlignment.Superscript || value == BaselineAlignment.TextBottom || value == BaselineAlignment.TextTop || value == BaselineAlignment.Top; } #endregion Private Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Inline element. // // History: // 06/06/2002 : MikeOrr - Created. // 07/10/2002 : MikeOrr - Renamed element/class 'Phrase' -> 'Inline'. // 06/25/2003 : ZhenbinX - Ported to /Rewrote for WCP tree // 10/28/2004 : grzegorz - ContentElements refactoring. // //--------------------------------------------------------------------------- using MS.Internal; namespace System.Windows.Documents { ////// Inline element. /// [TextElementEditingBehaviorAttribute(IsMergeable = true, IsTypographicOnly = true)] public abstract class Inline : TextElement { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Public constructor. /// protected Inline() : base() { } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Public Properties ////// A collection of Inlines containing this one in its sequential tree. /// May return null if an element is not inserted into any tree. /// public InlineCollection SiblingInlines { get { if (this.Parent == null) { return null; } return new InlineCollection(this, /*isOwnerParent*/false); } } ////// Returns an Inline immediately following this one /// on the same level of siblings /// public Inline NextInline { get { return this.NextElement as Inline; } } ////// Returns an Inline immediately preceding this one /// on the same level of siblings /// public Inline PreviousInline { get { return this.PreviousElement as Inline; } } ////// DependencyProperty for public static readonly DependencyProperty BaselineAlignmentProperty = DependencyProperty.Register( "BaselineAlignment", typeof(BaselineAlignment), typeof(Inline), new FrameworkPropertyMetadata( BaselineAlignment.Baseline, FrameworkPropertyMetadataOptions.AffectsParentMeasure), new ValidateValueCallback(IsValidBaselineAlignment)); ///property. /// /// /// public BaselineAlignment BaselineAlignment { get { return (BaselineAlignment) GetValue(BaselineAlignmentProperty); } set { SetValue(BaselineAlignmentProperty, value); } } ////// DependencyProperty for public static readonly DependencyProperty TextDecorationsProperty = DependencyProperty.Register( "TextDecorations", typeof(TextDecorationCollection), typeof(Inline), new FrameworkPropertyMetadata( new FreezableDefaultValueFactory(TextDecorationCollection.Empty), FrameworkPropertyMetadataOptions.AffectsRender )); ///property. /// /// The TextDecorations property specifies decorations that are added to the text of an element. /// public TextDecorationCollection TextDecorations { get { return (TextDecorationCollection) GetValue(TextDecorationsProperty); } set { SetValue(TextDecorationsProperty, value); } } ////// DependencyProperty for public static readonly DependencyProperty FlowDirectionProperty = FrameworkElement.FlowDirectionProperty.AddOwner(typeof(Inline)); ///property. /// /// The FlowDirection property specifies the flow direction of the element. /// public FlowDirection FlowDirection { get { return (FlowDirection)GetValue(FlowDirectionProperty); } set { SetValue(FlowDirectionProperty, value); } } #endregion Public Properties //-------------------------------------------------------------------- // // Internal Methods // //-------------------------------------------------------------------- #region Internal Methods internal static Run CreateImplicitRun(DependencyObject parent) { return new Run(); } internal static InlineUIContainer CreateImplicitInlineUIContainer(DependencyObject parent) { return new InlineUIContainer(); } #endregion Internal Methods //------------------------------------------------------------------- // // Private Methods // //-------------------------------------------------------------------- #region Private Methods private static bool IsValidBaselineAlignment(object o) { BaselineAlignment value = (BaselineAlignment)o; return value == BaselineAlignment.Baseline || value == BaselineAlignment.Bottom || value == BaselineAlignment.Center || value == BaselineAlignment.Subscript || value == BaselineAlignment.Superscript || value == BaselineAlignment.TextBottom || value == BaselineAlignment.TextTop || value == BaselineAlignment.Top; } #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
- ContainerCodeDomSerializer.cs
- UndirectedGraph.cs
- OdbcError.cs
- ClientConfigPaths.cs
- AnnotationMap.cs
- UpdateTracker.cs
- SmtpLoginAuthenticationModule.cs
- Win32SafeHandles.cs
- SqlWebEventProvider.cs
- ActivityTypeDesigner.xaml.cs
- Funcletizer.cs
- SyntaxCheck.cs
- UIElementCollection.cs
- ThreadExceptionEvent.cs
- exports.cs
- WebPartEditorApplyVerb.cs
- QuadraticBezierSegment.cs
- UriScheme.cs
- BamlStream.cs
- ValueCollectionParameterReader.cs
- ClientProxyGenerator.cs
- ContentTextAutomationPeer.cs
- ObjectDataSourceDisposingEventArgs.cs
- LinkUtilities.cs
- MimeMapping.cs
- CounterCreationData.cs
- XmlText.cs
- PeerContact.cs
- TextBreakpoint.cs
- GregorianCalendar.cs
- CompilerScopeManager.cs
- CompositeClientFormatter.cs
- BitmapEffectInputData.cs
- UshortList2.cs
- NavigateEvent.cs
- FormsAuthenticationCredentials.cs
- EntityDataSourceContainerNameItem.cs
- GlobalEventManager.cs
- MetadataUtilsSmi.cs
- ToolStripMenuItemDesigner.cs
- Scene3D.cs
- IPHostEntry.cs
- DataGridViewColumnConverter.cs
- WebPartConnectionsEventArgs.cs
- ButtonBaseAutomationPeer.cs
- Marshal.cs
- ISFTagAndGuidCache.cs
- FileClassifier.cs
- PropertyInfoSet.cs
- AttachInfo.cs
- IncrementalHitTester.cs
- TransactionChannelFactory.cs
- NumberFunctions.cs
- PanelStyle.cs
- GridViewEditEventArgs.cs
- Deflater.cs
- ExpressionPrinter.cs
- TreeIterator.cs
- UnsafeMethods.cs
- OleAutBinder.cs
- GroupBox.cs
- QueryCursorEventArgs.cs
- DataGridViewColumnCollection.cs
- XmlLoader.cs
- LineServices.cs
- IssuanceLicense.cs
- XmlHelper.cs
- SrgsElement.cs
- PointAnimationUsingPath.cs
- InteropExecutor.cs
- ValidatorUtils.cs
- WebPartTransformerAttribute.cs
- ListenUriMode.cs
- StrongName.cs
- DetailsViewUpdatedEventArgs.cs
- CommandDevice.cs
- NamedPermissionSet.cs
- TextFormatterContext.cs
- Crypto.cs
- ListBindableAttribute.cs
- MouseEventArgs.cs
- SqlDataSourceConfigureSelectPanel.cs
- CssStyleCollection.cs
- ListViewContainer.cs
- StyleSelector.cs
- ButtonBase.cs
- MouseButtonEventArgs.cs
- PixelShader.cs
- HttpException.cs
- CreateCardRequest.cs
- EntityUtil.cs
- StreamResourceInfo.cs
- CodeDomSerializationProvider.cs
- ComponentCommands.cs
- PageAdapter.cs
- XsdDataContractExporter.cs
- TableAutomationPeer.cs
- PieceDirectory.cs
- CompilerScope.cs
- AlternateView.cs