Skip to content

Commit 717ab0f

Browse files
committed
v1.4.4298.0
1 parent 9e32e73 commit 717ab0f

32 files changed

+788
-448
lines changed

VirtualFileSystem/Framework/FileSystemItemBasicInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ internal class FileSystemItemBasicInfo : IFileSystemItemBasicInfo
2222
public byte[] CustomData { get; set; }
2323

2424
///<inheritdoc/>
25-
public DateTime CreationTime { get; set; }
25+
public DateTimeOffset CreationTime { get; set; }
2626

2727
///<inheritdoc/>
28-
public DateTime LastWriteTime { get; set; }
28+
public DateTimeOffset LastWriteTime { get; set; }
2929

3030
///<inheritdoc/>
31-
public DateTime LastAccessTime { get; set; }
31+
public DateTimeOffset LastAccessTime { get; set; }
3232

3333
///<inheritdoc/>
34-
public DateTime ChangeTime { get; set; }
34+
public DateTimeOffset ChangeTime { get; set; }
3535

3636
/// <summary>
3737
/// Server ETag.

VirtualFileSystem/Framework/Logger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal Logger(string componentName, ILog logger)
3636
public void LogError(string message, string sourcePath = null, string targetPath = null, Exception ex = null)
3737
{
3838
string att = FsPath.Exists(sourcePath) ? FsPath.GetAttString(sourcePath) : null;
39-
Log.Error($"\n{DateTime.Now} [{Thread.CurrentThread.ManagedThreadId,2}] {componentName,-26}{message,-45} {sourcePath,-80} {att} ", ex);
39+
Log.Error($"\n{DateTimeOffset.Now} [{Thread.CurrentThread.ManagedThreadId,2}] {componentName,-26}{message,-45} {sourcePath,-80} {att} ", ex);
4040
}
4141

4242
/// <inheritdoc/>
@@ -45,7 +45,7 @@ public void LogMessage(string message, string sourcePath = null, string targetPa
4545
string att = FsPath.Exists(sourcePath) ? FsPath.GetAttString(sourcePath) : null;
4646
string size = FsPath.Size(sourcePath);
4747

48-
Log.Debug($"\n{DateTime.Now} [{Thread.CurrentThread.ManagedThreadId,2}] {componentName,-26}{message,-45} {sourcePath,-80} {size,7} {att} {targetPath}");
48+
Log.Debug($"\n{DateTimeOffset.Now} [{Thread.CurrentThread.ManagedThreadId,2}] {componentName,-26}{message,-45} {sourcePath,-80} {size,7} {att} {targetPath}");
4949
}
5050
}
5151
}

VirtualFileSystem/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ static async Task<int> Main(string[] args)
5757
// Load Log4Net for net configuration.
5858
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
5959
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
60+
// Enable UTF8 for Console Window
61+
Console.OutputEncoding = System.Text.Encoding.UTF8;
6062

6163
log.Info($"\n{System.Diagnostics.Process.GetCurrentProcess().ProcessName}");
6264
log.Info("\nPress 'Q' to unregister file system, delete all files/folders and exit (simulate uninstall with full cleanup).");

VirtualFileSystem/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<p>You can download this sample and a trial license in the&nbsp;<a title="IT Hit User File System for .NET Download" href="https://www.userfilesystem.com/download/">product download area</a>. You can also clone it and browse the code on&nbsp;<a title="Virtual File System Sample in .NET, C#" href="https://github.com/ITHit/UserFileSystemSamples/tree/master/VirtualFileSystem">GitHub</a>.&nbsp;</p>
77
<h2>Requirements</h2>
88
<ul>
9-
<li>.NET Core 3.1 or later.</li>
9+
<li>.NET 5.0 or later.</li>
1010
<li>Microsoft Windows 10 Creators Update or later version.</li>
1111
<li>NTFS file system.</li>
1212
</ul>
@@ -65,4 +65,6 @@
6565
<p>Synchronization in this sample is based on In-Sync file status as well as on the ETag received from the server.</p>
6666
<p>The server to client synchronization is performed only if the file on the client is marked as In-Sync&nbsp;with the server&nbsp;(it is marked with<img id="__mcenew" alt="In-Sync icon" src="https://www.userfilesystem.com/media/1986/localfile.png" rel="118449">&nbsp;or&nbsp;<img id="__mcenew" alt="Pinned file" src="https://www.userfilesystem.com/media/1989/pinnedfile.png" rel="118452">&nbsp;or&nbsp;<img id="__mcenew" alt="Cloud file" src="https://www.userfilesystem.com/media/1988/offilefile.png" rel="118451">icon). If the file is modified on the server and is marked as not In-Sync on the client, the files are considered to be in conflict and the conflict icon is displayed.</p>
6767
<p>When any file or folder on the client is updated, it is marked as not In-Sync<img id="__mcenew" alt="Not in sync icon" src="https://www.userfilesystem.com/media/1987/notinsyncfile.png" rel="118450">, which means the content must be sent to the server. When the updated file is being sent from client to server, the server compares the ETag sent from the client with the ETag stored on the server, to avoid the server changes to be overwritten. The file/folder is updated only if the ETags match. Otherwise, the file/folder is considered to be in conflict and marked with the conflict icon.</p>
68+
<h3 class="para d-inline next-article-heading">Next Article:</h3>
69+
<a title="WebDAV Drive Sample in .NET, C#" href="https://www.userfilesystem.com/examples/webdav_drive/">WebDAV Drive Sample in .NET, C#</a>
6870

VirtualFileSystem/UserFileSystemItem.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ protected async Task<string> CreateOrUpdateFileAsync(string remoteStoragePath, I
153153
// This is only required to avoid circular updates because of the simplicity of this sample.
154154
// In your real-life application you will receive a new ETag from the server in the update response
155155
// and return it from this method.
156-
string eTag = newInfo.LastWriteTime.ToBinary().ToString();
156+
string eTag = newInfo.LastWriteTime.DateTime.ToBinary().ToString();
157157
await ETag.SetETagAsync(userFileSystemPath, eTag);
158158

159159
// Update remote storage file content.
@@ -224,14 +224,14 @@ protected async Task<string> CreateOrUpdateFolderAsync(string remoteStoragePath,
224224
// Update ETag/LastWriteTime in user file system, so the synchronyzation or remote storage monitor would not start the new update.
225225
// This is only required to avoid circular updates because of the simplicity of this sample.
226226
// In your real-life application you will receive a new ETag from server in the update response.
227-
string eTag = newInfo.LastWriteTime.ToBinary().ToString();
227+
string eTag = newInfo.LastWriteTime.DateTime.ToBinary().ToString();
228228
await ETag.SetETagAsync(userFileSystemPath, eTag);
229229

230230
remoteStorageItem.Attributes = newInfo.Attributes;
231-
remoteStorageItem.CreationTimeUtc = newInfo.CreationTime;
232-
remoteStorageItem.LastWriteTimeUtc = newInfo.LastWriteTime;
233-
remoteStorageItem.LastAccessTimeUtc = newInfo.LastAccessTime;
234-
remoteStorageItem.LastWriteTimeUtc = newInfo.LastWriteTime;
231+
remoteStorageItem.CreationTimeUtc = newInfo.CreationTime.DateTime;
232+
remoteStorageItem.LastWriteTimeUtc = newInfo.LastWriteTime.DateTime;
233+
remoteStorageItem.LastAccessTimeUtc = newInfo.LastAccessTime.DateTime;
234+
remoteStorageItem.LastWriteTimeUtc = newInfo.LastWriteTime.DateTime;
235235

236236
return eTag;
237237
}

VirtualFileSystem/VirtualFileSystem.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To simulate the remote storage, this sample is using a folder in the local file
3333
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.7" />
3434
</ItemGroup>
3535
<ItemGroup>
36-
<PackageReference Include="ITHit.FileSystem.Windows" Version="1.3.4108.0" />
36+
<PackageReference Include="ITHit.FileSystem.Windows" Version="1.4.4298.0" />
3737
</ItemGroup>
3838
<ItemGroup>
3939
<None Update="appsettings.json">

VirtualFileSystem/log4net.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
<appender-ref ref="file" />
77
</root>
88
<appender name="console" type="log4net.Appender.ManagedColoredConsoleAppender">
9+
<encoding value="utf-8" />
910
<!--
1011
<filter type="log4net.Filter.LevelRangeFilter">
1112
<levelMin value="ERROR" />
1213
<levelMax value="FATAL" />
1314
</filter>
1415
-->
16+
<encoding value="utf-8" />
1517
<mapping>
1618
<level value="INFO" />
1719
<forecolor value="White" />
@@ -33,6 +35,7 @@
3335
</layout>
3436
</appender>
3537
<appender name="file" type="log4net.Appender.RollingFileAppender">
38+
<encoding value="utf-8" />
3639
<file value="app.log" />
3740
<appendToFile value="true" />
3841
<rollingStyle value="Size" />

WebDAVDrive.Login/ChallengeLogin.Designer.cs

Lines changed: 0 additions & 131 deletions
This file was deleted.

WebDAVDrive.Login/ChallengeLogin.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

WebDAVDrive.Login/ChallengeLogin.resx

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)