Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / textformatting / TextSimpleMarkerProperties.cs / 1305600 / TextSimpleMarkerProperties.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: TextSimpleMarkerProperties.cs // // Contents: Generic implementation of text marker properties // // Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- using System; using System.Collections; using System.Windows; using MS.Internal.TextFormatting; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.TextFormatting { ////// Generic implementation of text marker properties /// public class TextSimpleMarkerProperties : TextMarkerProperties { private double _offset; private TextSource _textSource; ////// Construct a text marker object /// /// marker style /// distance from line start to the end of the marker symbol /// autonumbering counter of counter-style marker /// text paragraph properties public TextSimpleMarkerProperties( TextMarkerStyle style, double offset, int autoNumberingIndex, TextParagraphProperties textParagraphProperties ) { if (textParagraphProperties == null) throw new ArgumentNullException("textParagraphProperties"); _offset = offset; if (style != TextMarkerStyle.None) { if (TextMarkerSource.IsKnownSymbolMarkerStyle(style)) { // autoNumberingIndex is ignored } else if (TextMarkerSource.IsKnownIndexMarkerStyle(style)) { // validate autoNumberingIndex if (autoNumberingIndex < 1) { throw new ArgumentOutOfRangeException("autoNumberingIndex", SR.Get(SRID.ParameterCannotBeLessThan, 1)); } } else { // invalid style throw new ArgumentException(SR.Get(SRID.Enum_Invalid, typeof(TextMarkerStyle)), "style"); } _textSource = new TextMarkerSource( textParagraphProperties, style, autoNumberingIndex ); } } ////// Distance from line start to the end of the marker symbol /// public sealed override double Offset { get { return _offset; } } ////// Source of text runs used for text marker /// public sealed override TextSource TextSource { get { return _textSource; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: TextSimpleMarkerProperties.cs // // Contents: Generic implementation of text marker properties // // Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- using System; using System.Collections; using System.Windows; using MS.Internal.TextFormatting; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.TextFormatting { ////// Generic implementation of text marker properties /// public class TextSimpleMarkerProperties : TextMarkerProperties { private double _offset; private TextSource _textSource; ////// Construct a text marker object /// /// marker style /// distance from line start to the end of the marker symbol /// autonumbering counter of counter-style marker /// text paragraph properties public TextSimpleMarkerProperties( TextMarkerStyle style, double offset, int autoNumberingIndex, TextParagraphProperties textParagraphProperties ) { if (textParagraphProperties == null) throw new ArgumentNullException("textParagraphProperties"); _offset = offset; if (style != TextMarkerStyle.None) { if (TextMarkerSource.IsKnownSymbolMarkerStyle(style)) { // autoNumberingIndex is ignored } else if (TextMarkerSource.IsKnownIndexMarkerStyle(style)) { // validate autoNumberingIndex if (autoNumberingIndex < 1) { throw new ArgumentOutOfRangeException("autoNumberingIndex", SR.Get(SRID.ParameterCannotBeLessThan, 1)); } } else { // invalid style throw new ArgumentException(SR.Get(SRID.Enum_Invalid, typeof(TextMarkerStyle)), "style"); } _textSource = new TextMarkerSource( textParagraphProperties, style, autoNumberingIndex ); } } ////// Distance from line start to the end of the marker symbol /// public sealed override double Offset { get { return _offset; } } ////// Source of text runs used for text marker /// public sealed override TextSource TextSource { get { return _textSource; } } } } // 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
- VectorValueSerializer.cs
- DrawingContextDrawingContextWalker.cs
- SHA384.cs
- TypeInfo.cs
- SecurityTokenAttachmentMode.cs
- ExpressionEvaluator.cs
- IOException.cs
- Model3D.cs
- RuntimeHandles.cs
- Function.cs
- SemaphoreSlim.cs
- Membership.cs
- NavigationHelper.cs
- LogLogRecordEnumerator.cs
- SharedDp.cs
- HostProtectionPermission.cs
- ClientData.cs
- SingleAnimationUsingKeyFrames.cs
- EventEntry.cs
- TemplateControl.cs
- StateChangeEvent.cs
- XPathMultyIterator.cs
- SupportsEventValidationAttribute.cs
- RegexWorker.cs
- HttpBufferlessInputStream.cs
- DataGridItem.cs
- PreviewControlDesigner.cs
- Image.cs
- HtmlForm.cs
- ThrowHelper.cs
- QuaternionRotation3D.cs
- XmlUtil.cs
- CoreSwitches.cs
- XmlDocumentSerializer.cs
- RemoteCryptoSignHashRequest.cs
- UIElement.cs
- DetailsViewDeleteEventArgs.cs
- DropSource.cs
- RoleBoolean.cs
- FactoryRecord.cs
- NodeFunctions.cs
- Popup.cs
- ClientReliableChannelBinder.cs
- BooleanKeyFrameCollection.cs
- SelectionItemProviderWrapper.cs
- ParserStreamGeometryContext.cs
- SortedDictionary.cs
- ImportFileRequest.cs
- WorkflowMarkupSerializationProvider.cs
- TextTreeTextBlock.cs
- COMException.cs
- HyperLinkColumn.cs
- RoleGroup.cs
- DataServiceHostFactory.cs
- SystemUdpStatistics.cs
- BatchStream.cs
- AttachmentCollection.cs
- SplitContainer.cs
- BufferModesCollection.cs
- SerializationException.cs
- WorkflowViewService.cs
- KeyValuePair.cs
- Util.cs
- Accessors.cs
- Parameter.cs
- ClosableStream.cs
- AcceleratedTokenProviderState.cs
- ControlBindingsCollection.cs
- SyndicationItem.cs
- AmbientProperties.cs
- XmlMemberMapping.cs
- ContextCorrelationInitializer.cs
- WindowsListViewItem.cs
- HttpInputStream.cs
- MetaModel.cs
- EnumDataContract.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- EntityDataSourceMemberPath.cs
- DisplayInformation.cs
- DrawTreeNodeEventArgs.cs
- Marshal.cs
- CollectionEditor.cs
- XsltLoader.cs
- DrawingGroup.cs
- SelectionRange.cs
- MostlySingletonList.cs
- DbBuffer.cs
- DesignerRegionCollection.cs
- AsnEncodedData.cs
- XamlTypeMapper.cs
- SequentialOutput.cs
- RedistVersionInfo.cs
- SymmetricAlgorithm.cs
- SchemaTableColumn.cs
- ExtensionQuery.cs
- Ipv6Element.cs
- TreeView.cs
- PageTrueTypeFont.cs
- FeatureSupport.cs
- XmlSchemaGroup.cs