~ubuntu-branches/ubuntu/lucid/gnome-subtitles/lucid

« back to all changes in this revision

Viewing changes to sublib-0.7/src/SubLib/Application/IncompleteSubtitleCollection.cs

  • Committer: Bazaar Package Importer
  • Author(s): Tiago Bortoletto Vaz
  • Date: 2007-12-03 20:52:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071203205252-2y6uuv4gcw9mi9n5
Tags: 0.7-1
* New upstream release;
* Add libxml-parser-perl to Build-Depends-Indep. Thanks to Lucas Nussbaum.
  (Closes: #445799);
* Fixes manpage issue with dpatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of SubLib.
3
 
 * Copyright (C) 2005-2006 Pedro Castro
4
 
 *
5
 
 * SubLib is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * SubLib is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
using System.Collections;
21
 
 
22
 
namespace SubLib {
23
 
        
24
 
/// <summary>A container that represents a collection of incomplete subtitles.</summary>
25
 
public class IncompleteSubtitleCollection {
26
 
        private ArrayList subtitles = new ArrayList();
27
 
        
28
 
        
29
 
        /// <summary>The number of subtitles in the collection.</summary>
30
 
        public int Count {
31
 
                get { return subtitles.Count; }
32
 
        }
33
 
        
34
 
        /// <summary>Returns an enumerator that can iterate through the collection.</summary>
35
 
        /// <returns>An <see cref="IEnumerator" /> for the entire <see cref="IncompleteSubtitleCollection" />.</returns>
36
 
        public IEnumerator GetEnumerator () {
37
 
                return subtitles.GetEnumerator();
38
 
        }
39
 
        
40
 
        /// <summary>Returns the subtitle at the specified index.</summary>
41
 
        /// <param name="index">The zero-based subtitle's index.</param>
42
 
        /// <returns>The subtitle at the specified index.</returns>
43
 
        public IncompleteSubtitle Get (int index){
44
 
                return (IncompleteSubtitle)subtitles[index];
45
 
        }
46
 
        
47
 
        /// <summary>Adds an incomplete subtitle to the end of the collection.</summary>
48
 
        /// <param name="subtitle">The subtitle to add.</param>
49
 
        public void Add (IncompleteSubtitle subtitle){
50
 
                subtitles.Add(subtitle);
51
 
        }
52
 
        
53
 
        /// <summary>Adds an incomplete subtitle to the collection, inserting it at the specified index.</summary>
54
 
        /// <param name="subtitle">The subtitle to add.</param>
55
 
        /// <param name="index">The zero-based index at which the subtitle should be inserted.</param>
56
 
        public void Add (IncompleteSubtitle subtitle, int index){
57
 
                subtitles.Insert(index, subtitle);
58
 
        }
59
 
 
60
 
        public override string ToString(){
61
 
                string result = "\t* SUBTITLE LIST *\n";
62
 
                foreach(IncompleteSubtitle subtitle in subtitles){
63
 
                        result += subtitle.ToString();
64
 
                }
65
 
                return result;
66
 
        }
67
 
 
68
 
}
69
 
 
70
 
}