コード例 #1
0
        public static Preparation Factory(XmlNode item          = null,
                                          string parName        = null,
                                          int?parDuration       = null,
                                          string parDescription = null,
                                          bool?parObligatory    = null)
        {
            string initialName;
            int?   initialDuration;
            string initialDescription;
            bool?  initialObligatory;

            if (item == null)
            {
                initialName        = parName;
                initialDuration    = parDuration;
                initialDescription = parDescription;
                initialObligatory  = parObligatory;
            }
            else
            {
                initialName     = item["Name"].InnerText;
                initialDuration = int.Parse(item["Duration"].InnerText);
                //string buffer = ;
                initialDescription = item["Description"].InnerText;
                initialObligatory  = bool.Parse(item["Obligatory"].InnerText);
            }

            Preparation preparation = new Preparation(initialName, initialDuration, initialObligatory);

            preparation.Description = initialDescription;

            return(preparation);
        }
コード例 #2
0
        public static Preparations Builder(XmlNode item)
        {
            Preparations result = new Preparations();

            foreach (XmlNode node in item.ChildNodes)
            {
                Preparation pItem = Preparation.Factory(node);
                result.Add(pItem);
            }

            return(result);
        }
コード例 #3
0
 public void Add(Preparation item)
 {
     Validation.IsNull(item);
     this.preparationList.Add(item);
 }