Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / FixedSOMElement.cs / 1 / 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: [....] - 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
- EventPrivateKey.cs
- DataObjectMethodAttribute.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- CollectionViewGroupInternal.cs
- ScriptReferenceEventArgs.cs
- ClientScriptManager.cs
- Aggregates.cs
- SqlConnectionFactory.cs
- TraversalRequest.cs
- ConfigurationManager.cs
- TemplateField.cs
- ListComponentEditor.cs
- SelectManyQueryOperator.cs
- ConfigurationManagerHelperFactory.cs
- _ConnectionGroup.cs
- COM2IPerPropertyBrowsingHandler.cs
- OleDbRowUpdatedEvent.cs
- CancelAsyncOperationRequest.cs
- UnknownBitmapEncoder.cs
- SafeSystemMetrics.cs
- ZoneMembershipCondition.cs
- StringValueSerializer.cs
- TextOptionsInternal.cs
- DocumentGridPage.cs
- SystemIcmpV6Statistics.cs
- DataGridColumnDropSeparator.cs
- TypeDelegator.cs
- CqlBlock.cs
- PointKeyFrameCollection.cs
- DnsPermission.cs
- MaskInputRejectedEventArgs.cs
- DataBoundLiteralControl.cs
- Stylus.cs
- Rect.cs
- ResourceProperty.cs
- JournalNavigationScope.cs
- SafeViewOfFileHandle.cs
- KnownTypes.cs
- TimeoutValidationAttribute.cs
- _NetRes.cs
- DataGridViewButtonCell.cs
- XPathException.cs
- GlyphRunDrawing.cs
- HttpAsyncResult.cs
- BindingCollectionElement.cs
- ComponentConverter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DecoderFallback.cs
- DataTableTypeConverter.cs
- Light.cs
- CounterSetInstanceCounterDataSet.cs
- HttpCachePolicyBase.cs
- DependencyObjectType.cs
- CollectionAdapters.cs
- EntityProxyFactory.cs
- NamespaceList.cs
- XmlSchemaComplexType.cs
- Currency.cs
- CombinedTcpChannel.cs
- ModuleConfigurationInfo.cs
- ControllableStoryboardAction.cs
- TableRowCollection.cs
- ReadOnlyCollection.cs
- GradientBrush.cs
- ConsumerConnectionPoint.cs
- WindowsAuthenticationEventArgs.cs
- DiscardableAttribute.cs
- MenuItemAutomationPeer.cs
- UserControl.cs
- DefaultPrintController.cs
- PageThemeParser.cs
- TypedElement.cs
- MobileUserControl.cs
- ConnectionManagementElement.cs
- D3DImage.cs
- CodeDirectiveCollection.cs
- StdValidatorsAndConverters.cs
- DetailsViewUpdateEventArgs.cs
- WindowProviderWrapper.cs
- LinqDataSourceHelper.cs
- TemplateGroupCollection.cs
- WebPartDescription.cs
- ItemsControl.cs
- SoapUnknownHeader.cs
- SafeEventLogWriteHandle.cs
- GroupLabel.cs
- TreeView.cs
- ZipFileInfoCollection.cs
- EncryptedData.cs
- TextWriterEngine.cs
- GenericTypeParameterBuilder.cs
- WebPartUserCapability.cs
- DataGridViewCheckBoxColumn.cs
- SafePointer.cs
- RetrieveVirtualItemEventArgs.cs
- MouseEvent.cs
- ConcatQueryOperator.cs
- TextRangeEdit.cs
- Request.cs
- RequestSecurityTokenResponse.cs