Ejemplo n.º 1
0
        public bool CheckVersionFile(string folder)
        {
            var versionFile = Path.Combine(syncFileService.GetAbsPath(folder), "usync.config");

            if (!syncFileService.FileExists(versionFile))
            {
                return(false);
            }
            else
            {
                try
                {
                    var node   = syncFileService.LoadXElement(versionFile);
                    var format = node.Attribute("format").ValueOrDefault("");
                    if (!format.InvariantEquals(uSyncConstants.FormatVersion))
                    {
                        var expectedVersion = SemVersion.Parse(uSyncConstants.FormatVersion);
                        if (SemVersion.TryParse(format, out SemVersion current))
                        {
                            if (current.CompareTo(expectedVersion) >= 0)
                            {
                                return(true);
                            }
                        }

                        return(false);
                    }
                }
                catch
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
 private bool HasStopFile(string folder)
 => syncFileService.FileExists($"{folder}/usync.stop");