public void GenerateComponent(IProject project, IComponentDescriptor cdesc)
 {
     var docproj = project as DocumentationProject;
     if (docproj == null)
         throw new ArgumentException("Expected a documentation project");
     var docs = ((DescriptorBase)cdesc).GetDocumentation();
     string prefix = cdesc.GetFullName().Replace(".", "/");
     foreach (var doc in docs.Documents)
     {
         string legalName = doc.Name.Replace('<', '_').Replace('>', '_');
         string name = prefix + "/" + legalName;
         string path = docproj.AddFile(name);
         var fs = LongPathFile.Open(path, FileMode.Create, FileAccess.Write);
         var wr = new StreamWriter(fs);
         wr.WriteLine(doc.Content.ToString());
         wr.Close();
     }
 }
Пример #2
0
        public void GenerateComponent(IProject project, IComponentDescriptor cdesc)
        {
            var docproj = project as DocumentationProject;

            if (docproj == null)
            {
                throw new ArgumentException("Expected a documentation project");
            }
            var    docs   = ((DescriptorBase)cdesc).GetDocumentation();
            string prefix = cdesc.GetFullName().Replace(".", "/");

            foreach (var doc in docs.Documents)
            {
                string legalName = doc.Name.Replace('<', '_').Replace('>', '_');
                string name      = prefix + "/" + legalName;
                string path      = docproj.AddFile(name);
                var    fs        = LongPathFile.Open(path, FileMode.Create, FileAccess.Write);
                var    wr        = new StreamWriter(fs);
                wr.WriteLine(doc.Content.ToString());
                wr.Close();
            }
        }