get { return _settings.FileIdleTimeout; }
}
+ public bool UpdateForceCheck
+ {
+ get { return _settings.UpdateForceCheck; }
+ }
+
public void Save()
{
_settings.Save();
return ((global::System.TimeSpan)(this["FileIdleTimeout"]));
}
}
+
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool UpdateForceCheck {
+ get {
+ return ((bool)(this["UpdateForceCheck"]));
+ }
+ }
}
}
<Setting Name="FileIdleTimeout" Type="System.TimeSpan" Scope="Application">
<Value Profile="(Default)">00:00:10</Value>
</Setting>
+ <Setting Name="UpdateForceCheck" Type="System.Boolean" Scope="Application">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
//Must delay opening the upgrade window
//to avoid Windows Messages sent by the TaskbarIcon
TaskEx.Delay(5000).ContinueWith(_=>
- Execute.OnUIThread(()=> _sparkle.StartLoop(true,true,Settings.UpdateCheckInterval)));
+ Execute.OnUIThread(()=> _sparkle.StartLoop(true,Settings.UpdateForceCheck,Settings.UpdateCheckInterval)));
StartMonitoring();
<setting name="FileIdleTimeout" serializeAs="String">
<value>00:00:10</value>
</setting>
+ <setting name="UpdateForceCheck" serializeAs="String">
+ <value>True</value>
+ </setting>
</Pithos.Client.WPF.Properties.Settings>
</applicationSettings>
<log4net>
[Test]
public void TestDownload()
{
- var fileAgent = new FileAgent(100) {CachePath = @"e:\pithos\.pithos.cache"};
-
var agent = new NetworkAgent();
- var account = "890329@vho.grnet.gr";
- var apiKey = "24989dce4e0fcb072f8cb60c8922be19";
+ var account = "";
+ var apiKey = "";
var client = new CloudFilesClient(account,apiKey)
{
AuthenticationUrl = @"https://pithos.dev.grnet.gr",
private FileEventIdleBatch _eventIdleBatch;
- public FileAgent(int idleTimeout)
- {
- _eventIdleBatch=new FileEventIdleBatch(idleTimeout,ProcessBatchedEvents);
- }
+ public TimeSpan IdleTimeout { get; set; }
+
private void ProcessBatchedEvents(Dictionary<string, FileSystemEventArgs[]> fileEvents)
{
throw new ArgumentNullException("rootPath");
if (!Path.IsPathRooted(rootPath))
throw new ArgumentException("rootPath must be an absolute path","rootPath");
+ if (IdleTimeout == null)
+ throw new InvalidOperationException("IdleTimeout must have a valid value");
Contract.EndContractBlock();
AccountInfo = accountInfo;
RootPath = rootPath;
+
+ _eventIdleBatch = new FileEventIdleBatch((int)IdleTimeout.TotalMilliseconds, ProcessBatchedEvents);
+
_watcher = new FileSystemWatcher(rootPath) {IncludeSubdirectories = true,InternalBufferSize=8*4096};
_adapter = new FileSystemWatcherAdapter(_watcher);
public PithosMonitor()
{
- FileAgent = new FileAgent((int)Settings.FileIdleTimeout.TotalMilliseconds);
-
+ FileAgent = new FileAgent();
}
private bool _started;
Log.DebugFormat("Start Folder Monitoring [{0}]",RootPath);
AgentLocator<FileAgent>.Register(FileAgent,RootPath);
-
+
+ FileAgent.IdleTimeout = Settings.FileIdleTimeout;
FileAgent.StatusKeeper = StatusKeeper;
FileAgent.StatusNotification = StatusNotification;
FileAgent.Workflow = Workflow;