Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / FixedSOMElement.cs / 1305600 / FixedSOMElement.cs
/*++
File: FixedSOMElement.cs
Copyright (C) 2005 Microsoft Corporation. All rights reserved.
Description:
Abstract class that provides a common base class for all non-container semantic elements.
These elements have a fixed node and start and end symbol indices associated with them.
History:
05/17/2005: agurcan - Created
--*/
namespace System.Windows.Documents
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls;
internal abstract class FixedSOMElement : FixedSOMSemanticBox
{
//--------------------------------------------------------------------
//
// Constructors
//
//---------------------------------------------------------------------
#region Constructors
protected FixedSOMElement(FixedNode fixedNode, int startIndex, int endIndex, GeneralTransform transform)
{
_fixedNode = fixedNode;
_startIndex = startIndex;
_endIndex = endIndex;
Transform trans = transform.AffineTransform;
if (trans != null)
{
_mat = trans.Value;
}
else
{
_mat = Transform.Identity.Value;
}
}
protected FixedSOMElement(FixedNode fixedNode, GeneralTransform transform)
{
_fixedNode = fixedNode;
Transform trans = transform.AffineTransform;
if (trans != null)
{
_mat = trans.Value;
}
else
{
_mat = Transform.Identity.Value;
}
}
#endregion Constructors
//-------------------------------------------------------------------
//
// Public Properties
//
//---------------------------------------------------------------------
#region Static methods
public static FixedSOMElement CreateFixedSOMElement(FixedPage page, UIElement uiElement, FixedNode fixedNode, int startIndex, int endIndex)
{
FixedSOMElement element = null;
if (uiElement is Glyphs)
{
Glyphs glyphs = uiElement as Glyphs;
if (glyphs.UnicodeString.Length > 0)
{
GlyphRun glyphRun = glyphs.ToGlyphRun();
Rect alignmentBox = glyphRun.ComputeAlignmentBox();
alignmentBox.Offset(glyphs.OriginX, glyphs.OriginY);
GeneralTransform transform = glyphs.TransformToAncestor(page);
if (startIndex < 0)
{
startIndex = 0;
}
if (endIndex < 0)
{
endIndex = glyphRun.Characters == null ? 0 : glyphRun.Characters.Count;
}
element = FixedSOMTextRun.Create(alignmentBox, transform, glyphs, fixedNode, startIndex, endIndex, false);
}
}
else if (uiElement is Image)
{
element = FixedSOMImage.Create(page, uiElement as Image, fixedNode);
}
else if (uiElement is Path)
{
element = FixedSOMImage.Create(page, uiElement as Path, fixedNode);
}
return element;
}
#endregion Static methods
//--------------------------------------------------------------------
//
// Public Properties
//
//---------------------------------------------------------------------
#region Public Properties
public FixedNode FixedNode
{
get
{
return _fixedNode;
}
}
public int StartIndex
{
get
{
return _startIndex;
}
}
public int EndIndex
{
get
{
return _endIndex;
}
}
#endregion Public Properties
//--------------------------------------------------------------------
//
// Internal Properties
//
//----------------------------------------------------------------------
#region Internal Properties
internal FlowNode FlowNode
{
get
{
return _flowNode;
}
set
{
_flowNode = value;
}
}
internal int OffsetInFlowNode
{
get
{
return _offsetInFlowNode;
}
set
{
_offsetInFlowNode = value;
}
}
internal Matrix Matrix
{
get
{
return _mat;
}
}
#endregion Internal Properties
//-------------------------------------------------------------------
//
// Protected Fields
//
//----------------------------------------------------------------------
#region Protected Fields
protected FixedNode _fixedNode ;
protected int _startIndex;
protected int _endIndex;
protected Matrix _mat;
#endregion Protected Fields
#region Private Fields
private FlowNode _flowNode;
private int _offsetInFlowNode;
#endregion Private Fields
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
/*++
File: FixedSOMElement.cs
Copyright (C) 2005 Microsoft Corporation. All rights reserved.
Description:
Abstract class that provides a common base class for all non-container semantic elements.
These elements have a fixed node and start and end symbol indices associated with them.
History:
05/17/2005: agurcan - Created
--*/
namespace System.Windows.Documents
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls;
internal abstract class FixedSOMElement : FixedSOMSemanticBox
{
//--------------------------------------------------------------------
//
// Constructors
//
//---------------------------------------------------------------------
#region Constructors
protected FixedSOMElement(FixedNode fixedNode, int startIndex, int endIndex, GeneralTransform transform)
{
_fixedNode = fixedNode;
_startIndex = startIndex;
_endIndex = endIndex;
Transform trans = transform.AffineTransform;
if (trans != null)
{
_mat = trans.Value;
}
else
{
_mat = Transform.Identity.Value;
}
}
protected FixedSOMElement(FixedNode fixedNode, GeneralTransform transform)
{
_fixedNode = fixedNode;
Transform trans = transform.AffineTransform;
if (trans != null)
{
_mat = trans.Value;
}
else
{
_mat = Transform.Identity.Value;
}
}
#endregion Constructors
//-------------------------------------------------------------------
//
// Public Properties
//
//---------------------------------------------------------------------
#region Static methods
public static FixedSOMElement CreateFixedSOMElement(FixedPage page, UIElement uiElement, FixedNode fixedNode, int startIndex, int endIndex)
{
FixedSOMElement element = null;
if (uiElement is Glyphs)
{
Glyphs glyphs = uiElement as Glyphs;
if (glyphs.UnicodeString.Length > 0)
{
GlyphRun glyphRun = glyphs.ToGlyphRun();
Rect alignmentBox = glyphRun.ComputeAlignmentBox();
alignmentBox.Offset(glyphs.OriginX, glyphs.OriginY);
GeneralTransform transform = glyphs.TransformToAncestor(page);
if (startIndex < 0)
{
startIndex = 0;
}
if (endIndex < 0)
{
endIndex = glyphRun.Characters == null ? 0 : glyphRun.Characters.Count;
}
element = FixedSOMTextRun.Create(alignmentBox, transform, glyphs, fixedNode, startIndex, endIndex, false);
}
}
else if (uiElement is Image)
{
element = FixedSOMImage.Create(page, uiElement as Image, fixedNode);
}
else if (uiElement is Path)
{
element = FixedSOMImage.Create(page, uiElement as Path, fixedNode);
}
return element;
}
#endregion Static methods
//--------------------------------------------------------------------
//
// Public Properties
//
//---------------------------------------------------------------------
#region Public Properties
public FixedNode FixedNode
{
get
{
return _fixedNode;
}
}
public int StartIndex
{
get
{
return _startIndex;
}
}
public int EndIndex
{
get
{
return _endIndex;
}
}
#endregion Public Properties
//--------------------------------------------------------------------
//
// Internal Properties
//
//----------------------------------------------------------------------
#region Internal Properties
internal FlowNode FlowNode
{
get
{
return _flowNode;
}
set
{
_flowNode = value;
}
}
internal int OffsetInFlowNode
{
get
{
return _offsetInFlowNode;
}
set
{
_offsetInFlowNode = value;
}
}
internal Matrix Matrix
{
get
{
return _mat;
}
}
#endregion Internal Properties
//-------------------------------------------------------------------
//
// Protected Fields
//
//----------------------------------------------------------------------
#region Protected Fields
protected FixedNode _fixedNode ;
protected int _startIndex;
protected int _endIndex;
protected Matrix _mat;
#endregion Protected Fields
#region Private Fields
private FlowNode _flowNode;
private int _offsetInFlowNode;
#endregion Private Fields
}
}
// 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
- VisualBrush.cs
- HttpWebRequestElement.cs
- EventRoute.cs
- DbConnectionOptions.cs
- InvariantComparer.cs
- TcpTransportElement.cs
- OperationContext.cs
- PtsPage.cs
- infer.cs
- Enum.cs
- ListMarkerSourceInfo.cs
- GlobalProxySelection.cs
- XmlEventCache.cs
- WebPartAddingEventArgs.cs
- Exceptions.cs
- ViewKeyConstraint.cs
- SrgsGrammar.cs
- _Semaphore.cs
- ReadOnlyAttribute.cs
- DbParameterHelper.cs
- InitializationEventAttribute.cs
- InvalidCardException.cs
- TreeNode.cs
- MetadataArtifactLoaderFile.cs
- BehaviorEditorPart.cs
- BaseTemplateBuildProvider.cs
- ExpanderAutomationPeer.cs
- X509InitiatorCertificateServiceElement.cs
- HtmlElementEventArgs.cs
- TemplateParser.cs
- ButtonFlatAdapter.cs
- QilList.cs
- NullReferenceException.cs
- EventlogProvider.cs
- TraceHandlerErrorFormatter.cs
- LinqDataSourceInsertEventArgs.cs
- WebPartConnectionsDisconnectVerb.cs
- EntityDataSourceState.cs
- EventsTab.cs
- XmlSchemaImport.cs
- ToolStripControlHost.cs
- SqlWriter.cs
- AttributeConverter.cs
- DbConnectionPoolIdentity.cs
- Stylesheet.cs
- PrintController.cs
- ColorDialog.cs
- DbgUtil.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- Object.cs
- FieldBuilder.cs
- ListenerTraceUtility.cs
- LoginUtil.cs
- BasicExpressionVisitor.cs
- TypeNameConverter.cs
- DynamicRenderer.cs
- TimeManager.cs
- Help.cs
- SqlTypeConverter.cs
- NullableFloatSumAggregationOperator.cs
- GradientStop.cs
- DataSource.cs
- ApplicationServicesHostFactory.cs
- WinInetCache.cs
- IconHelper.cs
- CancellationHandlerDesigner.cs
- SchemaElementLookUpTable.cs
- PathFigureCollectionConverter.cs
- SelectionEditor.cs
- Composition.cs
- SendKeys.cs
- ProcessHost.cs
- WebControl.cs
- EventHandlersStore.cs
- FixUpCollection.cs
- XmlSchemaCompilationSettings.cs
- DataGridColumnCollection.cs
- GlobalEventManager.cs
- TranslateTransform.cs
- TypeElement.cs
- XmlSchemaNotation.cs
- DecoderFallback.cs
- PropertyKey.cs
- StickyNoteContentControl.cs
- EncodingDataItem.cs
- Solver.cs
- DataGridViewRow.cs
- StatusBarDrawItemEvent.cs
- WpfSharedXamlSchemaContext.cs
- Expression.cs
- ImageListDesigner.cs
- OleDbFactory.cs
- Tokenizer.cs
- UInt64Storage.cs
- CodeArgumentReferenceExpression.cs
- DataGridViewCell.cs
- DetailsViewPagerRow.cs
- StaticResourceExtension.cs
- Canvas.cs
- Graph.cs