Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / Text / MarkerProperties.cs / 1305600 / MarkerProperties.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: MarkerProperties.cs // // Description: Marker properties. // // History: // 06/06/2003 : [....] - created. // 07/18/2003 : [....] - converted to new Property Engine. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Documents; using System.Windows.Media.TextFormatting; using MS.Internal.PtsHost.UnsafeNativeMethods; // Relative line height from PTS namespace MS.Internal.Text { // --------------------------------------------------------------------- // Marker properties. // --------------------------------------------------------------------- internal sealed class MarkerProperties { ////// Constructor. /// ////// The listWidth parameter gives the width of the list element, and is used to clip the MarkerOffset value /// internal MarkerProperties(List list, int index) { _offset = list.MarkerOffset; // Negative value for offset because it is required by TextFormatter line box model. // If offset is NaN - default value - set it as 0.5 * line height if (Double.IsNaN(_offset)) { // Obtain list's line height to set defualt marker offsert double lineHeight = DynamicPropertyReader.GetLineHeightValue(list); _offset = - 0.5 * lineHeight; } else { _offset = -_offset; } _style = list.MarkerStyle; _index = index; } // ------------------------------------------------------------------ // GetTextMarkerProperties // ----------------------------------------------------------------- internal TextMarkerProperties GetTextMarkerProperties(TextParagraphProperties textParaProps) { return new TextSimpleMarkerProperties(_style, _offset, _index, textParaProps); } // ------------------------------------------------------------------ // Marker style // ------------------------------------------------------------------ private TextMarkerStyle _style; // ----------------------------------------------------------------- // Distance from line start to the end of the marker symbol. // ------------------------------------------------------------------ private double _offset; // ----------------------------------------------------------------- // Autonumbering counter of counter-style marker. // ----------------------------------------------------------------- private int _index; } } // 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. // // File: MarkerProperties.cs // // Description: Marker properties. // // History: // 06/06/2003 : [....] - created. // 07/18/2003 : [....] - converted to new Property Engine. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Documents; using System.Windows.Media.TextFormatting; using MS.Internal.PtsHost.UnsafeNativeMethods; // Relative line height from PTS namespace MS.Internal.Text { // --------------------------------------------------------------------- // Marker properties. // --------------------------------------------------------------------- internal sealed class MarkerProperties { ////// Constructor. /// ////// The listWidth parameter gives the width of the list element, and is used to clip the MarkerOffset value /// internal MarkerProperties(List list, int index) { _offset = list.MarkerOffset; // Negative value for offset because it is required by TextFormatter line box model. // If offset is NaN - default value - set it as 0.5 * line height if (Double.IsNaN(_offset)) { // Obtain list's line height to set defualt marker offsert double lineHeight = DynamicPropertyReader.GetLineHeightValue(list); _offset = - 0.5 * lineHeight; } else { _offset = -_offset; } _style = list.MarkerStyle; _index = index; } // ------------------------------------------------------------------ // GetTextMarkerProperties // ----------------------------------------------------------------- internal TextMarkerProperties GetTextMarkerProperties(TextParagraphProperties textParaProps) { return new TextSimpleMarkerProperties(_style, _offset, _index, textParaProps); } // ------------------------------------------------------------------ // Marker style // ------------------------------------------------------------------ private TextMarkerStyle _style; // ----------------------------------------------------------------- // Distance from line start to the end of the marker symbol. // ------------------------------------------------------------------ private double _offset; // ----------------------------------------------------------------- // Autonumbering counter of counter-style marker. // ----------------------------------------------------------------- private int _index; } } // 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
- EndpointDispatcherTable.cs
- SoapAttributes.cs
- PerformanceCounterPermissionEntry.cs
- ExpressionParser.cs
- EntityDataSourceColumn.cs
- ObjectItemCachedAssemblyLoader.cs
- SymLanguageType.cs
- TransformCryptoHandle.cs
- ScalarConstant.cs
- PrimitiveXmlSerializers.cs
- StringSorter.cs
- FieldTemplateUserControl.cs
- QueueAccessMode.cs
- ConvertTextFrag.cs
- DataGridView.cs
- WebPartCancelEventArgs.cs
- CommonProperties.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- TdsRecordBufferSetter.cs
- DateTimeValueSerializer.cs
- Rotation3DAnimation.cs
- PolicyImporterElement.cs
- SecurityTokenSerializer.cs
- DBCSCodePageEncoding.cs
- SafeFindHandle.cs
- SqlGatherProducedAliases.cs
- _DisconnectOverlappedAsyncResult.cs
- CommonXSendMessage.cs
- ListDesigner.cs
- WorkflowViewManager.cs
- OleDbMetaDataFactory.cs
- Misc.cs
- ByteKeyFrameCollection.cs
- LinearKeyFrames.cs
- DataSourceControl.cs
- TableItemProviderWrapper.cs
- StructuralObject.cs
- XPathQilFactory.cs
- SessionParameter.cs
- HttpServerUtilityWrapper.cs
- GetUserPreferenceRequest.cs
- BuildProviderAppliesToAttribute.cs
- EventData.cs
- GB18030Encoding.cs
- AttributeQuery.cs
- LogReservationCollection.cs
- AuthenticationException.cs
- DirtyTextRange.cs
- TokenCreationParameter.cs
- SQLInt32.cs
- CryptoConfig.cs
- safemediahandle.cs
- TabPageDesigner.cs
- SqlOuterApplyReducer.cs
- TypeListConverter.cs
- SecurityKeyIdentifierClause.cs
- HtmlTernaryTree.cs
- ListItemCollection.cs
- PrePrepareMethodAttribute.cs
- WebPartConnectionsCancelEventArgs.cs
- Dictionary.cs
- ReferencedAssembly.cs
- WebSysDisplayNameAttribute.cs
- FileNotFoundException.cs
- QuotedPrintableStream.cs
- LinqDataSourceValidationException.cs
- DeclarativeCatalogPartDesigner.cs
- RadioButton.cs
- ObjectQueryProvider.cs
- PrintDocument.cs
- EdmSchemaAttribute.cs
- ColorPalette.cs
- StringInfo.cs
- ClientTargetSection.cs
- ReferencedAssembly.cs
- basevalidator.cs
- TypeElementCollection.cs
- AttributeCollection.cs
- Debugger.cs
- SystemWebExtensionsSectionGroup.cs
- DependencyPropertyConverter.cs
- WorkflowMarkupElementEventArgs.cs
- DataGridSortCommandEventArgs.cs
- ListSortDescription.cs
- ExternalCalls.cs
- DeclarativeConditionsCollection.cs
- ClipboardProcessor.cs
- ReplyChannel.cs
- DataGridViewCellCollection.cs
- RootProfilePropertySettingsCollection.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- ToolStripRendererSwitcher.cs
- SqlNodeAnnotations.cs
- RowToFieldTransformer.cs
- WebPartDisplayModeCancelEventArgs.cs
- PanelStyle.cs
- AssemblyAttributesGoHere.cs
- HttpConfigurationSystem.cs
- AxHost.cs
- FtpWebRequest.cs