示例#1
0
        public void Invoke(CompositionContainer container)
        {
            // this is very quick & dirty
            List <string> ldocFiles = new List <string>();

            foreach (var path in this.Path)
            {
                ExtractCommand extract = new ExtractCommand();
                extract.IncludeNonPublic      = this.IncludeNonPublic;
                extract.Filter                = this.Filter;
                extract.IncludeBclDocComments = this.IncludeBclDocComments;
                extract.NamespaceDocPath      = this.NamespaceDocPath;
                extract.Path = path;
                extract.Invoke(container);
                ldocFiles.Add(extract.Output);
            }

            string tempFolder = System.IO.Path.GetTempPath();

            tempFolder = System.IO.Path.Combine(tempFolder, "ldoc_{yyyyMMddHHmmss}");
            var tempDir = Directory.CreateDirectory(tempFolder);

            try
            {
                foreach (var ldocFile in ldocFiles)
                {
                    File.Copy(ldocFile, System.IO.Path.Combine(tempFolder, System.IO.Path.GetFileName(ldocFile)));
                }

                TemplateCommand template = new TemplateCommand();
                template.Path      = tempFolder;
                template.Arguments = this.Arguments;
                template.IgnoreVersionComponent = this.IgnoreVersionComponent;
                template.Output   = this.Output;
                template.Template = this.Template;
                template.Verbose  = this.Verbose;
                template.Invoke(container);
            }
            finally
            {
                // cleanup
                tempDir.Delete(true);
            }
        }
        public void Invoke()
        {
            // this is very quick & dirty
            List<string> ldocFiles = new List<string>();

            foreach (var path in this.Path)
            {
                ExtractCommand extract = new ExtractCommand();
                extract.IncludeNonPublic = this.IncludeNonPublic;
                extract.Filter = this.Filter;
                extract.IncludeBclDocComments = this.IncludeBclDocComments;
                extract.NamespaceDocPath = this.NamespaceDocPath;
                extract.Path = path;
                extract.Invoke();
                ldocFiles.Add(extract.Output);
            }

            string tempFolder = System.IO.Path.GetTempPath();
            tempFolder = System.IO.Path.Combine(tempFolder, "ldoc_{yyyyMMddHHmmss}");
            var tempDir = Directory.CreateDirectory(tempFolder);
            try
            {
                foreach (var ldocFile in ldocFiles)
                {
                    File.Copy(ldocFile, System.IO.Path.Combine(tempFolder, System.IO.Path.GetFileName(ldocFile)));
                }

                TemplateCommand template = new TemplateCommand();
                template.Path = tempFolder;
                template.Arguments = this.Arguments;
                template.IgnoreVersionComponent = this.IgnoreVersionComponent;
                template.Output = this.Output;
                template.Template = this.Template;
                template.Verbose = this.Verbose;
                template.Invoke();
            }
            finally
            {
                // cleanup
                tempDir.Delete(true);
            }
        }