コード例 #1
0
        public EMDocument Get(string path)
        {
            FailWhenDisposed();

            if (IsCurrentFile(path))
            {
                return(CurrentFileDocument);
            }

            linkedFilesCacheLock.EnterWriteLock();
            try
            {
                ProcessedDocumentCacheElement output;

                if (!linkedFilesCache.TryGetValue(path, out output))
                {
                    output = new ProcessedDocumentCacheElement(path, TransformationData.Markdown.Preprocessor, this);
                    linkedFilesCache.Add(path, output);
                }

                return(output.Document);
            }
            finally
            {
                linkedFilesCacheLock.ExitWriteLock();
            }
        }
コード例 #2
0
        public EMDocument Get(string path)
        {
            FailWhenDisposed();

            if (IsCurrentFile(path))
            {
                return CurrentFileDocument;
            }

            linkedFilesCacheLock.EnterWriteLock();
            try
            {
                ProcessedDocumentCacheElement output;

                if (!linkedFilesCache.TryGetValue(path, out output))
                {
                    output = new ProcessedDocumentCacheElement(path, TransformationData.Markdown.Preprocessor, this);
                    linkedFilesCache.Add(path, output);
                }

                return output.Document;
            }
            finally
            {
                linkedFilesCacheLock.ExitWriteLock();
            }
        }