Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / Inline.cs / 1305600 / 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 : [....] - 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 property.
///
public static readonly DependencyProperty BaselineAlignmentProperty =
DependencyProperty.Register(
"BaselineAlignment",
typeof(BaselineAlignment),
typeof(Inline),
new FrameworkPropertyMetadata(
BaselineAlignment.Baseline,
FrameworkPropertyMetadataOptions.AffectsParentMeasure),
new ValidateValueCallback(IsValidBaselineAlignment));
///
///
///
public BaselineAlignment BaselineAlignment
{
get { return (BaselineAlignment) GetValue(BaselineAlignmentProperty); }
set { SetValue(BaselineAlignmentProperty, value); }
}
///
/// DependencyProperty for property.
///
public static readonly DependencyProperty TextDecorationsProperty =
DependencyProperty.Register(
"TextDecorations",
typeof(TextDecorationCollection),
typeof(Inline),
new FrameworkPropertyMetadata(
new FreezableDefaultValueFactory(TextDecorationCollection.Empty),
FrameworkPropertyMetadataOptions.AffectsRender
));
///
/// 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 property.
///
public static readonly DependencyProperty FlowDirectionProperty =
FrameworkElement.FlowDirectionProperty.AddOwner(typeof(Inline));
///
/// 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
- SocketException.cs
- OleDbWrapper.cs
- DispatcherProcessingDisabled.cs
- Base64Encoder.cs
- EventSinkHelperWriter.cs
- MergeEnumerator.cs
- BitmapEffectInputData.cs
- XmlWrappingWriter.cs
- __TransparentProxy.cs
- TextEditorContextMenu.cs
- XmlHierarchicalEnumerable.cs
- FacetDescriptionElement.cs
- InvalidComObjectException.cs
- DataListComponentEditor.cs
- InkPresenterAutomationPeer.cs
- EdmToObjectNamespaceMap.cs
- HtmlProps.cs
- NameHandler.cs
- XmlNamespaceMapping.cs
- CompiledQuery.cs
- SpotLight.cs
- DictionarySectionHandler.cs
- MembershipPasswordException.cs
- ContentElementAutomationPeer.cs
- EastAsianLunisolarCalendar.cs
- DataBindingList.cs
- ListDictionary.cs
- StructuralCache.cs
- StatusBarItemAutomationPeer.cs
- ObjectReferenceStack.cs
- AppDomainUnloadedException.cs
- Renderer.cs
- DbUpdateCommandTree.cs
- SharedPersonalizationStateInfo.cs
- SourceFileInfo.cs
- PolicyManager.cs
- ComponentRenameEvent.cs
- QilNode.cs
- ColorConvertedBitmap.cs
- MLangCodePageEncoding.cs
- BitVec.cs
- UserUseLicenseDictionaryLoader.cs
- ErrorTableItemStyle.cs
- CellConstantDomain.cs
- BackStopAuthenticationModule.cs
- SettingsPropertyCollection.cs
- DesignTimeParseData.cs
- LambdaCompiler.Unary.cs
- DebugView.cs
- x509utils.cs
- XamlClipboardData.cs
- OdbcRowUpdatingEvent.cs
- CodeDOMUtility.cs
- WebDisplayNameAttribute.cs
- TableItemPatternIdentifiers.cs
- PersonalizationProviderHelper.cs
- IndicCharClassifier.cs
- ImportCatalogPart.cs
- UnsafeNativeMethods.cs
- DelegatedStream.cs
- TextEditorParagraphs.cs
- Context.cs
- EventLogPermissionEntry.cs
- CacheHelper.cs
- VariableAction.cs
- HtmlInputHidden.cs
- EntityCommandCompilationException.cs
- XmlBinaryReaderSession.cs
- CopyCodeAction.cs
- ResizeGrip.cs
- InsufficientMemoryException.cs
- GcHandle.cs
- DataGridViewColumnStateChangedEventArgs.cs
- RegexNode.cs
- WebDisplayNameAttribute.cs
- StringUtil.cs
- NavigationProperty.cs
- MessageAction.cs
- Unit.cs
- SqlRowUpdatedEvent.cs
- ExpandableObjectConverter.cs
- EventSinkHelperWriter.cs
- _BufferOffsetSize.cs
- TableAutomationPeer.cs
- ObjectPropertyMapping.cs
- SchemaImporterExtensionElementCollection.cs
- XsltCompileContext.cs
- PolicyChain.cs
- BoundColumn.cs
- altserialization.cs
- DataContractJsonSerializer.cs
- WeakReferenceList.cs
- ChangeBlockUndoRecord.cs
- SafeWaitHandle.cs
- ExtractedStateEntry.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- UInt64Converter.cs
- DesignerActionList.cs
- RootNamespaceAttribute.cs
- WebPartCancelEventArgs.cs