Exemplo n.º 1
0
        public static Document Parse(String fileName, bool answers, bool proofs)
        {
            string[] words;
            Document document = new Document();

            words         = fileName.Split('~');
            document.Type = words[0];
            switch (words[0].ToUpper())
            {
            case "CONFESSION": document = Confession.Parse(fileName, proofs); break;

            case "CATECHISM": document = Catechism.Parse(fileName, answers, proofs); break;

            case "CREED": document = Creed.Parse(fileName); break;

            default:
                ProcessError(String.Format("{0} is an invalid " + "Document type value for the Document " + "class Parse method", words[0]));
                break;
            }
            return(document);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parsing Documents into Catechism entries
        /// </summary>
        /// <param name="stringValue"></param>
        /// <param name="answers">Answers?</param>
        /// <param name="proofs">Proofs?</param>
        /// <returns></returns>
        public static new Catechism Parse(string stringValue, bool answers, bool proofs)
        {
            string[]  words;
            Catechism catechism = new Catechism();

            words              = stringValue.Split('~');
            catechism.Type     = words[0];
            catechism.IDNumber = Int32.Parse(words[1]);
            catechism.question = words[2];
            if (answers == true)
            {
                catechism.answer = words[3];
            }
            else
            {
                catechism.answer = "";
            }

            catechism.Title = words[4];
            if (proofs == true)
            {
                if (words[5] == "")
                {
                    catechism.Proofs = "No Proofs available";
                }
                else
                {
                    catechism.Proofs = words[5];
                }
            }
            else
            {
                catechism.Proofs = "";
            }

            catechism.DocTitle = words[6];
            catechism.Tags     = words[7];
            return(catechism);
        }
Exemplo n.º 3
0
 public void Copy(Catechism catechisms)
 {
     this.question = catechisms.question; this.answer = catechisms.answer;
 }
Exemplo n.º 4
0
 public Catechism(Catechism sourceCatechism) : base(sourceCatechism)
 {
     this.Copy(sourceCatechism);
 }