Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality: Cleaned up Files.Backend #12631

Merged
merged 10 commits into from
Jun 20, 2023
10 changes: 5 additions & 5 deletions src/Files.Backend/CommandLine/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Files.Backend.CommandLine
{
/// <summary>
/// Provides static helper for command line arguments on Windows.
/// Provides static helper for parsing of command line arguments on Windows.
/// </summary>
public class CommandLineParser
{
Expand Down Expand Up @@ -35,7 +35,7 @@ public static ParsedCommands ParseUntrustedCommands(string[] cmdLineStrings)
}

/// <summary>
///
/// Convert string split arguments into a collection of <see cref="ParsedCommand"/>
/// </summary>
/// <param name="parsedArgs">String of command line to parse.</param>
/// <returns>A collection of parsed command.</returns>
Expand Down Expand Up @@ -100,7 +100,7 @@ private static ParsedCommands ParseSplitArguments(List<KeyValuePair<string, stri
}

/// <summary>
///
/// Split flat string argument to an array of <see cref="string"/>.
/// </summary>
/// <param name="commandLine"></param>
/// <param name="trimQuotes"></param>
Expand All @@ -125,7 +125,7 @@ public static string[] SplitArguments(string commandLine, bool trimQuotes = fals
}

/// <summary>
///
/// Parse an arguments array of <see cref="string"/> to a collection of <see cref="KeyValuePair"/>.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
Expand Down Expand Up @@ -170,7 +170,7 @@ public static List<KeyValuePair<string, string[]>> Parse(string[] args = null)
}

/// <summary>
///
/// Parse an arguments array of <see cref="string"/> to a collection of <see cref="KeyValuePair"/>.
/// </summary>
/// <param name="args"></param>
/// <param name="index"></param>
Expand Down
23 changes: 19 additions & 4 deletions src/Files.Backend/Data/Enums/AddItemDialogItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify item type for item creation dialog.
/// </summary>
public enum AddItemDialogItemType
{
Folder = 0,
/// <summary>
/// Canceled an operation.
/// </summary>
Cancel,

File = 1,
/// <summary>
/// Item type is a folder.
/// </summary>
Folder,

Shortcut = 2,
/// <summary>
/// Item type is a file.
/// </summary>
File,

Cancel = 3
/// <summary>
/// Item type is a shortcut.
/// </summary>
Shortcut,
}
}
18 changes: 18 additions & 0 deletions src/Files.Backend/Data/Enums/AppEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,32 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify application distribution type.
/// </summary>
/// <remarks>
/// Those type names are mostly corresponded to build configurations.
/// </remarks>
public enum AppEnvironment
{
/// <summary>
/// Application distribution type is Dev.
/// </summary>
Dev,

/// <summary>
/// Application distribution type is Stable.
/// </summary>
Stable,

/// <summary>
/// Application distribution type is Store.
/// </summary>
Store,

/// <summary>
/// Application distribution type is Preview.
/// </summary>
Preview
}
}
17 changes: 16 additions & 1 deletion src/Files.Backend/Data/Enums/BackdropMaterialType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify application backdrop material type on Windows.
/// </summary>
public enum BackdropMaterialType
{
/// <summary>
/// None of backdrop.
/// </summary>
Solid,

/// <summary>
/// Mica backdrop.
/// </summary>
Mica,

/// <summary>
/// Mica Alt backdrop.
/// </summary>
MicaAlt,

/// <summary>
/// Arcylic backdrop.
/// </summary>
Acrylic
}
}
}
15 changes: 15 additions & 0 deletions src/Files.Backend/Data/Enums/ContextMenuFlyoutItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify item type of ContextMenuFlyout on Windows.
/// </summary>
public enum ContextMenuFlyoutItemType
{
/// <summary>
/// Button type.
/// </summary>
Item,

/// <summary>
/// Separator type.
/// </summary>
Separator,

/// <summary>
/// Toggle Button type.
/// </summary>
Toggle,

/// <summary>
/// Split Button type.
/// </summary>
SplitButton
}
}
3 changes: 3 additions & 0 deletions src/Files.Backend/Data/Enums/FilesystemItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify item type of the file system on Windows.
/// </summary>
public enum FilesystemItemType : byte
{
/// <summary>
Expand Down
15 changes: 15 additions & 0 deletions src/Files.Backend/Data/Enums/GitCheckoutOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify checkout operation type.
/// </summary>
public enum GitCheckoutOptions
{
/// <summary>
/// Bring changes to the checking out branch.
/// </summary>
BringChanges,

/// <summary>
/// Stash changes to the checking out branch.
/// </summary>
StashChanges,

/// <summary>
/// Discard changes and check out to the branch.
/// </summary>
DiscardChanges,

/// <summary>
/// No operation to perform.
/// </summary>
None
}
}
3 changes: 3 additions & 0 deletions src/Files.Backend/Data/Enums/ImpossibleActionResponseTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify
/// </summary>
0x5bfa marked this conversation as resolved.
Show resolved Hide resolved
public enum ImpossibleActionResponseTypes
{
/// <summary>
Expand Down
24 changes: 24 additions & 0 deletions src/Files.Backend/Data/Enums/ParsedCommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,44 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify parsed command line item type on Windows.
/// </summary>
public enum ParsedCommandType
{
/// <summary>
/// Unknown command type.
/// </summary>
Unknown,

/// <summary>
/// Open directory command type
/// </summary>
OpenDirectory,

/// <summary>
/// Open path command type
/// </summary>
OpenPath,

/// <summary>
/// Explorer shell command type
/// </summary>
ExplorerShellCommand,

/// <summary>
/// Output path command type
/// </summary>
OutputPath,

/// <summary>
/// Select path command type
/// </summary>
SelectItem,

/// <summary>
/// Tag files command type
/// </summary>
TagFiles
}
}
18 changes: 18 additions & 0 deletions src/Files.Backend/Data/Enums/PreviewPaneStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,34 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify preview pane status.
/// </summary>
public enum PreviewPaneStates
{
/// <summary>
/// No item selected status.
/// </summary>
NoItemSelected,

/// <summary>
/// No preview available status.
/// </summary>
NoPreviewAvailable,

/// <summary>
/// No preview or details status.
/// </summary>
NoPreviewOrDetailsAvailable,

/// <summary>
/// Preview and details available status.
/// </summary>
PreviewAndDetailsAvailable,

/// <summary>
/// Loading preview status.
/// </summary>
LoadingPreview
}
}
12 changes: 12 additions & 0 deletions src/Files.Backend/Data/Enums/SearchBoxTextChangeReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@

namespace Files.Backend.Data.Enums
{
/// <summary>
/// Defines constants that specify search box text changed reason.
/// </summary>
public enum SearchBoxTextChangeReason : ushort
{
/// <summary>
/// The user has changed text.
/// </summary>
UserInput,

/// <summary>
/// The Files has programatically changed.
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
ProgrammaticChange,

/// <summary>
/// The user has chosen a suggestion.
/// </summary>
SuggestionChosen
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@

namespace Files.Backend.Data.Messages
{
/// <summary>
/// Represents a messenger for FileSystemDialog option changed.
/// </summary>
public sealed class FileSystemDialogOptionChangedMessage
: ValueChangedMessage<FileSystemDialogConflictItemViewModel>
{
/// <summary>
/// Initializes a class.
/// </summary>
public FileSystemDialogOptionChangedMessage(FileSystemDialogConflictItemViewModel value)
: base(value)
{
Expand Down
9 changes: 9 additions & 0 deletions src/Files.Backend/Data/Models/AddItemDialogResultModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@

namespace Files.Backend.Data.Models
{
/// <summary>
/// Represents a model for AddItemDialog result.
/// </summary>
public sealed class AddItemDialogResultModel
{
/// <summary>
/// Gets or sets item type that is added.
/// </summary>
public AddItemDialogItemType ItemType { get; set; }

/// <summary>
/// Gets or sets added item information.
/// </summary>
public ShellNewEntry? ItemInfo { get; set; }
}
}
Loading