Пример #1
0
        protected internal FileReference FindFileFromItem(ITaskItem item)
        {
            string targetPath = item.GetMetadata(ItemMetadataNames.targetPath);

            if (String.IsNullOrEmpty(targetPath))
            {
                targetPath = BaseReference.GetDefaultTargetPath(item.ItemSpec);
            }
            foreach (FileReference file in _manifest.FileReferences)
            {
                if (String.Compare(targetPath, file.TargetPath, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    return(file);
                }
            }
            return(AddFileFromItem(item));
        }
Пример #2
0
        protected internal FileReference FindFileFromItem(ITaskItem item)
        {
            string metadata = item.GetMetadata("TargetPath");

            if (string.IsNullOrEmpty(metadata))
            {
                metadata = BaseReference.GetDefaultTargetPath(item.ItemSpec);
            }
            foreach (FileReference reference in this.manifest.FileReferences)
            {
                if (string.Compare(metadata, reference.TargetPath, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    return(reference);
                }
            }
            return(this.AddFileFromItem(item));
        }