Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / Text / MarkerProperties.cs / 1 / MarkerProperties.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: MarkerProperties.cs
//
// Description: Marker properties.
//
// History:
// 06/06/2003 : grzegorz - created.
// 07/18/2003 : grzegorz - 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 : grzegorz - created.
// 07/18/2003 : grzegorz - 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
- XmlRawWriterWrapper.cs
- DataGridViewColumnStateChangedEventArgs.cs
- CellQuery.cs
- XamlToRtfParser.cs
- ForeignKeyConstraint.cs
- Preprocessor.cs
- TdsParserStaticMethods.cs
- SqlIdentifier.cs
- AttributeProviderAttribute.cs
- ColumnCollection.cs
- DataTemplate.cs
- SynchronizingStream.cs
- PrintingPermissionAttribute.cs
- DbConnectionPoolGroupProviderInfo.cs
- ConfigurationSettings.cs
- AutomationInteropProvider.cs
- counter.cs
- CompilationUtil.cs
- BindingListCollectionView.cs
- MarginCollapsingState.cs
- HttpProfileBase.cs
- HostingEnvironmentSection.cs
- RuntimeCompatibilityAttribute.cs
- MetadataSerializer.cs
- WindowsFormsHost.cs
- StylusSystemGestureEventArgs.cs
- _Win32.cs
- ExpanderAutomationPeer.cs
- DataGridItem.cs
- SafeSerializationManager.cs
- SizeConverter.cs
- WSDualHttpBindingElement.cs
- ThreadStaticAttribute.cs
- ControlTemplate.cs
- MsmqIntegrationMessageProperty.cs
- ConfigXmlComment.cs
- CommandLibraryHelper.cs
- XmlKeywords.cs
- FontInfo.cs
- ExpressionLink.cs
- WebBodyFormatMessageProperty.cs
- PictureBox.cs
- ListBoxAutomationPeer.cs
- InvalidWMPVersionException.cs
- FusionWrap.cs
- TabControlEvent.cs
- XmlMemberMapping.cs
- PrePrepareMethodAttribute.cs
- ClientApiGenerator.cs
- Style.cs
- EntityRecordInfo.cs
- StrokeCollectionDefaultValueFactory.cs
- InnerItemCollectionView.cs
- InvalidTimeZoneException.cs
- DataServiceSaveChangesEventArgs.cs
- QueryComponents.cs
- HtmlInputText.cs
- SiteMapProvider.cs
- AssemblyCollection.cs
- DeflateStream.cs
- ResourceExpressionEditor.cs
- ApplicationContext.cs
- DllNotFoundException.cs
- CommandBinding.cs
- UrlAuthorizationModule.cs
- EasingFunctionBase.cs
- PersonalizationStateQuery.cs
- CommandHelper.cs
- ApplicationServiceHelper.cs
- RenderDataDrawingContext.cs
- NativeMethods.cs
- CodeSnippetTypeMember.cs
- WebPartPersonalization.cs
- HttpCacheVaryByContentEncodings.cs
- UserInitiatedNavigationPermission.cs
- BitmapPalette.cs
- XmlDataLoader.cs
- Hashtable.cs
- DataListItem.cs
- DebugManager.cs
- IssuanceLicense.cs
- Page.cs
- XmlSchemaAnyAttribute.cs
- DataGridBeginningEditEventArgs.cs
- HandlerMappingMemo.cs
- RequestDescription.cs
- MatrixAnimationUsingKeyFrames.cs
- ReadWriteObjectLock.cs
- Lease.cs
- ImageClickEventArgs.cs
- oledbmetadatacolumnnames.cs
- SpecialNameAttribute.cs
- ListViewUpdateEventArgs.cs
- FileDialogPermission.cs
- WindowsStatusBar.cs
- MetadataItemCollectionFactory.cs
- TextAction.cs
- SqlPersonalizationProvider.cs
- StatusBar.cs
- GACMembershipCondition.cs