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
- MemoryRecordBuffer.cs
- RegexWriter.cs
- DecryptedHeader.cs
- AttachedPropertyBrowsableAttribute.cs
- SplitContainer.cs
- WS2007FederationHttpBindingElement.cs
- StringStorage.cs
- UriTemplateVariablePathSegment.cs
- NativeMethods.cs
- PropertyPathWorker.cs
- EdmToObjectNamespaceMap.cs
- InlineObject.cs
- PlatformCulture.cs
- DataGridHelper.cs
- CharEnumerator.cs
- SmiEventSink_DeferedProcessing.cs
- Site.cs
- Misc.cs
- BrushProxy.cs
- HttpGetServerProtocol.cs
- SqlDataSource.cs
- Point3DConverter.cs
- Debug.cs
- DependencyObject.cs
- DateTimeUtil.cs
- ObjectParameter.cs
- autovalidator.cs
- IpcClientChannel.cs
- SimpleHandlerBuildProvider.cs
- PassportPrincipal.cs
- BitmapDownload.cs
- CustomErrorCollection.cs
- DataContractSerializerOperationGenerator.cs
- PropertyMetadata.cs
- ControlPaint.cs
- PerformanceCounterTraceRecord.cs
- X509Certificate2.cs
- XslTransform.cs
- CmsUtils.cs
- SQLDoubleStorage.cs
- KerberosReceiverSecurityToken.cs
- JapaneseLunisolarCalendar.cs
- MetafileEditor.cs
- JapaneseLunisolarCalendar.cs
- GacUtil.cs
- MulticastNotSupportedException.cs
- Wildcard.cs
- PhysicalOps.cs
- PropertyPathWorker.cs
- LinkLabel.cs
- ToolStripGrip.cs
- SelectionRange.cs
- RootBuilder.cs
- mansign.cs
- DictionaryGlobals.cs
- PageVisual.cs
- RegisteredScript.cs
- XmlNamedNodeMap.cs
- RadioButtonList.cs
- CDSsyncETWBCLProvider.cs
- FamilyCollection.cs
- RowUpdatingEventArgs.cs
- ByteStorage.cs
- DateTimePicker.cs
- WebPartTracker.cs
- TextRunCacheImp.cs
- MatrixValueSerializer.cs
- DefaultValueConverter.cs
- SubMenuStyleCollection.cs
- Operand.cs
- ResolvedKeyFrameEntry.cs
- DelegateHelpers.Generated.cs
- DBAsyncResult.cs
- CqlLexerHelpers.cs
- Expression.DebuggerProxy.cs
- MemberCollection.cs
- NavigationPropertySingletonExpression.cs
- ValidationErrorCollection.cs
- X509CertificateChain.cs
- TagPrefixAttribute.cs
- WebBrowserContainer.cs
- CultureInfoConverter.cs
- SectionUpdates.cs
- DataGridViewCellStyle.cs
- CngUIPolicy.cs
- Thickness.cs
- tibetanshape.cs
- FrameworkTemplate.cs
- AppearanceEditorPart.cs
- TreeBuilderXamlTranslator.cs
- XmlEntity.cs
- AttributeSetAction.cs
- SoapExtensionTypeElementCollection.cs
- SchemaImporter.cs
- MemoryFailPoint.cs
- HttpProcessUtility.cs
- MaskInputRejectedEventArgs.cs
- Nullable.cs
- PeerTransportSecurityElement.cs
- QuadraticBezierSegment.cs