diff --git a/Business/App.cs b/Business/App.cs index 4b2438e..f941a1d 100644 --- a/Business/App.cs +++ b/Business/App.cs @@ -18,9 +18,6 @@ namespace SystemTrayMenu private readonly AppNotifyIcon menuNotifyIcon = new AppNotifyIcon(); private readonly Menus menus = new Menus(); - /// - /// Initializes a new instance of the class. - /// public App() { AppRestart.BeforeRestarting += Dispose; @@ -39,7 +36,6 @@ namespace SystemTrayMenu menus.MainPreload(); } - /// public void Dispose() { SystemEvents.DisplaySettingsChanged -= AppRestart.ByDisplaySettings; diff --git a/Business/KeyboardInput.cs b/Business/KeyboardInput.cs index 214015d..2b8dbb8 100644 --- a/Business/KeyboardInput.cs +++ b/Business/KeyboardInput.cs @@ -41,7 +41,6 @@ namespace SystemTrayMenu.Handler internal bool InUse { get; set; } - /// public void Dispose() { hook.Dispose(); diff --git a/Business/Menus.cs b/Business/Menus.cs index 8249593..bb69dbd 100644 --- a/Business/Menus.cs +++ b/Business/Menus.cs @@ -281,7 +281,6 @@ namespace SystemTrayMenu.Business private List AsList => AsEnumerable.ToList(); - /// public void Dispose() { workerMainMenu.Dispose(); diff --git a/Business/WaitLeave.cs b/Business/WaitLeave.cs index c4b28d8..1adda8c 100644 --- a/Business/WaitLeave.cs +++ b/Business/WaitLeave.cs @@ -20,7 +20,6 @@ namespace SystemTrayMenu.Handler public event EventHandlerEmpty LeaveTriggered; - /// public void Dispose() { timerLeaveCheck.Dispose(); diff --git a/Business/WaitToLoadMenu.cs b/Business/WaitToLoadMenu.cs index dd7855d..c57af9d 100644 --- a/Business/WaitToLoadMenu.cs +++ b/Business/WaitToLoadMenu.cs @@ -39,7 +39,6 @@ namespace SystemTrayMenu.Handler internal bool MouseActive { get; set; } - /// public void Dispose() { timerStartLoad.Stop(); diff --git a/DataClasses/RowData.cs b/DataClasses/RowData.cs index da2c7d2..5d0baa9 100644 --- a/DataClasses/RowData.cs +++ b/DataClasses/RowData.cs @@ -13,9 +13,6 @@ namespace SystemTrayMenu.DataClasses using SystemTrayMenu.Utilities; using Menu = SystemTrayMenu.UserInterface.Menu; - /// - /// Contains data of row. - /// internal class RowData { private static readonly Icon White50PercentageIcon = Properties.Resources.White50Percentage; @@ -26,97 +23,43 @@ namespace SystemTrayMenu.DataClasses private string text; private Icon icon; - /// - /// Initializes a new instance of the class. - /// internal RowData() { } - /// - /// Gets or sets fileInfo. - /// internal FileInfo FileInfo { get; set; } - /// - /// Gets or sets SubMenu. - /// internal Menu SubMenu { get; set; } - /// - /// Gets or sets a value indicating whether IsMenuOpen. - /// internal bool IsMenuOpen { get; set; } - /// - /// Gets or sets a value indicating whether IsSelected. - /// internal bool IsSelected { get; set; } - /// - /// Gets or sets a value indicating whether ContainsMenu. - /// internal bool ContainsMenu { get; set; } - /// - /// Gets or sets a value indicating whether IsContextMenuOpen. - /// internal bool IsContextMenuOpen { get; set; } - /// - /// Gets or sets a value indicating whether IsResolvedLnk. - /// internal bool IsResolvedLnk { get; set; } - /// - /// Gets or sets a value indicating whether is a HiddenEntry. - /// internal bool HiddenEntry { get; set; } - /// - /// Gets or sets TargetFilePath. - /// internal string TargetFilePath { get; set; } - /// - /// Gets or sets TargetFilePathOrig. - /// internal string TargetFilePathOrig { get; set; } - /// - /// Gets or sets RowIndex. - /// internal int RowIndex { get; set; } - /// - /// Gets or sets MenuLevel. - /// internal int MenuLevel { get; set; } - /// - /// Gets or sets a value indicating whether IconLoading. - /// internal bool IconLoading { get; set; } - /// - /// Gets or sets FilePathIcon. - /// internal string FilePathIcon { get; set; } - /// - /// Set text of row. - /// - /// text of row. internal void SetText(string text) { this.text = text; } - /// - /// SetData. - /// - /// data. - /// dataTable. internal void SetData(RowData data, DataTable dataTable) { DataRow row = dataTable.Rows.Add(); @@ -144,12 +87,6 @@ namespace SystemTrayMenu.DataClasses row[2] = data; } - /// - /// ReadIcon. - /// - /// isDirectory. - /// resolvedLnkPath. - /// isLnkDirectory. internal bool ReadIcon(bool isDirectory, ref string resolvedLnkPath) { bool isLnkDirectory = false; @@ -213,12 +150,6 @@ namespace SystemTrayMenu.DataClasses return isLnkDirectory; } - /// - /// MouseDown. - /// - /// dgv. - /// e. - /// toCloseByDoubleClick. internal void MouseDown(DataGridView dgv, MouseEventArgs e, out bool toCloseByDoubleClick) { toCloseByDoubleClick = false; @@ -260,11 +191,6 @@ namespace SystemTrayMenu.DataClasses } } - /// - /// DoubleClick. - /// - /// e. - /// toCloseByDoubleClick. internal void DoubleClick(MouseEventArgs e, out bool toCloseByDoubleClick) { toCloseByDoubleClick = false; @@ -283,10 +209,6 @@ namespace SystemTrayMenu.DataClasses } } - /// - /// ReadLoadedIcon. - /// - /// Icon. internal Icon ReadLoadedIcon() { if (ContainsMenu) diff --git a/GlobalSuppressions.cs b/GlobalSuppressions.cs index 0eec1b3..835ffc9 100644 --- a/GlobalSuppressions.cs +++ b/GlobalSuppressions.cs @@ -5,4 +5,9 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA0001:XML comment analysis is disabled due to project configuration", Justification = "no idea what this is")] + +[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "we need to document")] +[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601:Partial elements should be documented", Justification = "we need to document")] +[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1602:Enumeration items should be documented", Justification = "we need to document")] + [assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Standard codecleanup removes the this")] diff --git a/Helpers/DgvMouseRow.cs b/Helpers/DgvMouseRow.cs index eaeee29..f7f3041 100644 --- a/Helpers/DgvMouseRow.cs +++ b/Helpers/DgvMouseRow.cs @@ -28,7 +28,6 @@ namespace SystemTrayMenu.Helper internal event Action RowMouseLeave; - /// public void Dispose() { Dispose(true); diff --git a/Helpers/Fading.cs b/Helpers/Fading.cs index 94e4101..6a81580 100644 --- a/Helpers/Fading.cs +++ b/Helpers/Fading.cs @@ -51,7 +51,6 @@ namespace SystemTrayMenu.UserInterface internal bool IsHiding => state == FadingState.Hide; - /// public void Dispose() { Dispose(true); diff --git a/Helpers/KeyboardHook.cs b/Helpers/KeyboardHook.cs index 1495d8f..2325a98 100644 --- a/Helpers/KeyboardHook.cs +++ b/Helpers/KeyboardHook.cs @@ -41,7 +41,6 @@ namespace SystemTrayMenu.Helper /// internal event EventHandler KeyPressed; - /// public void Dispose() { // unregister all the registered hot keys. diff --git a/Helpers/WindowsExplorerSort.cs b/Helpers/WindowsExplorerSort.cs index 6efc66f..d340eca 100644 --- a/Helpers/WindowsExplorerSort.cs +++ b/Helpers/WindowsExplorerSort.cs @@ -8,7 +8,6 @@ namespace SystemTrayMenu.Helper internal class WindowsExplorerSort : IComparer { - /// public int Compare(string x, string y) { return DllImports.NativeMethods.ShlwapiStrCmpLogicalW(x, y); diff --git a/Properties/CustomSettingsProvider.cs b/Properties/CustomSettingsProvider.cs index 513f309..2d22e18 100644 --- a/Properties/CustomSettingsProvider.cs +++ b/Properties/CustomSettingsProvider.cs @@ -222,6 +222,31 @@ namespace SystemTrayMenu.Properties return isconfigPathAssembly; } + private static XDocument LoadOrGetNew(string path) + { + XDocument xDocument = null; + try + { + xDocument = XDocument.Load(path); + } + catch (Exception exceptionWarning) + { + Log.Warn($"Could not load {path}", exceptionWarning); + try + { + File.Delete(path); + CreateEmptyConfigIfNotExists(path); + xDocument = XDocument.Load(path); + } + catch (Exception exceptionError) + { + Log.Error($"Could not delete and create {path}", exceptionError); + } + } + + return xDocument; + } + /// /// Loads the values of the file into memory. /// @@ -260,31 +285,6 @@ namespace SystemTrayMenu.Properties } } - private XDocument LoadOrGetNew(string path) - { - XDocument xDocument = null; - try - { - xDocument = XDocument.Load(path); - } - catch (Exception exceptionWarning) - { - Log.Warn($"Could not load {path}", exceptionWarning); - try - { - File.Delete(path); - CreateEmptyConfigIfNotExists(path); - xDocument = XDocument.Load(path); - } - catch (Exception exceptionError) - { - Log.Error($"Could not delete and create {path}", exceptionError); - } - } - - return xDocument; - } - /// /// Saves the in memory dictionary to the user config file. /// diff --git a/UserInterface/AppNotifyIcon.cs b/UserInterface/AppNotifyIcon.cs index 3b5ebee..d2e19c8 100644 --- a/UserInterface/AppNotifyIcon.cs +++ b/UserInterface/AppNotifyIcon.cs @@ -80,7 +80,6 @@ namespace SystemTrayMenu.UserInterface public event EventHandlerEmpty Exit; - /// public void Dispose() { notifyIcon.Icon = null; diff --git a/UserInterface/CustomScrollbar/CustomScrollbar.cs b/UserInterface/CustomScrollbar/CustomScrollbar.cs index 919e25e..ac315f8 100644 --- a/UserInterface/CustomScrollbar/CustomScrollbar.cs +++ b/UserInterface/CustomScrollbar/CustomScrollbar.cs @@ -141,7 +141,6 @@ namespace SystemTrayMenu.UserInterface public int Delta => Value - lastValue; - /// public override bool AutoSize { get => base.AutoSize; @@ -208,14 +207,12 @@ namespace SystemTrayMenu.UserInterface Invalidate(); } - /// protected override void Dispose(bool disposing) { timerMouseStillClicked.Dispose(); base.Dispose(disposing); } - /// protected override void OnPaint(PaintEventArgs e) { e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; diff --git a/UserInterface/CustomScrollbar/ScrollbarControlDesigner.cs b/UserInterface/CustomScrollbar/ScrollbarControlDesigner.cs index 695a559..92c996b 100644 --- a/UserInterface/CustomScrollbar/ScrollbarControlDesigner.cs +++ b/UserInterface/CustomScrollbar/ScrollbarControlDesigner.cs @@ -9,7 +9,6 @@ namespace SystemTrayMenu.UserInterface internal class ScrollbarControlDesigner : ControlDesigner { - /// public override SelectionRules SelectionRules { get diff --git a/UserInterface/FolderBrowseDialog/FolderDialog.cs b/UserInterface/FolderBrowseDialog/FolderDialog.cs index 0c83f6c..1c71c1a 100644 --- a/UserInterface/FolderBrowseDialog/FolderDialog.cs +++ b/UserInterface/FolderBrowseDialog/FolderDialog.cs @@ -30,13 +30,11 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog /// public string Folder { get; set; } - /// public DialogResult ShowDialog() { return ShowDialog(owner: new WindowWrapper(IntPtr.Zero)); } - /// public DialogResult ShowDialog(IWin32Window owner) { if (Environment.OSVersion.Version.Major >= 6) @@ -49,7 +47,6 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog } } - /// public DialogResult ShowVistaDialog(IWin32Window owner) { NativeMethods.IFileDialog frm = (NativeMethods.IFileDialog)new NativeMethods.FileOpenDialogRCW(); @@ -113,7 +110,6 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog return DialogResult.Cancel; } - /// public DialogResult ShowLegacyDialog(IWin32Window owner) { using SaveFileDialog frm = new SaveFileDialog @@ -143,7 +139,6 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog } } - /// public void Dispose() { Dispose(true); diff --git a/UserInterface/FolderBrowseDialog/WindowWrapper.cs b/UserInterface/FolderBrowseDialog/WindowWrapper.cs index 1995d7e..0dc34cd 100644 --- a/UserInterface/FolderBrowseDialog/WindowWrapper.cs +++ b/UserInterface/FolderBrowseDialog/WindowWrapper.cs @@ -6,9 +6,6 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog { using System; - /// - /// WindowWrapper. - /// public class WindowWrapper : System.Windows.Forms.IWin32Window { /// diff --git a/UserInterface/HotkeyTextboxControl/HotkeyControl.cs b/UserInterface/HotkeyTextboxControl/HotkeyControl.cs index c8f6e7e..6caeb2a 100644 --- a/UserInterface/HotkeyTextboxControl/HotkeyControl.cs +++ b/UserInterface/HotkeyTextboxControl/HotkeyControl.cs @@ -485,7 +485,6 @@ namespace SystemTrayMenu.UserInterface.HotkeyTextboxControl Redraw(true); } - /// public override string ToString() { return HotkeyToString(HotkeyModifiers, Hotkey); diff --git a/UserInterface/LabelNoCopy.cs b/UserInterface/LabelNoCopy.cs index c80e347..526dbaf 100644 --- a/UserInterface/LabelNoCopy.cs +++ b/UserInterface/LabelNoCopy.cs @@ -21,7 +21,6 @@ namespace SystemTrayMenu.UserInterface { private string text; - /// public override string Text { get => text; diff --git a/UserInterface/Menu.cs b/UserInterface/Menu.cs index 050df6a..12a1af8 100644 --- a/UserInterface/Menu.cs +++ b/UserInterface/Menu.cs @@ -193,7 +193,6 @@ namespace SystemTrayMenu.UserInterface internal bool IsUsable => Visible && !fading.IsHiding && !IsDisposed && !Disposing; - /// protected override CreateParams CreateParams { get @@ -483,7 +482,6 @@ namespace SystemTrayMenu.UserInterface labelFilesCount.Text = filesCount.ToString(); } - /// protected override bool ProcessCmdKey(ref Message msg, Keys keys) { switch (keys) diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index 877241e..0568b3e 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -18,9 +18,6 @@ namespace SystemTrayMenu.UserInterface using Windows.ApplicationModel; using static SystemTrayMenu.UserInterface.HotkeyTextboxControl.HotkeyControl; - /// - /// SettingsForm. - /// public partial class SettingsForm : Form { private const string MenuName = @"Software\Classes\directory\shell\SystemTrayMenu_SetAsRootFolder"; @@ -30,9 +27,6 @@ namespace SystemTrayMenu.UserInterface private readonly ColorConverter colorConverter = new ColorConverter(); private bool inHotkey; - /// - /// Initializes a new instance of the class. - /// public SettingsForm() { InitializeComponent(); @@ -381,7 +375,6 @@ namespace SystemTrayMenu.UserInterface return RegisterHotkeys(false); } - /// protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) diff --git a/Utilities/File/FileIni.cs b/Utilities/File/FileIni.cs index 0c7d4f5..a8167de 100644 --- a/Utilities/File/FileIni.cs +++ b/Utilities/File/FileIni.cs @@ -8,17 +8,10 @@ namespace SystemTrayMenu.Utilities using System.IO; using System.Linq; - /// - /// Read *.ini files. - /// public class FileIni { private readonly Dictionary values; - /// - /// Initializes a new instance of the class. - /// - /// path of *.ini file. public FileIni(string path) { values = File.ReadLines(path) @@ -29,12 +22,6 @@ namespace SystemTrayMenu.Utilities parts.Length > 1 ? parts[1].Trim() : null); } - /// - /// Get value of line in *.ini file. - /// - /// attribute name of line. - /// default value. - /// value of attribute name of line. public string Value(string name, string value = null) { if (values != null && values.ContainsKey(name))