Skip to content

Commit

Permalink
Added documentation and modernized coding style.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Feb 6, 2020
1 parent 5692f4a commit ef9a672
Show file tree
Hide file tree
Showing 20 changed files with 349 additions and 326 deletions.
17 changes: 17 additions & 0 deletions source/Components/AvalonDock/Layout/AnchorableShowStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,30 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines a bitwise flag to indicate a preferred anchoring location of a new <see cref="LayoutAnchorable"/> child entry into a corresponding <see cref="AnchorSide"/>.</summary>
[Flags]
public enum AnchorableShowStrategy : byte
{
Most = 0x0001,

/// <summary>
/// This value is equivalent to <see cref="AnchorSide.Left"/>.
/// </summary>
Left = 0x0002,

/// <summary>
/// This value is equivalent to <see cref="AnchorSide.Right"/>.
/// </summary>
Right = 0x0004,

/// <summary>
/// This value is equivalent to <see cref="AnchorSide.Top"/>.
/// </summary>
Top = 0x0010,

/// <summary>
/// This value is equivalent to <see cref="AnchorSide.Bottom"/>.
/// </summary>
Bottom = 0x0020,
}
}
23 changes: 13 additions & 10 deletions source/Components/AvalonDock/Layout/ChildrenTreeChangedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,32 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>
/// Defines a way for communicating a type of change if the tree of
/// has been changed due to an insert/remove operation.
/// </summary>
public enum ChildrenTreeChange
{
/// <summary>
/// Direct insert/remove operation has been perfomed to the group
/// </summary>
/// <summary>Direct insert/remove operation has been perfomed to the group</summary>
DirectChildrenChanged,

/// <summary>
/// An element below in the hierarchy as been added/removed
/// </summary>
/// <summary>An element below in the hierarchy as been added/removed</summary>
TreeChanged
}

/// <summary>
/// Defines an event to communicating a type of change if the tree of
/// has been changed due to an insert/remove operation.
/// </summary>
public class ChildrenTreeChangedEventArgs : EventArgs
{
/// <summary>Class constructor</summary>
public ChildrenTreeChangedEventArgs(ChildrenTreeChange change)
{
Change = change;
}

public ChildrenTreeChange Change
{
get; private set;
}
/// <summary>Gets the type of <see cref="ChildrenTreeChange"/> for this event.</summary>
public ChildrenTreeChange Change { get; private set; }
}
}
2 changes: 2 additions & 0 deletions source/Components/AvalonDock/Layout/ILayoutAnchorablePane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines an interface for that identifies a <see cref="LayoutAnchorablePane"/>
/// or an equivalent class (<see cref="LayoutAnchorablePaneGroup"/>, <see cref="LayoutAnchorablePaneGroupControl"/> etc.)</summary>
public interface ILayoutAnchorablePane : ILayoutPanelElement, ILayoutPane
{
}
Expand Down
5 changes: 5 additions & 0 deletions source/Components/AvalonDock/Layout/ILayoutContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines an interface that is implemented by a layout model that can contain other <see cref="LayoutElement"/>s (<see cref="LayoutGroup{T}"/>, <see cref="LayoutPane"/> etc).</summary>
public interface ILayoutContainer : ILayoutElement
{
#region Properties

/// <summary>Gets all children elements of this layout container.</summary>
IEnumerable<ILayoutElement> Children
{
get;
}

/// <summary>Gets the number of children of this layout container.</summary>
int ChildrenCount
{
get;
Expand All @@ -29,8 +32,10 @@ int ChildrenCount

#region Methods

/// <summary>Removes a particular child element from this layout container.</summary>
void RemoveChild(ILayoutElement element);

/// <summary>Replaces a particular child element with a new element in this layout container.</summary>
void ReplaceChild(ILayoutElement oldElement, ILayoutElement newElement);

#endregion Methods
Expand Down
2 changes: 2 additions & 0 deletions source/Components/AvalonDock/Layout/ILayoutControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines a control class that hosts a <see cref="ILayoutElement"/> as its model</summary>
public interface ILayoutControl
{
/// <summary>Gets the <see cref="ILayoutElement"/> model for this control.</summary>
ILayoutElement Model
{
get;
Expand Down
2 changes: 2 additions & 0 deletions source/Components/AvalonDock/Layout/ILayoutDocumentPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines an interface for that identifies a <see cref="LayoutDocumentPane"/>
/// or an equivalent class (<see cref="LayoutDocumentPaneGroup"/>, <see cref="LayoutDocumentPaneGroupControl"/> etc.)</summary>
public interface ILayoutDocumentPane : ILayoutPanelElement, ILayoutPane
{
}
Expand Down
7 changes: 7 additions & 0 deletions source/Components/AvalonDock/Layout/ILayoutElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>This interface should be implemented by a classe that supports
/// - Manipulation of the children of a given parent <see cref="LayoutContainer"/> or
/// - Manipulation of the children of the <see cref="LayoutRoot"/>.
/// </summary>
public interface ILayoutElement : INotifyPropertyChanged, INotifyPropertyChanging
{
/// <summary>Gets the parent <see cref="LayoutContainer"/> for this layout element.</summary>
ILayoutContainer Parent
{
get;
}

/// <summary>Gets the <see cref="LayoutRoot"/> for this layout element.</summary>
ILayoutRoot Root
{
get;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
/// </summary>
public static class ILayoutElementForFloatingWindowExtension
{
// RECT structure required by WINDOWPLACEMENT structure
/// <summary>
/// RECT structure required by WINDOWPLACEMENT structure
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal struct RECT
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Interface definition for a layout element that can update its visibility (IsVisible) property.</summary>
public interface ILayoutElementWithVisibility
{
/// <summary>Invoke this to update the visibility (IsVisible) property of this layout element.</summary>
void ComputeVisibility();
}
}
20 changes: 18 additions & 2 deletions source/Components/AvalonDock/Layout/ILayoutGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,29 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Interface definition for a group of layout elements that can act as a container.</summary>
public interface ILayoutGroup : ILayoutContainer
{
/// <summary>Notifies subscribers when the collection of children has changed.</summary>
event EventHandler ChildrenCollectionChanged;

/// <summary>Gets The zero-based index of the item within the children collection, if found; otherwise, -1.</summary>
/// <param name="element">The element whos index should be returned.</param>
/// <returns>The zero based index of the child or -1.</returns>
int IndexOfChild(ILayoutElement element);

/// <summary>Inserts a new child element at the zero based index position as indicated by the parameters.</summary>
/// <param name="index">The index position for inserting the new element.</param>
/// <param name="element">The element to be inserted.</param>
void InsertChildAt(int index, ILayoutElement element);

/// <summary>Removes a child element at the zero based index position.</summary>
/// <param name="index">The index position of the element to be removed.</param>
void RemoveChildAt(int index);
void ReplaceChildAt(int index, ILayoutElement element);

event EventHandler ChildrenCollectionChanged;
/// <summary>Replaces a child element with a new instance at the indicated zero based index position.</summary>
/// <param name="index">The index position of the element to be replaced.</param>
/// <param name="element">The new element to be replaced over an existing element.</param>
void ReplaceChildAt(int index, ILayoutElement element);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Interface definition for a <see cref="ILayoutGroup"/> that supports a <see cref="System.Windows.Controls.Orientation"/> property.</summary>
public interface ILayoutOrientableGroup : ILayoutGroup
{
Orientation Orientation
{
get; set;
}
/// <summary>Gets/sets the <see cref="System.Windows.Controls.Orientation"/> of the <see cref="ILayoutGroup"/>.</summary>
Orientation Orientation { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Interface definition for a layout pane that can be identified by a unique id.</summary>
interface ILayoutPaneSerializable
{
string Id
{
get; set;
}
/// <summary>Gets/sets the unique id for this layout pane.</summary>
string Id { get; set; }
}
}
7 changes: 3 additions & 4 deletions source/Components/AvalonDock/Layout/ILayoutPanelElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Interface definition for a <see cref="ILayoutElement"/> that supports a visibility property.</summary>
public interface ILayoutPanelElement : ILayoutElement
{
bool IsVisible
{
get;
}
/// <summary>Gets whether the <see cref="ILayoutElement"/> is currently visible or not.</summary>
bool IsVisible { get; }
}
}
113 changes: 46 additions & 67 deletions source/Components/AvalonDock/Layout/ILayoutPositionableElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,97 +11,76 @@ This program is provided to you under the terms of the Microsoft Public

namespace AvalonDock.Layout
{
/// <summary>Defines a layout element that can be positioned in a Grid like environment.</summary>
internal interface ILayoutPositionableElement : ILayoutElement, ILayoutElementForFloatingWindow
{
GridLength DockWidth
{
get;
set;
}
/// <summary>Gets/sets the <see cref="GridLength"/> of the dock width for this positionable layout element.</summary>
GridLength DockWidth { get; set; }

double FixedDockWidth { get; }
/// <summary>Gets/sets the <see cref="GridLength"/> of the dock height for this positionable layout element.</summary>
GridLength DockHeight { get; set; }

double ResizableAbsoluteDockWidth
{
get;
set;
}
/// <summary>Gets the current DockWidth value if the DockWidth is absolute and the DockWidth value is greater equal DockMinWidth
/// or the DockMinWidth, otherwise.</summary>
double FixedDockWidth { get; }

GridLength DockHeight
{
get;
set;
}
double ResizableAbsoluteDockWidth { get; set; }

/// <summary>Gets the current DockHeight value if the DockHeight is absolute and the DockHeight value is greater equal DockMinHeight
/// or the DockMinHeight, otherwise.</summary>
double FixedDockHeight { get; }

double ResizableAbsoluteDockHeight
{
get;
set;
}
double ResizableAbsoluteDockHeight { get; set; }

double CalculatedDockMinWidth();
/// <summary>Gets/sets the minimum width of the docked positionable element.</summary>
double DockMinWidth { get; set; }

double DockMinWidth
{
get; set;
}
/// <summary>Gets/sets the minimum height of the docked positionable element.</summary>
double DockMinHeight { get; set; }

double CalculatedDockMinHeight();
/// <summary>Gets/sets whether duplicated content is allowed or not.</summary>
bool AllowDuplicateContent { get; set; }

double DockMinHeight
{
get; set;
}
/// <summary>Gets whether the <see cref="ILayoutElement"/> is currently visible or not.</summary>
bool IsVisible { get; }

bool AllowDuplicateContent
{
get; set;
}
/// <summary>Computes the minimum dock with of this element including its childrens minimum dock witdh.</summary>
double CalculatedDockMinWidth();

bool IsVisible
{
get;
}
/// <summary>Computes the minimum dock with of this element including its childrens minimum dock witdh.</summary>
double CalculatedDockMinHeight();
}


/// <summary>Defines a layout element that supports actual width and height properties.</summary>
internal interface ILayoutPositionableElementWithActualSize : ILayoutPositionableElement
{
double ActualWidth
{
get; set;
}
double ActualHeight
{
get; set;
}
/// <summary>Gets/sets the actual width the positionable layout element.</summary>
double ActualWidth { get; set; }

/// <summary>Gets/sets the actual height the positionable layout element.</summary>
double ActualHeight { get; set; }
}

/// <summary>Defines a layout element that supports position properties for a floating window.</summary>
internal interface ILayoutElementForFloatingWindow
{
/// <summary>Invoke this method to raise the FloatingPropertiesUpdated event to inform subscribers of the change.</summary>
void RaiseFloatingPropertiesUpdated();

double FloatingWidth
{
get; set;
}
double FloatingHeight
{
get; set;
}
double FloatingLeft
{
get; set;
}
double FloatingTop
{
get; set;
}
bool IsMaximized
{
get; set;
}
/// <summary>Gets/sets the width of the floating window.</summary>
double FloatingWidth { get; set; }

/// <summary>Gets/sets the height of the floating window.</summary>
double FloatingHeight { get; set; }

/// <summary>Gets/sets the left position of the floating window.</summary>
double FloatingLeft { get; set; }

/// <summary>Gets/sets the top position of the floating window.</summary>
double FloatingTop { get; set; }

/// <summary>Gets/sets whether the floating window is maximized or not.</summary>
bool IsMaximized { get; set; }
}
}
Loading

0 comments on commit ef9a672

Please sign in to comment.