Browse Source

AvalonDockLayout: Fixed exception 'Unable to deserialize a docking layout while DockingManager control is unloaded'.

XML documentation improvements.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3968 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
0f98095978
  1. 3
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs
  2. 12
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextSource.cs
  3. 11
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs
  4. 53
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/IDocument.cs

3
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs

@ -43,6 +43,9 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
/// <param name="textArea">The text area on which completion is performed.</param> /// <param name="textArea">The text area on which completion is performed.</param>
/// <param name="completionSegment">The text segment that was used by the completion window if /// <param name="completionSegment">The text segment that was used by the completion window if
/// the user types.</param> /// the user types.</param>
/// <param name="insertionRequestEventArgs">The EventArgs used for the insertion request.
/// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how
/// the insertion was triggered.</param>
void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs); void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs);
} }
} }

12
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ITextSource.cs

@ -31,8 +31,8 @@ namespace ICSharpCode.AvalonEdit.Document
/// Gets the total text length. /// Gets the total text length.
/// </summary> /// </summary>
/// <returns>The length of the text, in characters.</returns> /// <returns>The length of the text, in characters.</returns>
/// <remarks>This is the same as Text.Length, but is usually /// <remarks>This is the same as Text.Length, but is more efficient because
/// more efficient because it doesn't require creating a String object.</remarks> /// it doesn't require creating a String object.</remarks>
int TextLength { get; } int TextLength { get; }
/// <summary> /// <summary>
@ -41,16 +41,16 @@ namespace ICSharpCode.AvalonEdit.Document
/// <paramref name="offset">The index of the character to get.</paramref> /// <paramref name="offset">The index of the character to get.</paramref>
/// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception> /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
/// <returns>The character at the specified position.</returns> /// <returns>The character at the specified position.</returns>
/// <remarks>This is the same as Text[offset], but is usually /// <remarks>This is the same as Text[offset], but is more efficient because
/// more efficient because it doesn't require creating a String object.</remarks> /// it doesn't require creating a String object.</remarks>
char GetCharAt(int offset); char GetCharAt(int offset);
/// <summary> /// <summary>
/// Retrieves the text for a portion of the document. /// Retrieves the text for a portion of the document.
/// </summary> /// </summary>
/// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception> /// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
/// <remarks>This is the same as Text.Substring, but is usually /// <remarks>This is the same as Text.Substring, but is more efficient because
/// more efficient because it doesn't require creating a String object for the whole document.</remarks> /// it doesn't require creating a String object for the whole document.</remarks>
string GetText(int offset, int length); string GetText(int offset, int length);
} }

11
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs

@ -41,6 +41,15 @@ namespace ICSharpCode.SharpDevelop.Gui
{ {
dockingManager.Content = documentPane; dockingManager.Content = documentPane;
dockingManager.PropertyChanged += dockingManager_PropertyChanged; dockingManager.PropertyChanged += dockingManager_PropertyChanged;
dockingManager.Loaded += dockingManager_Loaded;
}
void dockingManager_Loaded(object sender, RoutedEventArgs e)
{
// LoadConfiguration doesn't do anything until the docking manager is loaded,
// so we have to load the configuration now
LoggingService.Info("dockingManager_Loaded");
LoadConfiguration();
} }
void dockingManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) void dockingManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
@ -197,6 +206,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public void LoadConfiguration() public void LoadConfiguration()
{ {
if (!dockingManager.IsLoaded)
return;
try { try {
if (File.Exists(LayoutConfiguration.CurrentLayoutFileName)) { if (File.Exists(LayoutConfiguration.CurrentLayoutFileName)) {
dockingManager.RestoreLayout(LayoutConfiguration.CurrentLayoutFileName); dockingManager.RestoreLayout(LayoutConfiguration.CurrentLayoutFileName);

53
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/IDocument.cs

@ -17,9 +17,27 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
/// </summary> /// </summary>
public interface IDocument public interface IDocument
{ {
/// <summary>
/// Gets the total text length.
/// </summary>
/// <returns>The length of the text, in characters.</returns>
/// <remarks>This is the same as Text.Length, but is more efficient because
/// it doesn't require creating a String object.</remarks>
int TextLength { get; } int TextLength { get; }
/// <summary>
/// Gets the total number of lines in the document.
/// </summary>
int TotalNumberOfLines { get; } int TotalNumberOfLines { get; }
/// <summary>
/// Gets/Sets the whole text as string.
/// </summary>
string Text { get; set; } string Text { get; set; }
/// <summary>
/// Is raised when the Text property changes.
/// </summary>
event EventHandler TextChanged; event EventHandler TextChanged;
/// <summary> /// <summary>
@ -40,7 +58,22 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
void Remove(int offset, int length); void Remove(int offset, int length);
void Replace(int offset, int length, string newText); void Replace(int offset, int length, string newText);
/// <summary>
/// Gets a character at the specified position in the document.
/// </summary>
/// <paramref name="offset">The index of the character to get.</paramref>
/// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
/// <returns>The character at the specified position.</returns>
/// <remarks>This is the same as Text[offset], but is more efficient because
/// it doesn't require creating a String object.</remarks>
char GetCharAt(int offset); char GetCharAt(int offset);
/// <summary>
/// Retrieves the text for a portion of the document.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
/// <remarks>This is the same as Text.Substring, but is more efficient because
/// it doesn't require creating a String object for the whole document.</remarks>
string GetText(int offset, int length); string GetText(int offset, int length);
/// <summary> /// <summary>
@ -66,10 +99,30 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
/// </summary> /// </summary>
public interface IDocumentLine public interface IDocumentLine
{ {
/// <summary>
/// Gets the starting offset of the line in the document's text.
/// </summary>
int Offset { get; } int Offset { get; }
/// <summary>
/// Gets the length of this line (=the number of characters on the line).
/// </summary>
int Length { get; } int Length { get; }
/// <summary>
/// Gets the length of this line, including the line delimiter.
/// </summary>
int TotalLength { get; } int TotalLength { get; }
/// <summary>
/// Gets the number of this line.
/// The first line has the number 1.
/// </summary>
int LineNumber { get; } int LineNumber { get; }
/// <summary>
/// Gets the text on this line.
/// </summary>
string Text { get; } string Text { get; }
} }
} }

Loading…
Cancel
Save