Skip to content

Commit

Permalink
Use ReactiveGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Nov 29, 2024
1 parent 9b5a3a3 commit 5b49063
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 313 deletions.
22 changes: 12 additions & 10 deletions src/Dock.Model.ReactiveUI/Controls/DockDock.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
using System.Runtime.Serialization;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Docking panel dock.
/// </summary>
[DataContract(IsReference = true)]
public class DockDock : DockBase, IDockDock
{
private bool _lastChildFill = true;
public partial class DockDock : DockBase, IDockDock
{
/// <summary>
/// Initializes new instance of the <see cref="DockDock"/> class.
/// </summary>
public DockDock()
{
_lastChildFill = true;
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool LastChildFill
{
get => _lastChildFill;
set => this.RaiseAndSetIfChanged(ref _lastChildFill, value);
}
}
[Reactive]
public partial bool LastChildFill { get; set; }
}
4 changes: 2 additions & 2 deletions src/Dock.Model.ReactiveUI/Controls/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Document.
/// </summary>
[DataContract(IsReference = true)]
public class Document : DockableBase, IDocument
public partial class Document : DockableBase, IDocument
{
}
}
12 changes: 3 additions & 9 deletions src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@
using System.Windows.Input;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Document dock.
/// </summary>
[DataContract(IsReference = true)]
public class DocumentDock : DockBase, IDocumentDock
public partial class DocumentDock : DockBase, IDocumentDock
{
private bool _canCreateDocument;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool CanCreateDocument
{
get => _canCreateDocument;
set => this.RaiseAndSetIfChanged(ref _canCreateDocument, value);
}
[Reactive]
public partial bool CanCreateDocument { get; set; }

/// <inheritdoc/>
[IgnoreDataMember]
Expand Down
14 changes: 4 additions & 10 deletions src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Proportional dock.
/// </summary>
[DataContract(IsReference = true)]
public class ProportionalDock : DockBase, IProportionalDock
public partial class ProportionalDock : DockBase, IProportionalDock
{
private Orientation _orientation;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public Orientation Orientation
{
get => _orientation;
set => this.RaiseAndSetIfChanged(ref _orientation, value);
}
}
[Reactive]
public partial Orientation Orientation { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Proportional dock splitter.
/// </summary>
[DataContract(IsReference = true)]
public class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
public partial class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
{
}
}
76 changes: 20 additions & 56 deletions src/Dock.Model.ReactiveUI/Controls/RootDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,98 +12,62 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Root dock.
/// </summary>
[DataContract(IsReference = true)]
public class RootDock : DockBase, IRootDock
public partial class RootDock : DockBase, IRootDock
{
private bool _isFocusableRoot = true;
private IList<IDockable>? _hiddenDockables;
private IList<IDockable>? _leftPinnedDockables;
private IList<IDockable>? _rightPinnedDockables;
private IList<IDockable>? _topPinnedDockables;
private IList<IDockable>? _bottomPinnedDockables;
private IToolDock? _pinnedDock;
private IDockWindow? _window;
private IList<IDockWindow>? _windows;

/// <summary>
/// Initializes new instance of the <see cref="RootDock"/> class.
/// </summary>
public RootDock()
{
_isFocusableRoot = true;
ShowWindows = ReactiveCommand.Create(() => _navigateAdapter.ShowWindows());
ExitWindows = ReactiveCommand.Create(() => _navigateAdapter.ExitWindows());
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool IsFocusableRoot
{
get => _isFocusableRoot;
set => this.RaiseAndSetIfChanged(ref _isFocusableRoot, value);
}
[Reactive]
public partial bool IsFocusableRoot { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? HiddenDockables
{
get => _hiddenDockables;
set => this.RaiseAndSetIfChanged(ref _hiddenDockables, value);
}
[Reactive]
public partial IList<IDockable>? HiddenDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? LeftPinnedDockables
{
get => _leftPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _leftPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? LeftPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? RightPinnedDockables
{
get => _rightPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _rightPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? RightPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? TopPinnedDockables
{
get => _topPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _topPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? TopPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? BottomPinnedDockables
{
get => _bottomPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _bottomPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? BottomPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IToolDock? PinnedDock
{
get => _pinnedDock;
set => this.RaiseAndSetIfChanged(ref _pinnedDock, value);
}
[Reactive]
public partial IToolDock? PinnedDock { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IDockWindow? Window
{
get => _window;
set => this.RaiseAndSetIfChanged(ref _window, value);
}
[Reactive]
public partial IDockWindow? Window { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockWindow>? Windows
{
get => _windows;
set => this.RaiseAndSetIfChanged(ref _windows, value);
}
[Reactive]
public partial IList<IDockWindow>? Windows { get; set; }

/// <inheritdoc/>
[IgnoreDataMember]
Expand Down
4 changes: 2 additions & 2 deletions src/Dock.Model.ReactiveUI/Controls/Tool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Tool.
/// </summary>
[DataContract(IsReference = true)]
public class Tool : DockableBase, ITool, IDocument
public partial class Tool : DockableBase, ITool, IDocument
{
}
}
48 changes: 20 additions & 28 deletions src/Dock.Model.ReactiveUI/Controls/ToolDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,42 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Tool dock.
/// </summary>
[DataContract(IsReference = true)]
public class ToolDock : DockBase, IToolDock
public partial class ToolDock : DockBase, IToolDock
{
private Alignment _alignment = Alignment.Unset;
private bool _isExpanded;
private bool _autoHide = true;
private GripMode _gripMode = GripMode.Visible;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public Alignment Alignment
/// <summary>
/// Initializes new instance of the <see cref="ToolDock"/> class.
/// </summary>
public ToolDock()
{
get => _alignment;
set => this.RaiseAndSetIfChanged(ref _alignment, value);
_alignment = Alignment.Unset;
_autoHide = true;
_gripMode = GripMode.Visible;
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
[Reactive]
public partial Alignment Alignment { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool IsExpanded
{
get => _isExpanded;
set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
}
[Reactive]
public partial bool IsExpanded { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool AutoHide
{
get => _autoHide;
set => this.RaiseAndSetIfChanged(ref _autoHide, value);
}
[Reactive]
public partial bool AutoHide { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public GripMode GripMode
{
get => _gripMode;
set => this.RaiseAndSetIfChanged(ref _gripMode, value);
}
}
[Reactive]
public partial GripMode GripMode { get; set; }
}
Loading

0 comments on commit 5b49063

Please sign in to comment.