Skip to content

Commit f5b8996

Browse files
committed
v8.1.26224.0-Beta2
1 parent 66a0152 commit f5b8996

File tree

84 files changed

+2256
-1083
lines changed

Some content is hidden

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

84 files changed

+2256
-1083
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.0.26019.0-Beta" />
14-
<PackageReference Include="ITHit.FileSystem" Version="8.0.26019.0-Beta" />
13+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26224.0-Beta2" />
14+
<PackageReference Include="ITHit.FileSystem" Version="8.1.26224.0-Beta2" />
1515
</ItemGroup>
1616
</Project>

Common/CustomColumnIds.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ public enum CustomColumnIds
2626
LockExpirationDate = 5,
2727

2828
/// <summary>
29-
/// ETag column ID.
29+
/// Content ETag column ID.
3030
/// </summary>
31-
ETag = 6,
31+
ContentETag = 6,
32+
33+
/// <summary>
34+
/// Metadata ETag column ID.
35+
/// </summary>
36+
MetadataETag = 7,
3237
}
3338
}

Common/FileMetadataExt.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ public class FileMetadataExt : FileSystemItemMetadataExt, IFileMetadata
1010
{
1111
///<inheritdoc/>
1212
public long Length { get; set; }
13+
14+
///<inheritdoc/>
15+
public string ContentETag { get; set; }
1316
}
1417
}

Common/FileSystemItemMetadataExt.cs

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,13 @@ namespace ITHit.FileSystem.Samples.Common
99
{
1010
/// <summary>
1111
/// Represents a basic information about the file or the folder in the user file system.
12+
/// In addition to the properties provided by <see cref="IFileSystemItemMetadata"/> provides <see cref="Lock"/> property.
1213
/// </summary>
13-
public class FileSystemItemMetadataExt : IFileSystemItemMetadata
14+
public class FileSystemItemMetadataExt : FileSystemItemMetadata
1415
{
15-
/// <inheritdoc/>
16-
public byte[] RemoteStorageItemId { get; set; }
17-
18-
/// <inheritdoc/>
19-
public byte[] RemoteStorageParentItemId { get; set; }
20-
21-
///<inheritdoc/>
22-
public string Name { get; set; }
23-
24-
///<inheritdoc/>
25-
public FileAttributes Attributes { get; set; }
26-
27-
///<inheritdoc/>
28-
public DateTimeOffset CreationTime { get; set; }
29-
30-
///<inheritdoc/>
31-
public DateTimeOffset LastWriteTime { get; set; }
32-
33-
///<inheritdoc/>
34-
public DateTimeOffset LastAccessTime { get; set; }
35-
36-
///<inheritdoc/>
37-
public DateTimeOffset ChangeTime { get; set; }
38-
39-
/// <summary>
40-
/// ETag.
41-
/// </summary>
42-
public string ETag { get; set; }
43-
4416
/// <summary>
4517
/// Lock info or null if the item is not locked.
4618
/// </summary>
4719
public ServerLockInfo Lock { get; set; }
48-
49-
/// <summary>
50-
/// Custom columns data to be displayed in the file manager.
51-
/// </summary>
52-
//public IEnumerable<FileSystemItemPropertyData> CustomProperties { get; set; } = new FileSystemItemPropertyData[] { };
53-
54-
///<inheritdoc/>
55-
public ICustomData Properties { get; set; }
5620
}
5721
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,18 @@ Note that these steps are NOT required for development. Sample project provided
8383
</p>
8484
</a>
8585
</li>
86+
<li>
87+
<a class="link-header" href="https://www.userfilesystem.com/examples/ios_deployment/">
88+
<h2>iOS File Provider Extension Projects Deployment</h2>
89+
</a>
90+
91+
<a href="https://www.userfilesystem.com/examples/ios_deployment/">
92+
<p>
93+
To deploy iOS project you will need to create&nbsp;Group ID, App Identifies and Provisioning Profiles.&nbsp;
94+
The project requires a physical device. You can NOT run the project on iOS simulator. You MUST add a device to a devices list.
95+
Unlike with macOS, ALL b <span>...</span>
96+
</p>
97+
</a>
98+
</li>
8699
</ul>
87100

Windows/Common/Core/Commands.cs

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,42 @@
88
using log4net;
99
using ITHit.FileSystem.Windows;
1010
using System.IO;
11+
using System.Collections.Concurrent;
12+
using System.Threading;
1113

1214

1315
namespace ITHit.FileSystem.Samples.Common.Windows
1416
{
1517
/// <summary>
16-
/// Application commands.
18+
/// Commands sent from tray app and comnsole.
1719
/// </summary>
1820
public class Commands
1921
{
2022
/// <summary>
2123
/// Engine instance.
2224
/// </summary>
23-
public EngineWindows Engine;
25+
private readonly EngineWindows Engine;
2426

2527
/// <summary>
2628
/// Remote storage monitor.
2729
/// </summary>
2830
public ISyncService RemoteStorageMonitor;
2931

3032
/// <summary>
31-
/// Log4Net logger.
33+
/// Remote storaage path.
3234
/// </summary>
33-
private readonly ILog log;
35+
private readonly string RemoteStorageRootPath;
3436

3537
/// <summary>
36-
/// Remote storage root path.
38+
/// Log4Net logger.
3739
/// </summary>
38-
private readonly string remoteStorageRootPath;
40+
private readonly ILog log;
3941

40-
public Commands(ILog log, string remoteStorageRootPath)
42+
public Commands(EngineWindows engine, string remoteStorageRootPath, ILog log)
4143
{
44+
this.Engine = engine;
45+
this.RemoteStorageRootPath = remoteStorageRootPath;
4246
this.log = log;
43-
this.remoteStorageRootPath = remoteStorageRootPath;
4447
}
4548

4649
/// <summary>
@@ -70,7 +73,7 @@ public async Task StartStopSynchronizationAsync()
7073
case SynchronizationState.Disabled:
7174
if (Engine.State != EngineState.Running)
7275
{
73-
Engine.SyncService.Logger.LogError("Failed to start. The Engine must be running.");
76+
Engine.SyncService.Logger.LogError("Failed to start. The Engine must be running.", Engine.Path);
7477
return;
7578
}
7679
await Engine.SyncService.StartAsync();
@@ -84,11 +87,17 @@ public async Task StartStopSynchronizationAsync()
8487

8588
public async Task StartStopRemoteStorageMonitorAsync()
8689
{
90+
if(RemoteStorageMonitor == null)
91+
{
92+
Engine.Logger.LogError("Remote storage monitor is null.", Engine.Path);
93+
return;
94+
}
95+
8796
if (RemoteStorageMonitor.SyncState == SynchronizationState.Disabled)
8897
{
8998
if (Engine.State != EngineState.Running)
9099
{
91-
log.Error("Failed to start. The Engine must be running.");
100+
Engine.Logger.LogError("Failed to start. The Engine must be running.", Engine.Path);
92101
//Engine.RemoteStorageMonitor.Logger.LogError("Failed to start. The Engine must be running.");
93102
return;
94103
}
@@ -115,9 +124,9 @@ public static void Open(string path)
115124
}
116125

117126
/// <summary>
118-
/// Open Windows File Manager with user file system.
127+
/// Open root user file system folder in Windows Explorer.
119128
/// </summary>
120-
public async Task OpenFolderAsync()
129+
public async Task OpenRootFolderAsync()
121130
{
122131
Open(Engine.Path);
123132
}
@@ -127,25 +136,26 @@ public async Task OpenFolderAsync()
127136
/// </summary>
128137
public async Task OpenRemoteStorageAsync()
129138
{
130-
Open(remoteStorageRootPath);
139+
Open(RemoteStorageRootPath);
131140
}
132141

133142
/// <summary>
134143
/// Opens support portal.
135144
/// </summary>
136-
public async Task OpenSupportPortalAsync()
145+
public static async Task OpenSupportPortalAsync()
137146
{
138147
Open("https://www.userfilesystem.com/support/");
139148
}
140149

141150
/// <summary>
142151
/// Called on app exit.
143152
/// </summary>
144-
public async Task AppExitAsync()
153+
public async Task EngineExitAsync()
145154
{
146155
await StopEngineAsync();
147-
log.Info("\n\nAll downloaded file / folder placeholders remain in file system. Restart the application to continue managing files.");
148-
log.Info("\nYou can also edit documents when the app is not running and than start the app to sync all changes to the remote storage.\n");
156+
log.Info($"\n\n{RemoteStorageRootPath}");
157+
log.Info("\nAll downloaded file / folder placeholders remain in file system. Restart the application to continue managing files.");
158+
log.Info("\nYou can edit documents when the app is not running and than start the app to sync all changes to the remote storage.\n");
149159
}
150160

151161
/// <summary>
@@ -160,47 +170,49 @@ public async Task StopEngineAsync()
160170
}
161171

162172
#if DEBUG
163-
164-
/// <summary>
165-
/// Sets console output defaults.
166-
/// </summary>
167-
public void ConfigureConsole()
168-
{
169-
// Enable UTF8 for Console Window and set width.
170-
Console.OutputEncoding = System.Text.Encoding.UTF8;
171-
Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight / 3);
172-
//Console.SetBufferSize(Console.LargestWindowWidth * 2, short.MaxValue / 2);
173-
}
174-
175173
/// <summary>
176174
/// Opens Windows File Manager with both remote storage and user file system for testing.
177175
/// </summary>
178176
/// <param name="openRemoteStorage">True if the Remote Storage must be opened. False - otherwise.</param>
179177
/// <remarks>This method is provided solely for the development and testing convenience.</remarks>
180-
public void ShowTestEnvironment(bool openRemoteStorage = true)
178+
public void ShowTestEnvironment(string userFileSystemWindowName, bool openRemoteStorage = true, CancellationToken cancellationToken = default)
181179
{
182180
// Open Windows File Manager with user file system.
183181
Commands.Open(Engine.Path);
182+
IntPtr hWndUserFileSystem = WindowManager.FindWindow(userFileSystemWindowName, cancellationToken);
183+
WindowManager.PositionFileSystemWindow(hWndUserFileSystem, 1, 2);
184184

185185
if (openRemoteStorage)
186186
{
187187
// Open remote storage.
188-
Commands.Open(remoteStorageRootPath);
188+
Commands.Open(RemoteStorageRootPath);
189+
string rsWindowName = Path.GetFileName(RemoteStorageRootPath.TrimEnd('\\'));
190+
IntPtr hWndRemoteStorage = WindowManager.FindWindow(rsWindowName, cancellationToken);
191+
WindowManager.PositionFileSystemWindow(hWndRemoteStorage, 0, 2);
189192
}
190193
}
194+
191195
#endif
196+
192197
public void Test()
193198
{
194-
string name = "General.docx";
195-
var n = Engine.ServerNotifications(Path.Combine(Engine.Path, name));
196-
IFileSystemItemMetadata metadata = new FileMetadataExt();
199+
string name = "Notes.txt";
200+
string filePath = Path.Combine(Engine.Path, name);
201+
//FileInfo fi = new FileInfo(filePath);
202+
//fi.IsReadOnly = true;
203+
204+
var n = Engine.ServerNotifications(filePath);
205+
IFileMetadata metadata = new FileMetadata();
197206
metadata.Attributes = FileAttributes.Normal;
198207
metadata.CreationTime = DateTimeOffset.Now;
199208
metadata.LastWriteTime = DateTimeOffset.Now;
200209
metadata.ChangeTime = DateTimeOffset.Now;
201210
metadata.LastAccessTime = DateTimeOffset.Now;
202211
metadata.Name = name;
212+
metadata.MetadataETag = DateTimeOffset.Now.Ticks.ToString();
213+
metadata.ContentETag = null;//"etag1";
203214
n.UpdateAsync(metadata);
204215
}
216+
205217
}
206218
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
4+
<UseWindowsForms>True</UseWindowsForms>
45
<Description>Contains functionality common for all Windows Virtual Drive samples.</Description>
56
<Authors>IT Hit LTD.</Authors>
67
<Product>IT Hit User File System</Product>
@@ -20,8 +21,8 @@
2021
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
2122
</ItemGroup>
2223
<ItemGroup>
23-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.0.26019.0-Beta" />
24-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.0.26019.0-Beta" />
24+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26224.0-Beta2" />
25+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26224.0-Beta2" />
2526
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2627
</ItemGroup>
2728
</Project>

0 commit comments

Comments
 (0)