コード例 #1
0
        protected override void AddToContext(string fullPath, IImmutableDictionary <string, string> metadata, bool isActiveContext, IProjectLogger logger)
        {
            string[] folderNames = FileItemServices.GetLogicalFolderNames(Path.GetDirectoryName(_project.FullPath), fullPath, metadata);

            logger.WriteLine("Adding source file '{0}'", fullPath);
            Context.AddSourceFile(fullPath, isInCurrentContext: isActiveContext, folderNames: folderNames);
        }
コード例 #2
0
        private static string GetLinkedParentFolder(IImmutableDictionary <string, string> metadata)
        {
            string linkFilePath = FileItemServices.GetLinkFilePath(metadata);

            if (linkFilePath != null)
            {
                return(Path.GetDirectoryName(linkFilePath));
            }

            return(null);
        }
コード例 #3
0
        private string GetLinkedParentFolder(string filePath, IProjectChangeDescription projectChange)
        {
            var metadata = projectChange.After.Items[filePath];

            string linkFilePath = FileItemServices.GetLinkFilePath(metadata);

            if (linkFilePath != null)
            {
                return(Path.GetDirectoryName(linkFilePath));
            }

            return(null);
        }
コード例 #4
0
        private void AddToContextIfNotPresent(string includePath, IImmutableDictionary <string, string> metadata, IProjectLogger logger)
        {
            string fullPath = _project.MakeRooted(includePath);

            if (!_paths.Contains(fullPath))
            {
                string[]? folderNames = FileItemServices.GetLogicalFolderNames(Path.GetDirectoryName(_project.FullPath), fullPath, metadata);

                logger.WriteLine("Adding dynamic file '{0}'", fullPath);
                Context.AddDynamicFile(fullPath, folderNames);
                bool added = _paths.Add(fullPath);
                Assumes.True(added);
            }
        }