Example #1
0
        /// <summary>
        /// Nuskaito faila
        /// </summary>
        /// <param name="failas"></param>
        /// <param name="Spectators"></param>
        void ReadFileData(string failas, SpectatorBranch Spectators)
        {
            using (StreamReader reader = new StreamReader(failas))
            {
                string name    = reader.ReadLine();
                int    years   = int.Parse(reader.ReadLine());
                string address = reader.ReadLine();

                Spectator     spectator = new Spectator(name, years, address, 0);
                FilmContainer filmas    = new FilmContainer();

                string line = null;
                while (null != (line = reader.ReadLine()))
                {
                    string[] segment = line.Split(';');
                    Film     film;
                    Serialas serialas;


                    if (segment.Length == 8)
                    {
                        film = new Film(line);
                        spectator.Films.AddFilm(film);
                    }
                    else
                    {
                        serialas = new Serialas(line);
                        spectator.Films.AddFilm(serialas);
                    }
                }
                Spectators.AddSpectator(spectator);
            }
        }
Example #2
0
 public void AddSpectator(Spectator ziurov, int index)
 {
     Spectators[index] = ziurov;
 }
Example #3
0
 public void AddSpectator(Spectator ziurov)
 {
     Spectators[Count++] = ziurov;
 }