コード例 #1
0
            public ProcessedDocumentCacheElement(string path, Preprocessor preprocessor, ProcessedDocumentCache cache)
            {
                this.path = path;
                this.preprocessor = preprocessor;
                this.cache = cache;

                Reload();
                
                watcher = new FileWatcher(path);
                watcher.Changed += (sender, args) => Reload();
            }
コード例 #2
0
        public PreprocessedData(EMDocument document, ProcessedDocumentCache manager)
        {
            Excerpts = new ExcerptsManager(this);
            Variables = new VariableManager(this);
            Metadata = new MetadataManager(this);
            ReferenceLinks = new ReferenceLinksManager(this);
            TextMap = new PreprocessedTextLocationMap();
            PreprocessedTextBounds = new List<PreprocessedTextBound>();

            Document = document;

            this.manager = manager;
        }
コード例 #3
0
        public TransformationData(Markdown markdown, List<ErrorDetail> errorList, List<ImageConversion> imageDetails,
            List<AttachmentConversionDetail> attachNames, FolderDetails currentFolderDetails, IEnumerable<string> languagesLinksToGenerate = null, bool nonDynamicHTMLOutput = false)
        {
            NonDynamicHTMLOutput = nonDynamicHTMLOutput;
            AttachNames = attachNames;
            CurrentFolderDetails = new FolderDetails(currentFolderDetails);
            ErrorList = errorList;
            ImageDetails = imageDetails;
            LanguagesLinksToGenerate = languagesLinksToGenerate ?? markdown.SupportedLanguages;

            HtmlBlocks = new Dictionary<string, string>();
            FoundDoxygenSymbols = new HashSet<string>();
            Markdown = markdown;

            processedDocumentCache = new ProcessedDocumentCache(currentFolderDetails.GetThisFileName(), this);
        }
コード例 #4
0
        public static EMExcerpt Get(
            ProcessedDocumentCache manager, string folderPath, string lang, string excerptName, out bool languageChanged)
        {
            var folder = new DirectoryInfo(folderPath);

            if (!folder.Exists)
            {
                throw new ExcerptFolderNotFoundException(folder.FullName);
            }

            FileInfo chosenFile;
            languageChanged = false;

            if (lang.ToLower() != "int")
            {
                var languageFileInfo = folder.GetFiles("*." + lang + ".udn");

                if (languageFileInfo.Length == 0)
                {
                    var intFileInfo = folder.GetFiles("*.INT.udn");

                    if (intFileInfo.Length == 0)
                    {
                        throw new ExcerptLocFileNotFoundException(Path.Combine(folder.FullName, "*." + lang + ".udn"));
                    }

                    languageChanged = true;
                    chosenFile = intFileInfo[0];
                }
                else
                {
                    chosenFile = languageFileInfo[0];
                }
            }
            else
            {
                var intFileInfo = folder.GetFiles("*.INT.udn");

                if (intFileInfo.Length == 0)
                {
                    throw new ExcerptFileNotFoundException(Path.Combine(folder.FullName, "*.INT.udn"));
                }

                chosenFile = intFileInfo[0];
            }

            return manager.Get(chosenFile.FullName).Excerpts.GetExcerpt(excerptName);
        }
コード例 #5
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed || !disposing)
            {
                return;
            }

            ProcessedDocumentCache.Dispose();
            processedDocumentCache = null;

            disposed = true;
        }