Skip to content

Commit 8df48da

Browse files
Merge branch 'main' into items-context-menu-options
2 parents 83a0aad + efac043 commit 8df48da

File tree

302 files changed

+13438
-9107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+13438
-9107
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Custom files
77
CustomOpenDialog*.dll
88
CustomSaveDialog*.dll
9+
FilesLauncher.exe
910

1011
# User-specific files
1112
*.suo

Files.sln

Lines changed: 35 additions & 94 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 21 additions & 674 deletions
Large diffs are not rendered by default.

builds/azure-pipelines-release.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
inputs:
5353
SourceFolder: '$(Agent.TempDirectory)'
5454
Contents: '$(mapsDevKey.secureFilePath)'
55-
TargetFolder: '$(Build.SourcesDirectory)\Files.Uwp\Resources'
55+
TargetFolder: '$(Build.SourcesDirectory)\src\Files.Uwp\Resources'
5656
overWrite: true
5757

5858
- task: DownloadSecureFile@1
@@ -65,14 +65,22 @@ jobs:
6565
inputs:
6666
SourceFolder: '$(Agent.TempDirectory)'
6767
Contents: '$(appCenterDevKey.secureFilePath)'
68-
TargetFolder: '$(Build.SourcesDirectory)\Files.Uwp\Resources'
68+
TargetFolder: '$(Build.SourcesDirectory)\src\Files.Uwp\Resources'
6969
overWrite: true
7070

7171
- task: UseDotNet@2
7272
inputs:
7373
packageType: sdk
7474
version: 6.0.100
7575

76+
- task: NuGetToolInstaller@1
77+
78+
- task: NuGetCommand@2
79+
inputs:
80+
feedsToUse: config
81+
nugetConfigPath: nuget.config
82+
restoreSolution: '$(solution)'
83+
7684
- task: DownloadSecureFile@1
7785
name: caCertificate
7886
displayName: 'Download CA certificate'
@@ -84,7 +92,7 @@ jobs:
8492
solution: '**/*.wapproj'
8593
platform: 'x86'
8694
configuration: '$(buildConfiguration)'
87-
msbuildArguments: '/t:build;_GenerateAppxPackage /restore /p:AppxLogTelemetryFromSideloadingScript=False /p:GenerateAppInstallerFile=True /p:AppInstallerUri=https://filescommunity.blob.core.windows.net/files/preview/ /p:AppInstallerCheckForUpdateFrequency=OnApplicationRun /p:AppInstallerUpdateFrequency=1 /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=Sideload /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile="$(caCertificate.secureFilePath)" /p:PackageCertificatePassword="$(signingCert.password)" /p:PackageCertificateThumbprint=""'
95+
msbuildArguments: '/t:build;_GenerateAppxPackage /p:AppxLogTelemetryFromSideloadingScript=False /p:GenerateAppInstallerFile=True /p:AppInstallerUri=https://cdn.files.community/files/preview/ /p:AppInstallerCheckForUpdateFrequency=OnApplicationRun /p:AppInstallerUpdateFrequency=1 /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=Sideload /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile="$(caCertificate.secureFilePath)" /p:PackageCertificatePassword="$(signingCert.password)" /p:PackageCertificateThumbprint=""'
8896
maximumCpuCount: true
8997

9098
- task: CopyFiles@2
@@ -168,12 +176,20 @@ jobs:
168176
packageType: sdk
169177
version: 6.0.100
170178

179+
- task: NuGetToolInstaller@1
180+
181+
- task: NuGetCommand@2
182+
inputs:
183+
feedsToUse: config
184+
nugetConfigPath: nuget.config
185+
restoreSolution: '$(solution)'
186+
171187
- task: MSBuild@1
172188
inputs:
173189
solution: '**/*.wapproj'
174190
platform: 'x86'
175191
configuration: '$(buildConfiguration)'
176-
msbuildArguments: '/t:build;_GenerateAppxPackage /restore /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
192+
msbuildArguments: '/t:build;_GenerateAppxPackage /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
177193
maximumCpuCount: true
178194

179195
- task: CopyFiles@2

builds/azure-pipelines.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,20 @@ steps:
6464
packageType: sdk
6565
version: 6.0.100
6666

67+
- task: NuGetToolInstaller@1
68+
69+
- task: NuGetCommand@2
70+
inputs:
71+
feedsToUse: config
72+
nugetConfigPath: nuget.config
73+
restoreSolution: '$(solution)'
6774

6875
- task: MSBuild@1
6976
inputs:
7077
platform: 'x64'
7178
solution: '**/*.wapproj'
7279
configuration: '$(buildConfiguration)'
73-
msbuildArguments: '/t:build;_GenerateAppxPackage /restore /p:Configuration=Release;Platform="$(buildPlatform)";AppxBundle=Always;AppxBundlePlatforms="$(buildPlatform)";AppxPackageDir="$(appxPackageDir)";AppxPackageSigningEnabled=true;UapAppxPackageBuildMode=SideloadOnly;PackageCertificateKeyFile="$(Build.SourcesDirectory)\builds\Files_SelfSigned.pfx";PackageCertificatePassword="";PackageCertificateThumbprint=""'
80+
msbuildArguments: '/t:build;_GenerateAppxPackage /p:Configuration=Release;Platform="$(buildPlatform)";AppxBundle=Always;AppxBundlePlatforms="$(buildPlatform)";AppxPackageDir="$(appxPackageDir)";AppxPackageSigningEnabled=true;UapAppxPackageBuildMode=SideloadOnly;PackageCertificateKeyFile="$(Build.SourcesDirectory)\builds\Files_SelfSigned.pfx";PackageCertificatePassword="";PackageCertificateThumbprint=""'
7481
maximumCpuCount: true
7582

7683
- task: DotNetCoreCLI@2

src/BackgroundTasks/BackgroundTasks.csproj

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -13,30 +13,11 @@
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
1414
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22000.0</TargetPlatformVersion>
1515
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
16-
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
16+
<MinimumVisualStudioVersion>17</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
2020
</PropertyGroup>
21-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
22-
<PlatformTarget>AnyCPU</PlatformTarget>
23-
<DebugSymbols>true</DebugSymbols>
24-
<DebugType>full</DebugType>
25-
<Optimize>false</Optimize>
26-
<OutputPath>bin\Debug\</OutputPath>
27-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
28-
<ErrorReport>prompt</ErrorReport>
29-
<WarningLevel>4</WarningLevel>
30-
</PropertyGroup>
31-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32-
<PlatformTarget>AnyCPU</PlatformTarget>
33-
<DebugType>pdbonly</DebugType>
34-
<Optimize>true</Optimize>
35-
<OutputPath>bin\Release\</OutputPath>
36-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
37-
<ErrorReport>prompt</ErrorReport>
38-
<WarningLevel>4</WarningLevel>
39-
</PropertyGroup>
4021
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
4122
<PlatformTarget>x86</PlatformTarget>
4223
<DebugSymbols>true</DebugSymbols>
@@ -57,26 +38,6 @@
5738
<UseVSHostingProcess>false</UseVSHostingProcess>
5839
<ErrorReport>prompt</ErrorReport>
5940
</PropertyGroup>
60-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
61-
<PlatformTarget>ARM</PlatformTarget>
62-
<DebugSymbols>true</DebugSymbols>
63-
<OutputPath>bin\ARM\Debug\</OutputPath>
64-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
65-
<NoWarn>;2008</NoWarn>
66-
<DebugType>full</DebugType>
67-
<UseVSHostingProcess>false</UseVSHostingProcess>
68-
<ErrorReport>prompt</ErrorReport>
69-
</PropertyGroup>
70-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
71-
<PlatformTarget>ARM</PlatformTarget>
72-
<OutputPath>bin\ARM\Release\</OutputPath>
73-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
74-
<Optimize>true</Optimize>
75-
<NoWarn>;2008</NoWarn>
76-
<DebugType>pdbonly</DebugType>
77-
<UseVSHostingProcess>false</UseVSHostingProcess>
78-
<ErrorReport>prompt</ErrorReport>
79-
</PropertyGroup>
8041
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|arm64'">
8142
<PlatformTarget>arm64</PlatformTarget>
8243
<DebugSymbols>true</DebugSymbols>
@@ -129,8 +90,8 @@
12990
<Version>6.2.13</Version>
13091
</PackageReference>
13192
</ItemGroup>
132-
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
133-
<VisualStudioVersion>14.0</VisualStudioVersion>
93+
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '17.0' ">
94+
<VisualStudioVersion>17.0</VisualStudioVersion>
13495
</PropertyGroup>
13596
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
13697
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/Files.Backend/Constants.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Files.Backend
6+
{
7+
public static class Constants
8+
{
9+
public static class KnownImageFormats
10+
{
11+
public const string BITMAP_IMAGE_FORMAT = "bitmapimage";
12+
}
13+
}
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Files.Backend.Enums
2+
{
3+
public enum AddItemDialogItemType
4+
{
5+
Folder = 0,
6+
File = 1,
7+
Cancel = 2
8+
}
9+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Files.Backend.ViewModels.Dialogs;
2+
using Files.Shared.Enums;
3+
using System.ComponentModel;
4+
using System.Threading.Tasks;
5+
6+
namespace Files.Backend.Extensions
7+
{
8+
public static class DialogExtensions
9+
{
10+
public static async Task<DialogResult> TryShowAsync<TViewModel>(this IDialog<TViewModel> dialog)
11+
where TViewModel : class, INotifyPropertyChanged
12+
{
13+
try
14+
{
15+
return await dialog.ShowAsync();
16+
}
17+
catch
18+
{
19+
// Another dialog is already open
20+
return DialogResult.None;
21+
}
22+
}
23+
}
24+
}

src/Files.Backend/Extensions/LocalizationExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public static string ToLocalized(this string resourceKey, ILocalizationService?
1313
{
1414
if (localizationService == null)
1515
{
16-
FallbackLocalizationService ??= Ioc.Default.GetRequiredService<ILocalizationService>();
17-
return FallbackLocalizationService.LocalizeFromResourceKey(resourceKey);
16+
FallbackLocalizationService ??= Ioc.Default.GetService<ILocalizationService>();
17+
return FallbackLocalizationService?.LocalizeFromResourceKey(resourceKey) ?? string.Empty;
1818
}
1919

2020
return localizationService.LocalizeFromResourceKey(resourceKey);

src/Files.Backend/Files.Backend.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Platforms>x86;x64;arm64</Platforms>
5+
<Platforms>x86;x64;arm64</Platforms>
66
<RuntimeIdentifiers>win-arm64;win-x86;win-x64</RuntimeIdentifiers>
77
<LangVersion>9</LangVersion>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0-preview1" />
12+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0-preview2" />
1313
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1414
</ItemGroup>
1515

16-
<ItemGroup>
17-
<Folder Include="Messages\" />
18-
</ItemGroup>
19-
2016
<ItemGroup>
2117
<ProjectReference Include="..\Files.Shared\Files.Shared.csproj" />
2218
</ItemGroup>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using CommunityToolkit.Mvvm.Messaging.Messages;
2+
using Files.Backend.ViewModels.Layouts;
3+
4+
namespace Files.Backend.Messages
5+
{
6+
public sealed class ActiveLayoutChangedMessage : ValueChangedMessage<BaseLayoutViewModel>
7+
{
8+
public ActiveLayoutChangedMessage(BaseLayoutViewModel value)
9+
: base(value)
10+
{
11+
}
12+
}
13+
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
using System;
2+
using System.Collections.Generic;
3+
4+
#nullable enable
25

36
namespace Files.Backend.Models.Coloring
47
{
58
[Serializable]
69
public abstract class ColorModel : ICustomFormattable
710
{
8-
public string? FormatInfo { get; set; }
11+
public virtual IReadOnlyCollection<string>? Formats { get; }
12+
13+
public virtual void AppendFormat(string formatInfo) { }
914
}
1015
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Files.Backend.Enums;
2+
using Files.Shared;
3+
4+
#nullable enable
5+
6+
namespace Files.Backend.Models.Dialogs
7+
{
8+
public sealed class AddItemDialogResultModel
9+
{
10+
public AddItemDialogItemType ItemType { get; set; }
11+
12+
public ShellNewEntry? ItemInfo { get; set; }
13+
}
14+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#nullable enable
22

3+
using System.Collections.Generic;
4+
35
namespace Files.Backend.Models
46
{
57
public interface ICustomFormattable
68
{
7-
string? FormatInfo { get; }
9+
IReadOnlyCollection<string>? Formats { get;}
10+
11+
void AppendFormat(string formatInfo);
812
}
913
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Collections.Generic;
2+
3+
namespace Files.Backend.Models.Imaging
4+
{
5+
public abstract class BitmapImageModel : ImageModel
6+
{
7+
public override IReadOnlyCollection<string>? Formats { get; }
8+
9+
public BitmapImageModel()
10+
{
11+
Formats = new List<string>()
12+
{
13+
Constants.KnownImageFormats.BITMAP_IMAGE_FORMAT
14+
};
15+
}
16+
17+
public abstract object GetImage();
18+
}
19+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#nullable enable
22

3+
using System.Collections.Generic;
4+
35
namespace Files.Backend.Models.Imaging
46
{
57
public abstract class ImageModel : ICustomFormattable
68
{
7-
public string? FormatInfo { get; set; }
9+
public virtual IReadOnlyCollection<string>? Formats { get; }
10+
11+
public virtual void AppendFormat(string formatInfo) { }
812
}
913
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#nullable enable
2+
3+
namespace Files.Backend.Models.Imaging
4+
{
5+
public sealed class ReadyBitmapImageModel : BitmapImageModel
6+
{
7+
private readonly object _image;
8+
9+
public ReadyBitmapImageModel(object image)
10+
{
11+
this._image = image;
12+
}
13+
14+
public override object GetImage()
15+
{
16+
return _image;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)