Revision 5d7b20e8
b/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs | ||
---|---|---|
231 | 231 |
get { return _settings.FileIdleTimeout; } |
232 | 232 |
} |
233 | 233 |
|
234 |
public bool UpdateForceCheck |
|
235 |
{ |
|
236 |
get { return _settings.UpdateForceCheck; } |
|
237 |
} |
|
238 |
|
|
234 | 239 |
public void Save() |
235 | 240 |
{ |
236 | 241 |
_settings.Save(); |
b/trunk/Pithos.Client.WPF/Properties/Settings.Designer.cs | ||
---|---|---|
361 | 361 |
return ((global::System.TimeSpan)(this["FileIdleTimeout"])); |
362 | 362 |
} |
363 | 363 |
} |
364 |
|
|
365 |
[global::System.Configuration.ApplicationScopedSettingAttribute()] |
|
366 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
367 |
[global::System.Configuration.DefaultSettingValueAttribute("True")] |
|
368 |
public bool UpdateForceCheck { |
|
369 |
get { |
|
370 |
return ((bool)(this["UpdateForceCheck"])); |
|
371 |
} |
|
372 |
} |
|
364 | 373 |
} |
365 | 374 |
} |
b/trunk/Pithos.Client.WPF/Properties/Settings.settings | ||
---|---|---|
92 | 92 |
<Setting Name="FileIdleTimeout" Type="System.TimeSpan" Scope="Application"> |
93 | 93 |
<Value Profile="(Default)">00:00:10</Value> |
94 | 94 |
</Setting> |
95 |
<Setting Name="UpdateForceCheck" Type="System.Boolean" Scope="Application"> |
|
96 |
<Value Profile="(Default)">True</Value> |
|
97 |
</Setting> |
|
95 | 98 |
</Settings> |
96 | 99 |
</SettingsFile> |
b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs | ||
---|---|---|
187 | 187 |
//Must delay opening the upgrade window |
188 | 188 |
//to avoid Windows Messages sent by the TaskbarIcon |
189 | 189 |
TaskEx.Delay(5000).ContinueWith(_=> |
190 |
Execute.OnUIThread(()=> _sparkle.StartLoop(true,true,Settings.UpdateCheckInterval)));
|
|
190 |
Execute.OnUIThread(()=> _sparkle.StartLoop(true,Settings.UpdateForceCheck,Settings.UpdateCheckInterval)));
|
|
191 | 191 |
|
192 | 192 |
|
193 | 193 |
StartMonitoring(); |
b/trunk/Pithos.Client.WPF/app.config | ||
---|---|---|
131 | 131 |
<setting name="FileIdleTimeout" serializeAs="String"> |
132 | 132 |
<value>00:00:10</value> |
133 | 133 |
</setting> |
134 |
<setting name="UpdateForceCheck" serializeAs="String"> |
|
135 |
<value>True</value> |
|
136 |
</setting> |
|
134 | 137 |
</Pithos.Client.WPF.Properties.Settings> |
135 | 138 |
</applicationSettings> |
136 | 139 |
<log4net> |
b/trunk/Pithos.Core.Test/NetworkAgentTest.cs | ||
---|---|---|
70 | 70 |
[Test] |
71 | 71 |
public void TestDownload() |
72 | 72 |
{ |
73 |
var fileAgent = new FileAgent(100) {CachePath = @"e:\pithos\.pithos.cache"}; |
|
74 |
|
|
75 | 73 |
var agent = new NetworkAgent(); |
76 | 74 |
|
77 |
var account = "890329@vho.grnet.gr";
|
|
78 |
var apiKey = "24989dce4e0fcb072f8cb60c8922be19";
|
|
75 |
var account = ""; |
|
76 |
var apiKey = ""; |
|
79 | 77 |
var client = new CloudFilesClient(account,apiKey) |
80 | 78 |
{ |
81 | 79 |
AuthenticationUrl = @"https://pithos.dev.grnet.gr", |
b/trunk/Pithos.Core/Agents/FileAgent.cs | ||
---|---|---|
76 | 76 |
|
77 | 77 |
private FileEventIdleBatch _eventIdleBatch; |
78 | 78 |
|
79 |
public FileAgent(int idleTimeout) |
|
80 |
{ |
|
81 |
_eventIdleBatch=new FileEventIdleBatch(idleTimeout,ProcessBatchedEvents); |
|
82 |
} |
|
79 |
public TimeSpan IdleTimeout { get; set; } |
|
80 |
|
|
83 | 81 |
|
84 | 82 |
private void ProcessBatchedEvents(Dictionary<string, FileSystemEventArgs[]> fileEvents) |
85 | 83 |
{ |
... | ... | |
127 | 125 |
throw new ArgumentNullException("rootPath"); |
128 | 126 |
if (!Path.IsPathRooted(rootPath)) |
129 | 127 |
throw new ArgumentException("rootPath must be an absolute path","rootPath"); |
128 |
if (IdleTimeout == null) |
|
129 |
throw new InvalidOperationException("IdleTimeout must have a valid value"); |
|
130 | 130 |
Contract.EndContractBlock(); |
131 | 131 |
|
132 | 132 |
AccountInfo = accountInfo; |
133 | 133 |
RootPath = rootPath; |
134 |
|
|
135 |
_eventIdleBatch = new FileEventIdleBatch((int)IdleTimeout.TotalMilliseconds, ProcessBatchedEvents); |
|
136 |
|
|
134 | 137 |
_watcher = new FileSystemWatcher(rootPath) {IncludeSubdirectories = true,InternalBufferSize=8*4096}; |
135 | 138 |
_adapter = new FileSystemWatcherAdapter(_watcher); |
136 | 139 |
|
b/trunk/Pithos.Core/PithosMonitor.cs | ||
---|---|---|
164 | 164 |
|
165 | 165 |
public PithosMonitor() |
166 | 166 |
{ |
167 |
FileAgent = new FileAgent((int)Settings.FileIdleTimeout.TotalMilliseconds); |
|
168 |
|
|
167 |
FileAgent = new FileAgent(); |
|
169 | 168 |
} |
170 | 169 |
private bool _started; |
171 | 170 |
|
... | ... | |
409 | 408 |
Log.DebugFormat("Start Folder Monitoring [{0}]",RootPath); |
410 | 409 |
|
411 | 410 |
AgentLocator<FileAgent>.Register(FileAgent,RootPath); |
412 |
|
|
411 |
|
|
412 |
FileAgent.IdleTimeout = Settings.FileIdleTimeout; |
|
413 | 413 |
FileAgent.StatusKeeper = StatusKeeper; |
414 | 414 |
FileAgent.StatusNotification = StatusNotification; |
415 | 415 |
FileAgent.Workflow = Workflow; |
Also available in: Unified diff