Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if the DocumentObject contains a fact with a lower ID number,
        /// or false if it doesn't.
        /// </summary>
        /// <param name="givenID"></param>
        /// <returns></returns>
        public bool IsThereALowerFactID(int givenID)
        {
            var lowestIDnumber = TotalFacts.Min(f => f.ID);

            if (givenID == lowestIDnumber)
            {
                return(false);
            }
            if (givenID < lowestIDnumber)
            {
                throw new IndexOutOfRangeException($"*Could not process Fact ID {givenID} in sequence of count: {lowestIDnumber}");
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks the number of facts in the TotalFacts list,
        /// based off that, instantiates a new Fact with the
        /// subsequent ID number and incoming string selection.
        /// </summary>
        public void CreateFact(string selection)
        {
            var newID = TotalFacts.Count();

            TotalFacts.Add(new Fact(newID, selection, Ea));
        }