コード例 #1
0
        protected IEnumerable <IContentFile> GetContentFiles(IContainerFile owner, IEnumerable <String> paths)
        {
            var resultContentFiles = new List <IContentFile>();

            foreach (var path in paths)
            {
                if (owner.ContainsContentFileWithPath(path))
                {
                    var contentFile = owner.GetContentFileByPath(path);
                    resultContentFiles.Add(contentFile);
                }
                else
                {
                    //Wygląda na to że nie można tu chyba użyć wyjątku na tym etapie, jako że niektóre ścieżki,
                    //które trafia do tej metody mogą pochodzić od komend które dopiero tworzą content,
                    //więc wystąpił by wyjatek w teoretycznie poprawnej sytuacji.
                    var warning = String.Format("The following content file: \"{0}\"" +
                                                "cannot be get from the specified container file.", path);
                    Common.Logging.LoggerFactory.Create(this.GetType()).Warn(warning);
                }
            }

            return(resultContentFiles);
        }