Skip to content

Commit deb13fb

Browse files
committed
v8.1.26901.0
1 parent f771db5 commit deb13fb

Some content is hidden

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

55 files changed

+279
-124
lines changed

Common/Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Platforms>AnyCPU;x64</Platforms>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
14-
<PackageReference Include="ITHit.FileSystem" Version="8.1.26791.0-Beta2" />
13+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26901.0" />
14+
<PackageReference Include="ITHit.FileSystem" Version="8.1.26901.0" />
1515
</ItemGroup>
1616
</Project>

Common/CustomColumnIds.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@ public enum CustomColumnIds
3434
/// Metadata ETag column ID.
3535
/// </summary>
3636
MetadataETag = 7,
37+
38+
/// <summary>
39+
/// Remote storage item ID.
40+
/// </summary>
41+
Id = 8
3742
}
3843
}

Windows/Common/Core/Common.Windows.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
2222
</ItemGroup>
2323
<ItemGroup>
24-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26791.0-Beta2" />
25-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
24+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26901.0" />
25+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26901.0" />
2626
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2727
</ItemGroup>
2828
</Project>

Windows/Common/Core/FsPath.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ public static bool IsFolder(string path)
2626
return (attributes & FileAttributes.Directory) == FileAttributes.Directory;
2727
}
2828

29+
/// <summary>
30+
/// Tries to determine if the provided path points to the file or folder.
31+
/// </summary>
32+
/// <param name="path">Path to the file or folder.</param>
33+
/// <param name="isFolder">True if the path is folder. False - otherwise.</param>
34+
/// <returns>True if this method successeds. False - otherwise.</returns>
35+
public static bool TryIsFolder(string path, out bool isFolder)
36+
{
37+
if (WindowsFileSystemItem.TryGetAttributes(path, out FileAttributes? attributes))
38+
{
39+
isFolder = (attributes & FileAttributes.Directory) == FileAttributes.Directory;
40+
return true;
41+
}
42+
43+
isFolder = false;
44+
return false;
45+
}
46+
2947
/// <summary>
3048
/// Returns true if a file or folder exists under the specified path. False - otherwise.
3149
/// </summary>

Windows/Common/Core/LogFormatter.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using ITHit.FileSystem.Windows;
1414
using ITHit.FileSystem.Windows.Package;
1515
using Windows.Storage.Search;
16+
using System.Text;
1617

1718
namespace ITHit.FileSystem.Samples.Common.Windows
1819
{
@@ -314,6 +315,31 @@ public static string FormatBytes(long length)
314315
double num = Math.Round(bytes / Math.Pow(1024, place), 1);
315316
return (Math.Sign(length) * num).ToString() + suf[place];
316317
}
318+
319+
public static string IdToSting(byte[] remoteStorageItemId)
320+
{
321+
if (remoteStorageItemId == null)
322+
return null;
323+
324+
switch(remoteStorageItemId.Length)
325+
{
326+
case 8:
327+
return BitConverter.ToInt64(remoteStorageItemId, 0).ToString();
328+
case 16:
329+
return new Guid(remoteStorageItemId).ToString();
330+
default:
331+
// Try parse URI
332+
string uriStrId = Encoding.UTF8.GetString(remoteStorageItemId);
333+
if (Uri.TryCreate(uriStrId, UriKind.RelativeOrAbsolute, out Uri uriId))
334+
{
335+
return uriId.Segments.Last();
336+
}
337+
else
338+
{
339+
return uriStrId;
340+
}
341+
}
342+
}
317343
}
318344

319345
static class StringExtensions

Windows/Common/Core/Registrar.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ private static async Task<StorageProviderSyncRootInfo> RegisterAsync(string sync
330330
proDefinitions.Add(new StorageProviderItemPropertyDefinition { DisplayNameResource = "Lock Expires" , Id = (int)CustomColumnIds.LockExpirationDate });
331331
proDefinitions.Add(new StorageProviderItemPropertyDefinition { DisplayNameResource = "Content ETag" , Id = (int)CustomColumnIds.ContentETag });
332332
proDefinitions.Add(new StorageProviderItemPropertyDefinition { DisplayNameResource = "Metadata ETag", Id = (int)CustomColumnIds.MetadataETag });
333+
proDefinitions.Add(new StorageProviderItemPropertyDefinition { DisplayNameResource = "ID" , Id = (int)CustomColumnIds.Id });
333334

334335

335336
ValidateStorageProviderSyncRootInfo(storageInfo);

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<Compile Remove="IVirtualFolder.cs" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26791.0-Beta2" />
17-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
16+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26901.0" />
17+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26901.0" />
1818
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1919
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
2020
</ItemGroup>

Windows/Common/VirtualDrive/VirtualEngineBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ private void Engine_ItemsChanged(Engine sender, ItemsChangeEventArgs e)
9292
{
9393
foreach (ChangeEventItem item in e.Items)
9494
{
95-
// Save custom properties received from the remote storage here
96-
// they will be displayed in Windows Explorer columns.
95+
// Save custom properties received from the remote storage here.
96+
// They will be displayed in Windows Explorer columns.
9797
if (e.Direction == SyncDirection.Incoming && e.Result.IsSuccess)
9898
{
9999
switch (e.OperationType)

Windows/VirtualDrive/VirtualDrive.ShellExtension/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ static async Task Main(string[] args)
1212
{
1313
try
1414
{
15-
using (var server = new LocalServer())
15+
using (var server = new LocalServerRpc())
1616
{
1717
server.RegisterClass<ThumbnailProviderRpc>();
1818
server.RegisterClass<ContextMenuVerbRpc>();
1919
server.RegisterClass<StorageProviderCopyHookRpc>();
2020
server.RegisterWinRTClass<IStorageProviderItemPropertySource, CustomStateProviderRpc>();
2121
server.RegisterWinRTClass<IStorageProviderUriSource, UriSourceRpc>();
2222

23-
await server.Run();
23+
await server.RunAsync();
2424
}
2525
}
2626
catch (Exception ex)

Windows/VirtualDrive/VirtualDrive.ShellExtension/VirtualDrive.ShellExtension.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26791.0-Beta2" />
22+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26901.0" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<None Update="log4net.config">

0 commit comments

Comments
 (0)