Example #1
0
        void PrepareParseFileList()
        {
            List <string> ParseFileList = new List <string>();
            List <string> TempList      = new List <string>();

            foreach (string F in Settings.IncludePathList)
            {
                if (File.Exists(F))
                {
                    TempList.Add(F);
                }
                else if (Directory.Exists(F))
                {
                    TempList.AddRange(Directory.GetFiles(F));
                }
            }

            foreach (string FilePath in TempList)
            {
                if (ParseFileList.FirstOrDefault(item => item.IsSameText(FilePath)) == null)
                {
                    if (IsIncludeMatch(FilePath) && !IsExcludeMatch(FilePath))
                    {
                        ParseFileList.Add(FilePath);
                    }
                }
            }

            if (ParseFileList.Count == 0)
            {
                Sys.Error("No files to parse");
            }

            FilePaths = ParseFileList.ToArray();
        }
Example #2
0
        /* construction */
        /// <summary>
        /// Constructor
        /// </summary>
        public HtmlTagBuilder(string TagName)
        {
            if (string.IsNullOrWhiteSpace(TagName))
            {
                Sys.Error("Can NOT create Tag. TagName is null or empty");
            }

            this.TagName = TagName;
        }
Example #3
0
        /// <summary>
        /// Finds and returns an instance of a template module by name.
        /// <para>Throws an exception if the module is not found.</para>
        /// </summary>
        static internal IDocTemplateModule GetTemplateModule(string Name)
        {
            IDocTemplateModule Result = Modules.FirstOrDefault(item => Name.IsSameText(item.Name));

            if (Result == null)
            {
                Sys.Error("Template module not found: {0}", Name);
            }

            return(Result);
        }
Example #4
0
        /// <summary>
        /// Adds and returns a child tag
        /// </summary>
        public HtmlTagBuilder AddTag(string TagName)
        {
            if (string.IsNullOrWhiteSpace(TagName))
            {
                Sys.Error("Can NOT add Tag. TagName is null or empty");
            }

            HtmlTagBuilder Result = new HtmlTagBuilder(TagName);

            AddTag(Result);
            return(Result);
        }
Example #5
0
        /* internal */
        static internal Parser Execute(string ConfigFilePath)
        {
            if (!File.Exists(ConfigFilePath))
            {
                Sys.Error("Config not found: {0}", ConfigFilePath);
            }

            Settings Settings = new Settings();

            Settings.Load(ConfigFilePath);

            return(Execute(Settings));
        }
Example #6
0
        /* public */
        /// <summary>
        /// Executes the parsing and the documentation generation
        /// </summary>
        static public DocItemGlobal Execute(string ConfigFilePath)
        {
            if (!File.Exists(ConfigFilePath))
            {
                Sys.Error("Config not found: {0}", ConfigFilePath);
            }

            Settings Settings = new Settings();

            Settings.Load(ConfigFilePath);

            Parser Parser = Parser.Execute(ConfigFilePath);

            return(Parser.Global);
        }
Example #7
0
        /// <summary>
        /// Adds a tag as a child
        /// </summary>
        public void AddTag(HtmlTagBuilder Tag)
        {
            if (Tag == null)
            {
                Sys.Error("Can NOT add Tag. Tag is null");
            }

            if (Items == null)
            {
                Items = new List <object>();
            }

            if (Items.Contains(Tag))
            {
                Sys.Error("Can NOT add Tag. Tag is already added. TagName: {0}", Tag.TagName);
            }

            Items.Add(Tag);
        }
Example #8
0
        /// <summary>
        /// Adds a css class
        /// </summary>
        public void AddCssClass(string Value)
        {
            if (string.IsNullOrWhiteSpace(Value))
            {
                Sys.Error("Can NOT add a css class. Css class name is null or empty");
            }

            var Classes = GetAttribute("class");

            if (string.IsNullOrWhiteSpace(Classes))
            {
                Attributes["class"] = Value;
            }
            else
            {
                string[] Parts = Classes.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (Parts != null && Parts.Length > 0)
                {
                    List <string> ClassList = new List <string>(Parts);
                    ClassList.Add(Value);
                    Attributes["class"] = string.Join(" ", ClassList.ToArray());
                }
            }
        }