예제 #1
0
 public static void TagAnnSourceDefault(this LitOptions LO, MDAnnSource source)
 {
     foreach (var sourceFile in source.Sources)
     {
         LO.TagSourceFile(sourceFile);
     }
 }
예제 #2
0
        /// <summary>
        /// Depricated
        /// </summary>
        /// <param name="source"></param>
        /// <param name="novel"></param>
        //public static void SetAllLitSourceInfo(this LitAnnSource source, LitNovel novel) {
        //	foreach (var sourcefile in source.Sources) {
        //		sourcefile.ParseLitSourceInfo(novel);
        //	}
        //}
        /// <summary>
        /// I shouldn't ever use this function
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        public static List <String> AllLines(this MDAnnSource source)
        {
            var retVal = new List <String>();

            foreach (var sourcefile in source.Sources)
            {
                retVal.AddRange(sourcefile.Lines);
            }
            return(retVal);
        }
예제 #3
0
 public static void WriteToFileSystemDefault(this LitOptions LO,
                                             MDAnnSource sourceObjects,
                                             MDAnnSourceInfo info
                                             )
 {
     foreach (var source in sourceObjects.Sources)
     {
         System.IO.File.WriteAllLines(LO.ToLongSourceFilename(info, source), source.Lines);
     }
     System.IO.File.WriteAllLines(LO.ToLongNotesFilename(info), sourceObjects.Notes.Lines);
     System.IO.File.WriteAllLines(LO.ToLongTagFilename(info), sourceObjects.TagFile.Lines);
 }
예제 #4
0
        /// <summary>
        /// Takes the source info, and compiles it all together into a LitAnnSource object
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static MDAnnSource BuildAnnSourceDefault(
            this LitOptions LO,
            MDAnnSourceInfo info
            )
        {
            var retVal = new MDAnnSource();

            var files = LO.BuildSourceFilenames(info);

            retVal.Sources = LO.BuildSourceFiles(info, files);
            retVal.Notes   = LO.BuildNotesFile(info, files);

            return(retVal);
        }
예제 #5
0
        /// <summary>
        /// This is the kickoff point for where the magic happens
        /// </summary>
        /// <param name="source"></param>
        /// <param name="LO"></param>
        /// <returns></returns>
        public static LitNovel ParseAnnSourceDefault(this LitOptions LO, MDAnnSource source)
        {
            var retVal = new LitNovel();

            //Preliminary tagging
            LO.TagAnnSource(source);

            //Parse the current notes file and fill the novel with current references
            LO.ParseNotesFile(retVal, source.Notes);

            //Parse all of the source files
            foreach (var sourceFile in source.Sources)
            {
                LO.ParseSourceFile(retVal, sourceFile);
            }

            return(retVal);
        }
예제 #6
0
 public static void WriteToFileSystemRaw(
     this LitOptions LO,
     MDAnnSource sourceObjects,
     MDAnnSourceInfo info
     )
 {
     foreach (var source in sourceObjects.Sources)
     {
         String dir = String.Format("{0}\\{1}", info.BaseDir, info.Prefix);
         if (!System.IO.Directory.Exists(dir))
         {
             System.IO.Directory.CreateDirectory(dir);
         }
         System.IO.File.WriteAllLines(
             LO.ToLongSourceFilename(info, source),
             source.Lines
             );
     }
 }
예제 #7
0
        /// <summary>
        /// Kick off point for creating the source objects out of the novel
        /// </summary>
        /// <param name="novel"></param>
        /// <returns></returns>
        public static MDAnnSource WriteAnnSourceDefault(
            this LitOptions LO,
            LitNovel novel
            )
        {
            var retVal = new MDAnnSource();

            //Write source files
            foreach (var author in novel.Authors)
            {
                foreach (var metadata in novel.SceneMetadata)
                {
                    retVal.Sources.Add(LO.WriteSourceFile(novel, metadata, author));
                }
            }
            //Write notes file
            retVal.Notes = LO.WriteNotesFile(novel);

            return(retVal);
        }
        public static MDAnnSource WriteAnnSourceNovel(
            this LitOptions LO,
            LitNovel novel
            )
        {
            var retVal = new MDAnnSource();
            var list   = new List <MDSourceFile>();

            foreach (var scene in novel.Scenes)
            {
                list.AddRange(
                    WriteSourceFileNovel(
                        LO,
                        new[] { scene.Header },
                        new String [] { },
                        scene,
                        novel.Authors.First()
                        )
                    );
            }
            retVal.Sources = list;
            return(retVal);
        }