Exemple #1
0
        public Superconstructor(ref ObjCollector <Review> reviewCollection, ref ObjCollector <Restaurant> resterauntsCollection)
        {
            nameList   Names       = new nameList();
            Review     tReview     = new Review();
            Restaurant tRestaurant = new Restaurant();

            for (int i = 0; i < Names.beginning.Count; i++)
            {
                for (int o = 0; o < Names.ending.Count; o++)
                {
                    tRestaurant = new Restaurant((Names.beginning[i] + Names.ending[o]), "Texas");
                    resterauntsCollection.Add(tRestaurant);
                }
            }

            for (int i = 0; i < Names.first.Count; i++)
            {
                for (int o = 0; o < Names.last.Count; o++)
                {
                    tReview = new Review("To do", resterauntsCollection[(i + o) % (Names.beginning.Count
                                                                                   + Names.ending.Count)].IDnumber, i + o, (Names.first[i] + Names.last[o]));
                    reviewCollection.Add(tReview);
                }
            }
        }
Exemple #2
0
        public void SerializeCollection(string filename)
        {
            ObjCollector <O> OCollection = new ObjCollector <O>();
            XmlSerializer    xmlSerial   = new XmlSerializer(typeof(ObjCollector <O>));
            TextWriter       writer      = new StreamWriter(filename);

            xmlSerial.Serialize(writer, OCollection);
        }