// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.0.0")]
-[assembly: AssemblyFileVersionAttribute("0.7.20301.2122")]
+[assembly: AssemblyFileVersionAttribute("0.7.20302.2120")]
<ItemGroup>
<Compile Include="EnumerableExtensionsTest.cs" />
<Compile Include="ExtensionTests.cs" />
+ <Compile Include="FileSystemWatcherAdapterTest.cs" />
<Compile Include="NetworkAgentTest.cs" />
<Compile Include="PithosWorkflowTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
namespace Pithos.Core.Agents\r
{\r
using System;\r
- using System.Collections.Generic;\r
- using System.Linq;\r
- using System.Text;\r
\r
/// <summary>\r
- /// TODO: Update summary.\r
+ /// Wraps a FileSystemWatcher and raises Move and child object events \r
/// </summary>\r
public class FileSystemWatcherAdapter\r
{\r
}\r
\r
private string _cachedDeletedFullPath;\r
- private const int PropagateDelay = 10; \r
-\r
- private static void OnTimeout(object state)\r
- {\r
- throw new NotImplementedException();\r
- }\r
+ private const int PropagateDelay = 10;\r
\r
private void OnDeleted(object sender, FileSystemEventArgs e)\r
{\r
TaskEx.Delay(PropagateDelay).ContinueWith(t =>\r
{\r
var myPath = e.FullPath;\r
- if (this._cachedDeletedFullPath==myPath)\r
+ if (_cachedDeletedFullPath==myPath)\r
PropagateCachedDeleted(sender);\r
});\r
}\r
PropagateCachedDeleted(sender);\r
//and propagate the actual event\r
var actualEvent = e.ChangeType == WatcherChangeTypes.Created ? Created : Changed;\r
+\r
if (actualEvent != null)\r
+ {\r
actualEvent(sender, e);\r
+ //For Folders, raise Created events for all children\r
+ RaiseCreatedForChildren(sender,e);\r
+ }\r
}\r
finally\r
{\r
\r
}\r
\r
+ private void RaiseCreatedForChildren(object sender, FileSystemEventArgs e)\r
+ {\r
+ Contract.Requires(sender!=null);\r
+ Contract.Requires(e!=null);\r
+\r
+ if (e.ChangeType != WatcherChangeTypes.Created)\r
+ return;\r
+ var dir= new DirectoryInfo(e.FullPath);\r
+ //Skip if this is not a folder\r
+ if (!dir.Exists)\r
+ return;\r
+ foreach (var info in dir.EnumerateFileSystemInfos("*",SearchOption.AllDirectories))\r
+ {\r
+ var path = Path.GetDirectoryName(info.FullName);\r
+ Created(sender,new FileSystemEventArgs(WatcherChangeTypes.Created,path,info.Name));\r
+ } \r
+ }\r
+\r
private bool HandleMoved(object sender, FileSystemEventArgs e)\r
{\r
if (sender == null)\r
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Pithos"
- "ProductCode" = "8:{013ABFEC-E6FB-4C5E-930F-736A4730268A}"
- "PackageCode" = "8:{C7D65245-240C-42FA-9E46-2AAFB3351131}"
+ "ProductCode" = "8:{871B6E5B-9773-43A7-B128-29CC044ED231}"
+ "PackageCode" = "8:{92373269-1FD4-4034-84D7-54D1E333A7E0}"
"UpgradeCode" = "8:{205365D1-28AA-4322-A46C-FCB37502C6EF}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
- "ProductVersion" = "8:0.7.20229"
+ "ProductVersion" = "8:0.7.20301"
"Manufacturer" = "8:GRNET"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://code.grnet.gr/projects/pithos-ms-client"
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Pithos"
- "ProductCode" = "8:{CDF5C181-8F2F-4135-9861-89F031E4B435}"
- "PackageCode" = "8:{CD80CD47-92C9-4445-A777-4110130323B8}"
+ "ProductCode" = "8:{89D5E193-BDED-4391-9258-E5CAB4EE38A1}"
+ "PackageCode" = "8:{1D7F64B1-0744-4B85-884E-474AFFABA160}"
"UpgradeCode" = "8:{205365D1-28AA-4322-A46C-FCB37502C6EF}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
- "ProductVersion" = "8:0.7.20229"
+ "ProductVersion" = "8:0.7.20301"
"Manufacturer" = "8:GRNET"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://code.grnet.gr/projects/pithos-ms-client"