示例#1
0
 public bool HasChanged(AddinFileSystemExtension fs, string md5)
 {
     if (md5 != null && ScanDataMD5 != null)
     {
         return(md5 != ScanDataMD5);
     }
     return(fs.GetLastWriteTime(File) != LastScan);
 }
示例#2
0
        public List <AddinFileInfo> GetMissingAddins(AddinFileSystemExtension fs)
        {
            var missing = new List <AddinFileInfo> ();

            if (!fs.DirectoryExists(folder))
            {
                // All deleted
                foreach (AddinFileInfo info in files.Values)
                {
                    if (info.IsAddin)
                    {
                        missing.Add(info);
                    }
                }
                files.Clear();
                return(missing);
            }
            var toDelete = new List <string> ();

            foreach (AddinFileInfo info in files.Values)
            {
                if (!fs.FileExists(info.File))
                {
                    if (info.IsAddin)
                    {
                        missing.Add(info);
                    }
                    toDelete.Add(info.File);
                }
                else if (info.IsAddin && info.Domain != GetDomain(info.IsRoot))
                {
                    missing.Add(info);
                }
            }
            foreach (string file in toDelete)
            {
                files.Remove(file);
            }

            return(missing);
        }