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 @@ -43,6 +43,9 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
/// <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
/// 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);
}
}

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

@ -31,8 +31,8 @@ namespace ICSharpCode.AvalonEdit.Document @@ -31,8 +31,8 @@ namespace ICSharpCode.AvalonEdit.Document
/// 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 usually
/// more efficient because it doesn't require creating a String object.</remarks>
/// <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; }
/// <summary>
@ -41,16 +41,16 @@ namespace ICSharpCode.AvalonEdit.Document @@ -41,16 +41,16 @@ namespace ICSharpCode.AvalonEdit.Document
/// <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 usually
/// more efficient because it doesn't require creating a String object.</remarks>
/// <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);
/// <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 usually
/// more efficient because it doesn't require creating a String object for the whole document.</remarks>
/// <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);
}

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

@ -41,6 +41,15 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -41,6 +41,15 @@ namespace ICSharpCode.SharpDevelop.Gui
{
dockingManager.Content = documentPane;
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)
@ -197,6 +206,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -197,6 +206,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public void LoadConfiguration()
{
if (!dockingManager.IsLoaded)
return;
try {
if (File.Exists(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 @@ -17,9 +17,27 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
/// </summary>
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; }
/// <summary>
/// Gets the total number of lines in the document.
/// </summary>
int TotalNumberOfLines { get; }
/// <summary>
/// Gets/Sets the whole text as string.
/// </summary>
string Text { get; set; }
/// <summary>
/// Is raised when the Text property changes.
/// </summary>
event EventHandler TextChanged;
/// <summary>
@ -40,7 +58,22 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring @@ -40,7 +58,22 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
void Remove(int offset, int length);
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);
/// <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);
/// <summary>
@ -66,10 +99,30 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring @@ -66,10 +99,30 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
/// </summary>
public interface IDocumentLine
{
/// <summary>
/// Gets the starting offset of the line in the document's text.
/// </summary>
int Offset { get; }
/// <summary>
/// Gets the length of this line (=the number of characters on the line).
/// </summary>
int Length { get; }
/// <summary>
/// Gets the length of this line, including the line delimiter.
/// </summary>
int TotalLength { get; }
/// <summary>
/// Gets the number of this line.
/// The first line has the number 1.
/// </summary>
int LineNumber { get; }
/// <summary>
/// Gets the text on this line.
/// </summary>
string Text { get; }
}
}

Loading…
Cancel
Save