CmisSync.Lib.RepoBase.Initialize C# (CSharp) Метод

Initialize() публичный Метод

Initialize the watcher.
public Initialize ( ) : void
Результат void
        public void Initialize()
        {
            this.Watcher.ChangeEvent += OnFileActivity;

            // Sync up everything that changed
            // since we've been offline
            if (RepoInfo.SyncAtStartup)
            {
                SyncInBackground();
                Logger.Info(String.Format("Repo {0} - sync launch at startup", RepoInfo.Name));
            }
            else
            {
                Logger.Info(String.Format("Repo {0} - sync not launch at startup", RepoInfo.Name));
                // if LastSuccessSync + pollInterval >= DateTime.Now => Sync
                DateTime tm = RepoInfo.LastSuccessedSync.AddMilliseconds(RepoInfo.PollInterval);
                // http://msdn.microsoft.com/fr-fr/library/system.datetime.compare(v=vs.110).aspx
                if (DateTime.Compare(DateTime.Now, tm) >= 0)
                {
                    SyncInBackground();
                    Logger.Info(String.Format("Repo {0} - sync launch based on last success time sync + poll interval", RepoInfo.Name));
                }
                else
                {
                    Logger.Info(String.Format("Repo {0} - sync not launch based on last success time sync + poll interval - Next sync at {1}", RepoInfo.Name, tm));
                }
            }
        }