Hi Telerik,
With the latest libraries of RichTextBox, there is exception triggered at DocumentPosition.Dispose.
No exception is with Q2 2012, but it is with latest Q3 2012.
As for the Q3 2012, the performance of input and deletion is improved a lot.
Does the changes made for performance improvement lead to this error?
Could you help to check this issue? Thanks.
In addition, the problem can be reproduced with the latest libs.
(PS. Silverlight version: 5.0, Telerik: 2012.3.1017.1050)
Best,
Tuo
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The exception is as follows:
Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at Telerik.Windows.Documents.DocumentPosition.Dispose()
at Telerik.Windows.Documents.DocumentPosition.Finalize()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Since the sample project cannot be attached(zip file), some functions have been pasted here for your reference.
The repeat steps: 1. Type some text(may use left hand keep typing), 2, click mouse left button(may use right hand click mouse), 3. Repeat 1 & 2 very fast, then after couple of times, exception raised as above.
Xaml file
-------------------------------------------------------------------
<UserControl x:Class="MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadRichTextBox Grid.Row="1" x:Name="editor" Margin="24 24 0 0" AllowDrop="True" Drop="editor_Drop" ShowComments="True" />
<telerik:DocumentRuler AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}" Grid.Row="1"/>
<telerik:RadRichTextBoxStatusBar x:Name="statusbar" Grid.Row="2" AssociatedRichTextBox="{Binding ElementName=editor}"/>
</Grid>
</UserControl>
Code behind file:(Just list the major functions)
---------------------------------------------------------------------------------------------------------
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.editor.MouseLeftButtonUp += OnMouseLeftButtonUp;
SetupDocument(this.editor.Document);
}
private void OnMouseLeftButtonUp(Object sender, RoutedEventArgs e)
{
RadDocument doc = new RadDocument();
doc.MeasureAndArrangeInDefaultSize ();
SetupDocument(doc);
this.editor.Document = doc;
}
private void SetupDocument(RadDocument document)
{
document.LayoutMode = DocumentLayoutMode.Paged;
document.ParagraphDefaultSpacingAfter = 10;
document.PageViewMargin = new SizeF(10, 10);
document.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(95);
}
}
With the latest libraries of RichTextBox, there is exception triggered at DocumentPosition.Dispose.
No exception is with Q2 2012, but it is with latest Q3 2012.
As for the Q3 2012, the performance of input and deletion is improved a lot.
Does the changes made for performance improvement lead to this error?
Could you help to check this issue? Thanks.
In addition, the problem can be reproduced with the latest libs.
(PS. Silverlight version: 5.0, Telerik: 2012.3.1017.1050)
Best,
Tuo
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The exception is as follows:
Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at Telerik.Windows.Documents.DocumentPosition.Dispose()
at Telerik.Windows.Documents.DocumentPosition.Finalize()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Since the sample project cannot be attached(zip file), some functions have been pasted here for your reference.
The repeat steps: 1. Type some text(may use left hand keep typing), 2, click mouse left button(may use right hand click mouse), 3. Repeat 1 & 2 very fast, then after couple of times, exception raised as above.
Xaml file
-------------------------------------------------------------------
<UserControl x:Class="MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadRichTextBox Grid.Row="1" x:Name="editor" Margin="24 24 0 0" AllowDrop="True" Drop="editor_Drop" ShowComments="True" />
<telerik:DocumentRuler AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}" Grid.Row="1"/>
<telerik:RadRichTextBoxStatusBar x:Name="statusbar" Grid.Row="2" AssociatedRichTextBox="{Binding ElementName=editor}"/>
</Grid>
</UserControl>
Code behind file:(Just list the major functions)
---------------------------------------------------------------------------------------------------------
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.editor.MouseLeftButtonUp += OnMouseLeftButtonUp;
SetupDocument(this.editor.Document);
}
private void OnMouseLeftButtonUp(Object sender, RoutedEventArgs e)
{
RadDocument doc = new RadDocument();
doc.MeasureAndArrangeInDefaultSize ();
SetupDocument(doc);
this.editor.Document = doc;
}
private void SetupDocument(RadDocument document)
{
document.LayoutMode = DocumentLayoutMode.Paged;
document.ParagraphDefaultSpacingAfter = 10;
document.PageViewMargin = new SizeF(10, 10);
document.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(95);
}
}