/// <summary> /// Constructor. /// </summary> public RepoBase(RepoInfo repoInfo, IActivityListener activityListener) { RepoInfo = repoInfo; LocalPath = repoInfo.TargetDirectory; Name = repoInfo.Name; RemoteUrl = repoInfo.Address; this.activityListener = activityListener; folderLock = new FolderLock(LocalPath); Watcher = new Watcher(LocalPath); Watcher.EnableRaisingEvents = true; // Main loop syncing every X seconds. remote_timer.Elapsed += delegate { // Synchronize. SyncInBackground(); }; remote_timer.AutoReset = true; Logger.Info("Repo " + repoInfo.Name + " - Set poll interval to " + repoInfo.PollInterval + "ms"); remote_timer.Interval = repoInfo.PollInterval; //Partial sync interval.. local_timer.Elapsed += delegate { // Run partial sync. SyncInBackground(false); }; local_timer.AutoReset = false; local_timer.Interval = delay_interval; }
/// <summary> /// Initialize the controller. /// </summary> /// <param name="firstRun">Whether it is the first time that CmisSync is being run.</param> public virtual void Initialize(Boolean firstRun) { this.firstRun = firstRun; FoldersPath = ConfigManager.CurrentConfig.FoldersPath; // Create the CmisSync folder and add it to the bookmarks bool syncFolderCreated = CreateCmisSyncFolder(); if (syncFolderCreated) { AddToBookmarks(); } if (firstRun) { ConfigManager.CurrentConfig.Notifications = true; } folderLock = new FolderLock(FoldersPath); }
/// <summary> /// Initialize the controller. /// </summary> /// <param name="firstRun">Whether it is the first time that CmisSync is being run.</param> public virtual void Initialize(Boolean firstRun) { this.firstRun = firstRun; // Create the CmisSync folder and add it to the bookmarks bool syncFolderCreated = CreateCmisSyncFolder(); if (syncFolderCreated) { //Dont add bookmark for Oris4 AddToBookmarks(); } if (firstRun) { ConfigManager.CurrentConfig.Notifications = true; } folderLock = new FolderLock(FoldersPath); autoUpdater = new Sparkle("http://update.oris4.com/versioninfo.xml") { //ShowDiagnosticWindow = true, //EnableSystemProfiling = true, //SystemProfileUrl = new Uri("http://update.oris4.com/profile.html"), }; autoUpdater.StartLoop(true, true); }