Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/umaranis/MindMate
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Sep 8, 2023
2 parents a5f577a + 166adcb commit fb56dab
Show file tree
Hide file tree
Showing 115 changed files with 467 additions and 1,432 deletions.
24 changes: 9 additions & 15 deletions MindMate.Win7/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* This software is licensed under MIT (see LICENSE.txt)
*/

using System;
using System.Windows.Forms;
using MindMate.Plugins;
using MindMate.View.NoteEditing;
using MindMate.Controller;
using MindMate.Plugins;
using MindMate.View;
using MindMate.View.EditorTabs;
using MindMate.View.NoteEditing;
using System;
using System.Windows.Forms;

namespace MindMate.Win7
{
Expand Down Expand Up @@ -45,17 +45,14 @@ public MainForm(MainCtrl mainCtrl)
private Control focusedControl;
public Control FocusedControl
{
get
{
return focusedControl;
}
get => focusedControl;

set
{
if (focusedControl != value)
{
var oldvalue = focusedControl;
focusedControl = value;
focusedControl = value;
FocusedControlChanged?.Invoke(value, oldvalue);
}
}
Expand Down Expand Up @@ -100,13 +97,10 @@ private void SplitContainer1_GotFocus(object sender, EventArgs e)
public SideTabControl SideBarTabs { get; private set; }
public NoteEditor NoteEditor { get; private set; }

public View.StatusBar StatusBar { get { return this.statusStrip1; } }
public View.StatusBar StatusBar => this.statusStrip1;

public bool IsNoteEditorActive => ActiveControl == splitContainer1 && splitContainer1.ActiveControl == NoteEditor;

public bool IsNoteEditorActive
{
get { return ActiveControl == splitContainer1 && splitContainer1.ActiveControl == NoteEditor; }
}

private void SetupSideBar()
{
SideBarTabs = new SideTabControl();
Expand Down
37 changes: 8 additions & 29 deletions MindMate.Win7/View/Ribbon/GalleryIconPropertySet.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Diagnostics;
using MindMate.MetaModel;
using MindMate.MetaModel;
using RibbonLib.Interop;
using System.Diagnostics;

namespace MindMate.View.Ribbon
{
Expand All @@ -16,41 +16,20 @@ public GalleryIconPropertySet(ModelIcon icon, RibbonLib.Ribbon ribbon)
private uint? categoryId;
private IUIImage itemImage;

public string Label
{
get
{
return icon.Title;
}
}
public string Label => icon.Title;

public string Name
{
get { return icon.Name; }
}
public string Name => icon.Name;

public uint CategoryID
{
get
{
return categoryId.GetValueOrDefault(Constants.UI_Collection_InvalidIndex);
}
set
{
categoryId = value;
}
get => categoryId.GetValueOrDefault(Constants.UI_Collection_InvalidIndex);
set => categoryId = value;
}

public IUIImage ItemImage
{
get
{
return itemImage;
}
set
{
itemImage = value;
}
get => itemImage;
set => itemImage = value;
}

#region IUISimplePropertySet Members
Expand Down
32 changes: 7 additions & 25 deletions MindMate.Win7/View/Ribbon/GalleryNodeStylePropertySet.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Diagnostics;
using MindMate.MetaModel;
using MindMate.MetaModel;
using RibbonLib.Interop;
using System.Diagnostics;

namespace MindMate.View.Ribbon
{
Expand All @@ -16,36 +16,18 @@ public GalleryNodeStylePropertySet(NodeStyle style, RibbonLib.Ribbon ribbon)
private uint? categoryId;
private IUIImage itemImage;

public NodeStyle NodeStyle
{
get
{
return style;
}
}
public NodeStyle NodeStyle => style;

public uint CategoryID
{
get
{
return categoryId.GetValueOrDefault(Constants.UI_Collection_InvalidIndex);
}
set
{
categoryId = value;
}
get => categoryId.GetValueOrDefault(Constants.UI_Collection_InvalidIndex);
set => categoryId = value;
}

public IUIImage ItemImage
{
get
{
return itemImage;
}
set
{
itemImage = value;
}
get => itemImage;
set => itemImage = value;
}

#region IUISimplePropertySet Members
Expand Down
18 changes: 9 additions & 9 deletions MindMate.Win7/View/Ribbon/Ribbon.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using MindMate.Model;
using MindMate.MetaModel;
using MindMate.Model;
using MindMate.Plugins;
using MindMate.View.EditorTabs;
using MindMate.Win7.Properties;
using RibbonLib;
using RibbonLib.Controls.Events;
using RibbonLib.Interop;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using RibbonLib.Interop;
using System.Drawing;
using System.Drawing.Drawing2D;
using MindMate.MetaModel;
using MindMate.Plugins;
using MindMate.View.EditorTabs;
using MindMate.Win7.Properties;
using RibbonLib;
using System.Windows.Forms;

namespace MindMate.View.Ribbon
{
Expand Down Expand Up @@ -840,7 +840,7 @@ private void MoveDown_ExecuteEvent(object sender, ExecuteEventArgs e)
private const string AscendingOrderString = "Ascending Order";
private const string DescendingOrderString = "Descending Order";

private bool IsAscendingSortOrder { get { return SortOrder.Label == AscendingOrderString || SortOrder.Label == null; }}
private bool IsAscendingSortOrder => SortOrder.Label == AscendingOrderString || SortOrder.Label == null;

private void SortAlphabetic_ExecuteEvent(object sender, ExecuteEventArgs e)
{
Expand Down
24 changes: 9 additions & 15 deletions MindMate.WinXP/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* This software is licensed under MIT (see LICENSE.txt)
*/

using System;
using System.Windows.Forms;
using MindMate.Plugins;
using MindMate.View.NoteEditing;
using MindMate.View;
using MindMate.View.EditorTabs;
using MindMate.View.NoteEditing;
using System;
using System.Windows.Forms;

namespace MindMate.WinXP
{
Expand All @@ -35,17 +35,14 @@ public MainForm()
private Control focusedControl;
public Control FocusedControl
{
get
{
return focusedControl;
}
get => focusedControl;

set
{
if (focusedControl != value)
{
var oldvalue = focusedControl;
focusedControl = value;
focusedControl = value;
FocusedControlChanged?.Invoke(value, oldvalue);
}
}
Expand Down Expand Up @@ -83,20 +80,17 @@ private void SplitContainer1_GotFocus(object sender, EventArgs e)

#endregion

public MainMenu MainMenu { get { return menuStrip; } }
public MainMenu MainMenu => menuStrip;
public MainMenuCtrl MainMenuCtrl { get; set; }

public EditorTabs EditorTabs { get; private set; }
public SideTabControl SideBarTabs { get; private set; }
public NoteEditor NoteEditor { get; private set; }

public View.StatusBar StatusBar { get { return this.statusStrip1; } }
public View.StatusBar StatusBar => this.statusStrip1;

public bool IsNoteEditorActive => ActiveControl == splitContainer1 && splitContainer1.ActiveControl == NoteEditor;

public bool IsNoteEditorActive
{
get { return ActiveControl == splitContainer1 && splitContainer1.ActiveControl == NoteEditor; }
}

private void SetupSideBar()
{
SideBarTabs = new SideTabControl();
Expand Down
10 changes: 3 additions & 7 deletions MindMate.WinXP/MainMenuCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
* This software is licensed under MIT (see LICENSE.txt)
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MindMate.View;
using System.Windows.Forms;
using MindMate.Controller;
using MindMate.Plugins;
using System;
using System.Windows.Forms;

namespace MindMate.WinXP
{
Expand All @@ -21,7 +17,7 @@ namespace MindMate.WinXP
public class MainMenuCtrl
{
public MainMenu mainMenu;
public MapCtrl mapCtrl { get { return mainCtrl.CurrentMapCtrl; } }
public MapCtrl mapCtrl => mainCtrl.CurrentMapCtrl;
private readonly MainCtrl mainCtrl;

public MainMenuCtrl(MainMenu mainMenu, MainCtrl mainCtrl)
Expand Down
2 changes: 1 addition & 1 deletion MindMate/Controller/ContextMenuCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace MindMate.Controller
/// </summary>
public class ContextMenuCtrl
{
private MapCtrl CurrentMapCtrl { get { return mainCtrl.CurrentMapCtrl; } }
private MapCtrl CurrentMapCtrl => mainCtrl.CurrentMapCtrl;

private readonly MainCtrl mainCtrl;

Expand Down
18 changes: 3 additions & 15 deletions MindMate/Controller/MainCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,12 @@ public MapCtrl CurrentMapCtrl
}
}

public ChangeManager ChangeManager { get { return CurrentMapCtrl.MapView.Tree.ChangeManager; } }
public ChangeManager ChangeManager => CurrentMapCtrl.MapView.Tree.ChangeManager;

public WinFormsStatusBarCtrl statusBarCtrl;

private NoteEditorCtrl noteCrtl;
public NoteEditorCtrl NoteCrtl
{
get
{
return noteCrtl;
}
}
public NoteEditorCtrl NoteCrtl => noteCrtl;


public NodeContextMenu NodeContextMenu { get; private set; }
Expand Down Expand Up @@ -443,13 +437,7 @@ public void ClearSelectionFormatting()
/// <summary>
/// Selected Nodes of the currently active MapView
/// </summary>
public SelectedNodes ActiveNodes
{
get
{
return CurrentMapCtrl.MapView.Tree.SelectedNodes;
}
}
public SelectedNodes ActiveNodes => CurrentMapCtrl.MapView.Tree.SelectedNodes;

public void StartNoteEditing()
{
Expand Down
4 changes: 2 additions & 2 deletions MindMate/Controller/MapCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class MapCtrl
public MapView MapView;

public ContextMenuCtrl ContextMenuCtrl { get; private set; }
private MapTree tree { get { return MapView.Tree; } }

private MapTree tree => MapView.Tree;

public MapCtrl(MapView mapView, DialogManager dialogs, NodeContextMenu nodeContextMenu)
{
Expand Down
7 changes: 1 addition & 6 deletions MindMate/Controller/MapViewKeyEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
* This software is licensed under MIT (see LICENSE.txt)
*/

using MindMate.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MindMate.View.MapControls;
using System.Windows.Forms;

namespace MindMate.Controller
{
Expand Down
7 changes: 1 addition & 6 deletions MindMate/Controller/MapViewMouseEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
* This software is licensed under MIT (see LICENSE.txt)
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MindMate.Serialization;
using MindMate.Model;
using MindMate.View.MapControls;
using System.Windows.Forms;

namespace MindMate.Controller
{
Expand Down
5 changes: 0 additions & 5 deletions MindMate/Controller/NoteEditorCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
using MindMate.View.Dialogs;
using MindMate.View.NoteEditing;
using mshtml;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MindMate.Controller
{
Expand Down
8 changes: 3 additions & 5 deletions MindMate/Controller/SearchController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using MindMate.Model;
using MindMate.View.Search;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MindMate.Model;
using MindMate.View.Search;

namespace MindMate.Controller
{
Expand Down
Loading

0 comments on commit fb56dab

Please sign in to comment.