Skip to content

Commit f1f0452

Browse files
committed
v9.0.29527.0
1 parent 1172216 commit f1f0452

File tree

193 files changed

+2218
-2052
lines changed

Some content is hidden

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

193 files changed

+2218
-2052
lines changed

Common/Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Compile Remove="FolderMetadataExt.cs" />
1616
</ItemGroup>
1717
<ItemGroup>
18-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29481.0-Beta" />
19-
<PackageReference Include="ITHit.FileSystem" Version="9.0.29481.0-Beta" />
18+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
19+
<PackageReference Include="ITHit.FileSystem" Version="9.0.29527.0" />
2020
</ItemGroup>
2121
</Project>

Common/Settings.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ public class Settings
5555
/// <summary>
5656
/// Get or set the custom columns for the file system items.
5757
/// </summary>
58-
/// <remarks>
59-
/// Each custom column is represented by an instance of the <see cref="CustomColumn"/> class,
60-
/// which includes an ID and a Name.
61-
/// </remarks>
6258
public Dictionary<int, string> CustomColumns { get; set; }
6359
}
6460
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.26100.1742" />
2424
</ItemGroup>
2525
<ItemGroup>
26-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29481.0-Beta" />
27-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29481.0-Beta" />
26+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29527.0" />
27+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
2828
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2929
</ItemGroup>
3030
</Project>

Windows/Common/Core/ConsoleProcessor.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ public void PrintHelp()
3434
logFormatter.LogMessage("\n Commands:");
3535
PrintCommandDescription("Spacebar", "Exit without unregistering (simulate reboot).");
3636
PrintCommandDescription("Esc", "Unregister file system, delete all files/folders and exit.");
37-
if (FileSystem.Windows.Package.PackageRegistrar.IsRunningWithSparsePackageIdentity())
38-
{
39-
PrintCommandDescription("Shift-Esc", "Unregister file system, delete all files/folders, unregister handlers, uninstall developer certificate, unregister sparse package and exit (simulate full uninstall).");
40-
}
4137
PrintCommandDescription("e", "Start/stop the Engine and all sync services.");
4238
PrintCommandDescription("s", "Start/stop synchronization service.");
4339
PrintCommandDescription("m", "Start/stop remote storage monitor.");

Windows/Common/Core/LogFormatter.cs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
using ITHit.FileSystem.Windows;
1414
using ITHit.FileSystem.Windows.Package;
15+
using ITHit.FileSystem.Extensions;
1516
using Windows.Storage.Search;
1617
using System.Text;
1718

@@ -25,7 +26,7 @@ public class LogFormatter
2526
/// <summary>
2627
/// Log file path.
2728
/// </summary>
28-
public readonly string LogFilePath;
29+
public string LogFilePath { get; set; }
2930

3031
/// <summary>
3132
/// Indicates if more debugging and performance information should be logged.
@@ -210,15 +211,15 @@ private void WriteLog(IEngine sender, EngineMessageEventArgs e, log4net.Core.Lev
210211
if (ocWin != null)
211212
{
212213
fileId = ocWin.FileId.ToString();
213-
size = FormatBytes((e.OperationContext as IWindowsOperationContext).FileSize);
214+
size = (e.OperationContext as IWindowsOperationContext).FileSize.FormatBytes();
214215
}
215216
}
216217

217218
string sourcePath = e.SourcePath?.FitString(sourcePathWidth, 6);
218219
string targetPath = e.TargetPath?.FitString(sourcePathWidth, 6);
219220

220221
string message = Format(DateTimeOffset.Now.ToString("hh:mm:ss.fff"), process, priorityHint?.ToString(), fileId, e.ComponentName, e.CallerLineNumber.ToString(), e.CallerMemberName, e.CallerFilePath, e.Message, remoteStorageId, sourcePath, attSource);
221-
if (targetPath!=null)
222+
if (targetPath != null)
222223
{
223224
// For move operation output target path in the next line.
224225
message += Format(null, null, null, null, null, null, null, null, null, null, targetPath, attTarget);
@@ -274,7 +275,7 @@ public static string GetAttString(string path)
274275
{
275276
return WindowsFileSystemItem.GetFileAttributesString(attributes.Value);
276277
}
277-
278+
278279
return null;
279280
}
280281

@@ -299,33 +300,15 @@ public static string Size(string path)
299300
return null;
300301
}
301302

302-
return FormatBytes(length);
303-
}
304-
305-
/// <summary>
306-
/// Formats bytes to string.
307-
/// </summary>
308-
/// <param name="length">Bytes to format.</param>
309-
/// <returns>Human readable bytes string.</returns>
310-
public static string FormatBytes(long length)
311-
{
312-
string[] suf = { "b ", "KB", "MB", "GB", "TB", "PB", "EB" };
313-
if (length == 0)
314-
{
315-
return "0" + suf[0];
316-
}
317-
long bytes = Math.Abs(length);
318-
int place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
319-
double num = Math.Round(bytes / Math.Pow(1024, place), 0);
320-
return (Math.Sign(length) * num).ToString() + suf[place];
303+
return length.FormatBytes();
321304
}
322305

323306
public static string IdToSting(byte[] remoteStorageItemId)
324307
{
325308
if (remoteStorageItemId == null)
326309
return null;
327310

328-
switch(remoteStorageItemId.Length)
311+
switch (remoteStorageItemId.Length)
329312
{
330313
case 8:
331314
return BitConverter.ToInt64(remoteStorageItemId, 0).ToString();

Windows/Common/Core/Registrar.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ public static async Task<bool> UnregisterSyncRootAsync(string syncRootPath, stri
123123

124124
if (res && !string.IsNullOrWhiteSpace(dataPath))
125125
{
126-
log.Debug($"Deleteing data folder for {syncRootPath}");
126+
log.Debug($"\nDeleting data folder for {syncRootPath}");
127127
try
128128
{
129129
Directory.Delete(dataPath, true);
130130
}
131131
catch (Exception ex)
132132
{
133133
res = false;
134-
log.Error($"Failed to delete data folder {syncRootPath} {dataPath}", ex);
134+
log.Error($"\nFailed to delete data folder {syncRootPath} {dataPath}", ex);
135135
}
136136
}
137137

@@ -149,25 +149,25 @@ private static async Task<bool> UnregisterSyncRootAsync(string syncRootPath, ILo
149149
StorageProviderSyncRootInfo syncRootInfo = null;
150150
try
151151
{
152-
logger.Debug($"Getting sync root info {syncRootPath}");
152+
logger.Debug($"\nGetting sync root info {syncRootPath}");
153153
syncRootInfo = StorageProviderSyncRootManager.GetSyncRootInformationForFolder(storageFolder);
154154
}
155155
catch (Exception ex)
156156
{
157-
logger.Error($"Sync root is not registered {syncRootPath}", ex);
157+
logger.Error($"\nSync root is not registered {syncRootPath}", ex);
158158
}
159159

160160
// Unregister sync root.
161161
if (syncRootInfo != null)
162162
{
163163
try
164-
{
165-
logger.Debug($"Unregistering sync root {syncRootPath} {syncRootInfo.Id}");
164+
{
165+
logger.Debug($"\nUnregistering sync root {syncRootPath} {syncRootInfo.Id}");
166166
StorageProviderSyncRootManager.Unregister(syncRootInfo.Id);
167167
}
168168
catch (Exception ex)
169169
{
170-
logger.Error($"Failed to unregister sync root {syncRootPath} {syncRootInfo.Id}", ex);
170+
logger.Error($"\nFailed to unregister sync root {syncRootPath} {syncRootInfo.Id}", ex);
171171
// IMPORTANT!
172172
// If Unregister() failed, deleting items on the client may trigger deleting
173173
// items in the remote storage if the Engine did not stop or if started again.
@@ -178,22 +178,22 @@ private static async Task<bool> UnregisterSyncRootAsync(string syncRootPath, ILo
178178

179179
// Remore the read-only arrtibute. Otherwise delete fails.
180180
var allItems = Directory.EnumerateFileSystemEntries(syncRootPath, "*", SearchOption.AllDirectories);
181-
foreach(var path in allItems)
181+
foreach (var path in allItems)
182182
{
183183
try
184184
{
185185
new FileInfo(path).IsReadOnly = false;
186186
}
187187
catch (Exception ex)
188188
{
189-
logger.Error($"Failed to remove read-only attribute for {path}", ex);
189+
logger.Error($"\nFailed to remove read-only attribute for {path}", ex);
190190
}
191191
}
192192

193193
// Delete sync root folder.
194194
try
195195
{
196-
logger.Debug($"Deleteing sync root folder {syncRootPath}");
196+
logger.Debug($"\nDeleting sync root folder {syncRootPath}");
197197
Directory.Delete(syncRootPath, true);
198198
res = true;
199199
}
@@ -217,7 +217,7 @@ public virtual async Task<bool> UnregisterAllSyncRootsAsync(string providerId, b
217217
{
218218
bool res = true;
219219
var syncRoots = StorageProviderSyncRootManager.GetCurrentSyncRoots();
220-
foreach(var syncRoot in syncRoots)
220+
foreach (var syncRoot in syncRoots)
221221
{
222222
string storedProviderId = syncRoot.Id?.Split('!')?.FirstOrDefault();
223223
if (storedProviderId.Equals(providerId))
@@ -333,14 +333,14 @@ private static async Task<StorageProviderSyncRootInfo> RegisterAsync(string sync
333333
// Adds columns to Windows File Manager.
334334
// Show/hide columns in the "More..." context menu on the columns header in Windows Explorer.
335335
var proDefinitions = storageInfo.StorageProviderItemPropertyDefinitions;
336-
if(customColumns != null)
336+
if (customColumns != null)
337337
{
338338
foreach (var column in customColumns)
339339
{
340340
proDefinitions.Add(new StorageProviderItemPropertyDefinition { DisplayNameResource = column.Value, Id = column.Key });
341341
}
342342
}
343-
343+
344344
ValidateStorageProviderSyncRootInfo(storageInfo);
345345

346346
StorageProviderSyncRootManager.Register(storageInfo);
@@ -469,7 +469,7 @@ private static StorageProviderSyncRootInfo GetSyncRootInfo(Uri uri)
469469
{
470470
return syncRoot;
471471
}
472-
}
472+
}
473473
}
474474

475475
return null;
@@ -510,7 +510,7 @@ public static async Task<IEnumerable<StorageProviderSyncRootInfo>> GetMountedSyn
510510
string storedUri = syncRoot.GetRemoteStoragePath();
511511
if (!System.Uri.TryCreate(storedUri, UriKind.Absolute, out System.Uri _))
512512
{
513-
log.Error($"Can not parse URI for {syncRoot.DisplayNameResource}: {storedUri}");
513+
log.Error($"\nCan not parse URI for {syncRoot.DisplayNameResource}: {storedUri}");
514514
continue;
515515
}
516516

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="9.0.29481.0-Beta" />
17-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29481.0-Beta" />
16+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="9.0.29527.0" />
17+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
1818
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1919
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
2020
</ItemGroup>

0 commit comments

Comments
 (0)