Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Documents / TextEditorLists.cs / 1 / TextEditorLists.cs
//---------------------------------------------------------------------------- // // File: TextEditorLists.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: A Component of TextEditor supporting list editing commands. // //--------------------------------------------------------------------------- namespace System.Windows.Documents { using MS.Internal; using System.Globalization; using System.Threading; using System.ComponentModel; using System.Text; using System.Collections; // ArrayList using System.Runtime.InteropServices; using System.Windows.Threading; using System.Windows.Input; using System.Windows.Controls; // ScrollChangedEventArgs using System.Windows.Controls.Primitives; // CharacterCasing, TextBoxBase using System.Windows.Media; using System.Windows.Markup; using MS.Utility; using MS.Win32; using MS.Internal.Documents; using MS.Internal.Commands; // CommandHelpers ////// Text editing service for controls. /// internal static class TextEditorLists { //----------------------------------------------------- // // Class Internal Methods // //----------------------------------------------------- #region Class Internal Methods // Registers all text editing command handlers for a given control type internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners) { CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.RemoveListMarkers , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyRemoveListMarkers, SRID.KeyRemoveListMarkersDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.ToggleBullets , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyToggleBullets, SRID.KeyToggleBulletsDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.ToggleNumbering , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyToggleNumbering, SRID.KeyToggleNumberingDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.IncreaseIndentation , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusTab), SRID.KeyIncreaseIndentation, SRID.KeyIncreaseIndentationDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.DecreaseIndentation , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusTab), SRID.KeyDecreaseIndentation, SRID.KeyDecreaseIndentationDisplayString); } // Decreases the indent level of the Block at selection start. internal static void DecreaseIndentation(TextEditor This) { TextSelection thisSelection = (TextSelection)This.Selection; ListItem parentListItem = TextPointerBase.GetListItem(thisSelection.Start); ListItem immediateListItem = TextPointerBase.GetImmediateListItem(thisSelection.Start); DecreaseIndentation(thisSelection, parentListItem, immediateListItem); } #endregion Class Internal Methods //------------------------------------------------------ // // Class Internal Properties // //----------------------------------------------------- //------------------------------------------------------ // // Private Methods // //------------------------------------------------------ #region Private Methods private static TextEditor IsEnabledNotReadOnlyIsTextSegment(object sender) { TextEditor This = TextEditor._GetTextEditor(sender); if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) { return This; } return null; } ////// Increase/DcreaseIndentation command QueryStatus handler /// private static void OnQueryStatusTab(object sender, CanExecuteRoutedEventArgs args) { TextEditor This = IsEnabledNotReadOnlyIsTextSegment(sender); if (This != null && This.AcceptsTab) { // args.CanExecute= true; } } ////// StartInputCorrection command QueryStatus handler /// private static void OnQueryStatusNYI(object target, CanExecuteRoutedEventArgs args) { TextEditor This = TextEditor._GetTextEditor(target); if (This == null) { return; } args.CanExecute = true; } // Common handler for all list editing commands private static void OnListCommand(object target, ExecutedRoutedEventArgs args) { TextEditor This = TextEditor._GetTextEditor(target); if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) { return; } TextEditorTyping._FlushPendingInputItems(This); if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) { return; } using (This.Selection.DeclareChangeBlock()) { TextSelection thisSelection = (TextSelection)This.Selection; ListItem parentListItem = TextPointerBase.GetListItem(thisSelection.Start); ListItem immediateListItem = TextPointerBase.GetImmediateListItem(thisSelection.Start); List list = parentListItem == null ? null : (List)parentListItem.Parent; // Forget previously suggested horizontal position TextEditorSelection._ClearSuggestedX(This); // Execute the command if (args.Command == EditingCommands.ToggleBullets) { ToggleBullets(thisSelection, parentListItem, immediateListItem, list); } else if (args.Command == EditingCommands.ToggleNumbering) { ToggleNumbering(thisSelection, parentListItem, immediateListItem, list); } else if (args.Command == EditingCommands.RemoveListMarkers) { TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else if (args.Command == EditingCommands.IncreaseIndentation) { IncreaseIndentation(thisSelection, parentListItem, immediateListItem); } else if (args.Command == EditingCommands.DecreaseIndentation) { DecreaseIndentation(thisSelection, parentListItem, immediateListItem); } else { Invariant.Assert(false); } } } private static void ToggleBullets(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem, List list) { if (immediateListItem != null && HasBulletMarker(list)) { if (list.Parent is ListItem) { TextRangeEditLists.UnindentListItems(thisSelection); TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else { TextRangeEditLists.UnindentListItems(thisSelection); } } else if (immediateListItem != null) { list.MarkerStyle = TextMarkerStyle.Disc; } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.IndentListItems(thisSelection); } else { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); } } private static void ToggleNumbering(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem, List list) { if (immediateListItem != null && HasNumericMarker(list)) { if (list.Parent is ListItem) { TextRangeEditLists.UnindentListItems(thisSelection); TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else { TextRangeEditLists.UnindentListItems(thisSelection); } } else if (immediateListItem != null) { list.MarkerStyle = TextMarkerStyle.Decimal; } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); TextRangeEditLists.IndentListItems(thisSelection); } else { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); } } private static void IncreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.IndentListItems(thisSelection); } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); TextRangeEditLists.IndentListItems(thisSelection); } else { if (thisSelection.IsEmpty) { // When selection is empty, handle indentation based on current TextIndent property of the paragraph. Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { // Increment BlockUIContainer's leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } else { // Create implicit paragraph if at a potential paragraph position, such as empty FlowDocument, TableCell. CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); if (paragraph.TextIndent < 0) { // Reset text indent to 0. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); } else if (paragraph.TextIndent < 20) { // Reset text indent to 20. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); } else { // Increment paragraph leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } } } else { // For non-empty selection, always increment paragraph margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } } } private static void DecreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.UnindentListItems(thisSelection); } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.UnindentListItems(thisSelection); } else { if (thisSelection.IsEmpty) { // When selection is empty, handle indentation based on current TextIndent property of the paragraph. Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { // Decrement BlockUIContainer's leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } else { // Create implicit paragraph if at a potential paragraph position, such as empty FlowDocument, TableCell. CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); // When selection is empty, handle indentation based on current TextIndent property of the paragraph. if (paragraph.TextIndent > 20) { // Reset text indent to 20. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); } else if (paragraph.TextIndent > 0) { // Reset text indent to 0. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); } else { // Decrement paragraph leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } } } else { // For non-empty selection, always decrement paragraph margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } } } private static void CreateImplicitParagraphIfNeededAndUpdateSelection(TextSelection thisSelection) { // Create implicit paragraph if we are at a potential paragraph position, such as empty FlowDocument, TableCell. TextPointer position = thisSelection.Start; if (TextPointerBase.IsAtPotentialParagraphPosition(position)) { position = TextRangeEditTables.EnsureInsertionPosition(position); thisSelection.Select(position, position); } } private static bool HasBulletMarker(List list) { if (list == null) { return false; } TextMarkerStyle markerStyle = list.MarkerStyle; return TextMarkerStyle.Disc <= markerStyle && markerStyle <= TextMarkerStyle.Box; } private static bool HasNumericMarker(List list) { if (list == null) { return false; } TextMarkerStyle markerStyle = list.MarkerStyle; return TextMarkerStyle.LowerRoman <= markerStyle && markerStyle <= TextMarkerStyle.Decimal; } #endregion Private methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: TextEditorLists.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: A Component of TextEditor supporting list editing commands. // //--------------------------------------------------------------------------- namespace System.Windows.Documents { using MS.Internal; using System.Globalization; using System.Threading; using System.ComponentModel; using System.Text; using System.Collections; // ArrayList using System.Runtime.InteropServices; using System.Windows.Threading; using System.Windows.Input; using System.Windows.Controls; // ScrollChangedEventArgs using System.Windows.Controls.Primitives; // CharacterCasing, TextBoxBase using System.Windows.Media; using System.Windows.Markup; using MS.Utility; using MS.Win32; using MS.Internal.Documents; using MS.Internal.Commands; // CommandHelpers ////// Text editing service for controls. /// internal static class TextEditorLists { //----------------------------------------------------- // // Class Internal Methods // //----------------------------------------------------- #region Class Internal Methods // Registers all text editing command handlers for a given control type internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners) { CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.RemoveListMarkers , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyRemoveListMarkers, SRID.KeyRemoveListMarkersDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.ToggleBullets , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyToggleBullets, SRID.KeyToggleBulletsDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.ToggleNumbering , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusNYI), SRID.KeyToggleNumbering, SRID.KeyToggleNumberingDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.IncreaseIndentation , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusTab), SRID.KeyIncreaseIndentation, SRID.KeyIncreaseIndentationDisplayString); CommandHelpers.RegisterCommandHandler(controlType, EditingCommands.DecreaseIndentation , new ExecutedRoutedEventHandler(OnListCommand) , new CanExecuteRoutedEventHandler(OnQueryStatusTab), SRID.KeyDecreaseIndentation, SRID.KeyDecreaseIndentationDisplayString); } // Decreases the indent level of the Block at selection start. internal static void DecreaseIndentation(TextEditor This) { TextSelection thisSelection = (TextSelection)This.Selection; ListItem parentListItem = TextPointerBase.GetListItem(thisSelection.Start); ListItem immediateListItem = TextPointerBase.GetImmediateListItem(thisSelection.Start); DecreaseIndentation(thisSelection, parentListItem, immediateListItem); } #endregion Class Internal Methods //------------------------------------------------------ // // Class Internal Properties // //----------------------------------------------------- //------------------------------------------------------ // // Private Methods // //------------------------------------------------------ #region Private Methods private static TextEditor IsEnabledNotReadOnlyIsTextSegment(object sender) { TextEditor This = TextEditor._GetTextEditor(sender); if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) { return This; } return null; } ////// Increase/DcreaseIndentation command QueryStatus handler /// private static void OnQueryStatusTab(object sender, CanExecuteRoutedEventArgs args) { TextEditor This = IsEnabledNotReadOnlyIsTextSegment(sender); if (This != null && This.AcceptsTab) { // args.CanExecute= true; } } ////// StartInputCorrection command QueryStatus handler /// private static void OnQueryStatusNYI(object target, CanExecuteRoutedEventArgs args) { TextEditor This = TextEditor._GetTextEditor(target); if (This == null) { return; } args.CanExecute = true; } // Common handler for all list editing commands private static void OnListCommand(object target, ExecutedRoutedEventArgs args) { TextEditor This = TextEditor._GetTextEditor(target); if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) { return; } TextEditorTyping._FlushPendingInputItems(This); if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) { return; } using (This.Selection.DeclareChangeBlock()) { TextSelection thisSelection = (TextSelection)This.Selection; ListItem parentListItem = TextPointerBase.GetListItem(thisSelection.Start); ListItem immediateListItem = TextPointerBase.GetImmediateListItem(thisSelection.Start); List list = parentListItem == null ? null : (List)parentListItem.Parent; // Forget previously suggested horizontal position TextEditorSelection._ClearSuggestedX(This); // Execute the command if (args.Command == EditingCommands.ToggleBullets) { ToggleBullets(thisSelection, parentListItem, immediateListItem, list); } else if (args.Command == EditingCommands.ToggleNumbering) { ToggleNumbering(thisSelection, parentListItem, immediateListItem, list); } else if (args.Command == EditingCommands.RemoveListMarkers) { TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else if (args.Command == EditingCommands.IncreaseIndentation) { IncreaseIndentation(thisSelection, parentListItem, immediateListItem); } else if (args.Command == EditingCommands.DecreaseIndentation) { DecreaseIndentation(thisSelection, parentListItem, immediateListItem); } else { Invariant.Assert(false); } } } private static void ToggleBullets(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem, List list) { if (immediateListItem != null && HasBulletMarker(list)) { if (list.Parent is ListItem) { TextRangeEditLists.UnindentListItems(thisSelection); TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else { TextRangeEditLists.UnindentListItems(thisSelection); } } else if (immediateListItem != null) { list.MarkerStyle = TextMarkerStyle.Disc; } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.IndentListItems(thisSelection); } else { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); } } private static void ToggleNumbering(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem, List list) { if (immediateListItem != null && HasNumericMarker(list)) { if (list.Parent is ListItem) { TextRangeEditLists.UnindentListItems(thisSelection); TextRangeEditLists.ConvertListItemsToParagraphs(thisSelection); } else { TextRangeEditLists.UnindentListItems(thisSelection); } } else if (immediateListItem != null) { list.MarkerStyle = TextMarkerStyle.Decimal; } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); TextRangeEditLists.IndentListItems(thisSelection); } else { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); } } private static void IncreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.IndentListItems(thisSelection); } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Decimal); TextRangeEditLists.IndentListItems(thisSelection); } else { if (thisSelection.IsEmpty) { // When selection is empty, handle indentation based on current TextIndent property of the paragraph. Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { // Increment BlockUIContainer's leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } else { // Create implicit paragraph if at a potential paragraph position, such as empty FlowDocument, TableCell. CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); if (paragraph.TextIndent < 0) { // Reset text indent to 0. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); } else if (paragraph.TextIndent < 20) { // Reset text indent to 20. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); } else { // Increment paragraph leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } } } else { // For non-empty selection, always increment paragraph margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.IncreaseByAbsoluteValue); } } } private static void DecreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.UnindentListItems(thisSelection); } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.UnindentListItems(thisSelection); } else { if (thisSelection.IsEmpty) { // When selection is empty, handle indentation based on current TextIndent property of the paragraph. Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { // Decrement BlockUIContainer's leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } else { // Create implicit paragraph if at a potential paragraph position, such as empty FlowDocument, TableCell. CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); // When selection is empty, handle indentation based on current TextIndent property of the paragraph. if (paragraph.TextIndent > 20) { // Reset text indent to 20. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); } else if (paragraph.TextIndent > 0) { // Reset text indent to 0. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); } else { // Decrement paragraph leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } } } else { // For non-empty selection, always decrement paragraph margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/20, PropertyValueAction.DecreaseByAbsoluteValue); } } } private static void CreateImplicitParagraphIfNeededAndUpdateSelection(TextSelection thisSelection) { // Create implicit paragraph if we are at a potential paragraph position, such as empty FlowDocument, TableCell. TextPointer position = thisSelection.Start; if (TextPointerBase.IsAtPotentialParagraphPosition(position)) { position = TextRangeEditTables.EnsureInsertionPosition(position); thisSelection.Select(position, position); } } private static bool HasBulletMarker(List list) { if (list == null) { return false; } TextMarkerStyle markerStyle = list.MarkerStyle; return TextMarkerStyle.Disc <= markerStyle && markerStyle <= TextMarkerStyle.Box; } private static bool HasNumericMarker(List list) { if (list == null) { return false; } TextMarkerStyle markerStyle = list.MarkerStyle; return TextMarkerStyle.LowerRoman <= markerStyle && markerStyle <= TextMarkerStyle.Decimal; } #endregion Private methods } } // 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
- OleDbStruct.cs
- HttpHandlersSection.cs
- Mapping.cs
- SqlFunctionAttribute.cs
- InProcStateClientManager.cs
- ToolStripPanelRenderEventArgs.cs
- ArithmeticException.cs
- FormViewInsertEventArgs.cs
- Pair.cs
- GeometryDrawing.cs
- DropSource.cs
- MD5Cng.cs
- ScriptingJsonSerializationSection.cs
- Parser.cs
- BinarySerializer.cs
- SystemNetworkInterface.cs
- SafeUserTokenHandle.cs
- PointConverter.cs
- CacheEntry.cs
- WindowsAuthenticationEventArgs.cs
- ToolStripRenderEventArgs.cs
- odbcmetadatafactory.cs
- panel.cs
- WsatAdminException.cs
- WebPartDeleteVerb.cs
- DataGridItem.cs
- XsltFunctions.cs
- SessionParameter.cs
- PerformanceCounterLib.cs
- Timer.cs
- KeyPressEvent.cs
- Completion.cs
- KeyboardNavigation.cs
- TypeNameParser.cs
- DiscoveryInnerClientAdhoc11.cs
- IPGlobalProperties.cs
- Sql8ConformanceChecker.cs
- SubMenuStyleCollection.cs
- Permission.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- OutputCacheProviderCollection.cs
- LicenseContext.cs
- MediaTimeline.cs
- EntityCollection.cs
- CollectionViewProxy.cs
- ServiceDeploymentInfo.cs
- RecognizeCompletedEventArgs.cs
- DbParameterHelper.cs
- RuntimeIdentifierPropertyAttribute.cs
- ThreadNeutralSemaphore.cs
- BaseValidator.cs
- ComponentChangedEvent.cs
- Token.cs
- ChannelCacheSettings.cs
- FormViewDeletedEventArgs.cs
- SymmetricKeyWrap.cs
- WebPartVerb.cs
- MD5CryptoServiceProvider.cs
- BufferedGraphicsContext.cs
- RightsManagementPermission.cs
- TemplateControlCodeDomTreeGenerator.cs
- SequentialActivityDesigner.cs
- ThreadExceptionEvent.cs
- DefaultEvaluationContext.cs
- NumericExpr.cs
- PrimitiveSchema.cs
- QueryConverter.cs
- XmlQualifiedNameTest.cs
- SharingService.cs
- ActivityXRefConverter.cs
- PeerInputChannelListener.cs
- Vector3DCollection.cs
- RealizationDrawingContextWalker.cs
- CompilerScopeManager.cs
- RtfControls.cs
- MessageHeaderAttribute.cs
- GradientBrush.cs
- UnhandledExceptionEventArgs.cs
- DSACryptoServiceProvider.cs
- SafeWaitHandle.cs
- CodeConditionStatement.cs
- NativeRecognizer.cs
- MobileControlBuilder.cs
- HybridDictionary.cs
- MobileControlBuilder.cs
- SchemaMerger.cs
- WebReferencesBuildProvider.cs
- FontSourceCollection.cs
- sapiproxy.cs
- OutputCacheSettingsSection.cs
- DataAdapter.cs
- DesignerView.xaml.cs
- TdsParserSafeHandles.cs
- METAHEADER.cs
- PatternMatcher.cs
- ViewKeyConstraint.cs
- WebPartEditorApplyVerb.cs
- DbDataSourceEnumerator.cs
- WebPartUserCapability.cs
- TextEffect.cs