Exemplo n.º 1
0
        public static void Verify(DirectoryInfo dir)
        {
            var sizes     = Enum.GetValues(typeof(DrawableFolders)).Cast <DrawableFolders>();
            var resources = FindResourceDirectory(dir);

            if (resources == null)
            {
                return;
            }

            var folders = sizes.Select(s => new DrawableFolder(resources, s));

            foreach (var missing in folders.Where(f => !f.Exists && f.WarnIfMissing))
            {
                Warn("Missing drawable folder {0}", missing);
            }
            foreach (var error in DrawableFolder.FindErrors(folders))
            {
                Warn(error.ToString());
            }

            if (_warnings == 0 && _errors == 0)
            {
                Write("Success");
            }
            else
            {
                Write(string.Empty);
                Write("Completed with");
                Error("    {0} error(s)", _errors);
                Warn("    {0} warnings(s)", _warnings);
            }
        }
Exemplo n.º 2
0
 private IEnumerable <Error> CompareContents(DrawableFolder otherFolder)
 {
     if (this != otherFolder && IsMainDrawable && otherFolder.IsMainDrawable)
     {
         foreach (var file in Resources)
         {
             if (!otherFolder.Resources.Contains(file))
             {
                 yield return(new Error(string.Format("{0} contains a file not in {1}:  {2}", this, otherFolder, file)));
             }
         }
     }
 }