Skip to content

Commit

Permalink
Code Quality: Update structure of storage projects (#15407)
Browse files Browse the repository at this point in the history
Co-authored-by: Yair <[email protected]>
  • Loading branch information
0x5bfa and yaira2 authored May 16, 2024
1 parent e86757a commit 9b4aec7
Show file tree
Hide file tree
Showing 48 changed files with 237 additions and 282 deletions.
31 changes: 31 additions & 0 deletions src/Files.App.Storage/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

// System
global using global::System;
global using global::System.Collections;
global using global::System.Collections.Generic;
global using global::System.Collections.ObjectModel;
global using global::System.Linq;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::System.ComponentModel;
global using global::System.Diagnostics;
global using global::System.Text.Json;
global using global::System.Text.Json.Serialization;
global using SystemIO = global::System.IO;

// Files.Core.Storage

global using global::Files.Core.Storage;
global using global::Files.Core.Storage.Contracts;
global using global::Files.Core.Storage.DirectStorage;
global using global::Files.Core.Storage.Enums;
global using global::Files.Core.Storage.EventArguments;
global using global::Files.Core.Storage.ExtendableStorage;
global using global::Files.Core.Storage.Extensions;
global using global::Files.Core.Storage.LocatableStorage;
global using global::Files.Core.Storage.ModifiableStorage;
global using global::Files.Core.Storage.MutableStorage;
global using global::Files.Core.Storage.NestedStorage;
global using global::Files.Core.Storage.StorageEnumeration;
91 changes: 0 additions & 91 deletions src/Files.App.Storage/NativeStorage/NativeFolderWatcher.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

using Files.Shared.Extensions;
using FluentFTP;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.FtpStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using System.Collections.Generic;
using System.Net;

namespace Files.App.Storage.FtpStorage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.NestedStorage;
using FluentFTP;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.FtpStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.NestedStorage;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.FtpStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.DirectStorage;
using Files.Core.Storage.Enums;
using Files.Core.Storage.ExtendableStorage;
using Files.Core.Storage.Extensions;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.NestedStorage;
using Files.Shared.Helpers;
using FluentFTP;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.FtpStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using FluentFTP;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.FtpStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.ExtendableStorage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.NestedStorage;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.NativeStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.DirectStorage;
using Files.Core.Storage.Enums;
using Files.Core.Storage.ExtendableStorage;
using Files.Core.Storage.Extensions;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.MutableStorage;
using Files.Core.Storage.NestedStorage;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.NativeStorage
{
Expand Down Expand Up @@ -176,11 +163,5 @@ public virtual Task<INestedFolder> CreateFolderAsync(string desiredName, bool ov
_ = Directory.CreateDirectory(path);
return Task.FromResult<INestedFolder>(new NativeFolder(path));
}

/// <inheritdoc/>
public Task<IFolderWatcher> GetFolderWatcherAsync(CancellationToken cancellationToken = default)
{
return Task.FromResult<IFolderWatcher>(new NativeFolderWatcher(this));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.NestedStorage;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace Files.App.Storage.NativeStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Shared.Helpers;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;

namespace Files.App.Storage.NativeStorage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.NestedStorage;
using Files.Shared.Helpers;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.ExtendableStorage;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using Files.Core.Storage.NestedStorage;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.Enums;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.ModifiableStorage;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;
using Files.Core.Storage.DirectStorage;
using Files.Core.Storage.ExtendableStorage;
using Files.Core.Storage.NestedStorage;

namespace Files.App.Storage.WindowsStorage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using System;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;

namespace Files.App.Storage.WindowsStorage
Expand Down
8 changes: 8 additions & 0 deletions src/Files.App/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@
// Files.Core.Storage

global using global::Files.Core.Storage;
global using global::Files.Core.Storage.Contracts;
global using global::Files.Core.Storage.DirectStorage;
global using global::Files.Core.Storage.Enums;
global using global::Files.Core.Storage.EventArguments;
global using global::Files.Core.Storage.ExtendableStorage;
global using global::Files.Core.Storage.Extensions;
global using global::Files.Core.Storage.LocatableStorage;
global using global::Files.Core.Storage.ModifiableStorage;
global using global::Files.Core.Storage.MutableStorage;
global using global::Files.Core.Storage.NestedStorage;
global using global::Files.Core.Storage.StorageEnumeration;

// Files.Shared
global using global::Files.Shared;
Expand Down
Loading

0 comments on commit 9b4aec7

Please sign in to comment.