コード例 #1
0
 public ModifyListNameForm(string user)
 {
     InitializeComponent();
     editWindowTitle("Create List");
     list = null;
     this.user = user;
     fillPopup();
 }
コード例 #2
0
 public ModifyListNameForm(MovieList list)
 {
     InitializeComponent();
     editWindowTitle("Edit List Name");
     this.list = list;
     this.user = null;
     nameBox.Text = list.name;
     fillPopup();
 }
コード例 #3
0
 public ModifyListNameForm(long ID)
 {
     MovieList list = MovieListManager.getMovieList(ID);
     InitializeComponent();
     editWindowTitle("Edit List Name");
     this.list = list;
     this.user = null;
     nameBox.Text = list.name;
     fillPopup();
 }
コード例 #4
0
 public RemoveFromListsForm(MovieList list)
 {
     InitializeComponent();
     editWindowTitle("Edit List");
     editTitle("Manage " + list.name);
     editSubTitle("");
     EditToolTip("Uncheck boxes to remove movies. Press Ok to save changes.");
     showActionButton(true);
     editActionButton("Search for a Movie");
     showTextBox(false);
     ml = list;
     fillOutForm(list);
 }
コード例 #5
0
        public static List<FormError> createMovieList(string lname, string username)
        {
            List<FormError> errors = new List<FormError>();

            MovieList ml = new MovieList() { ID = DataAccess.generateID(), name = lname, user = username };

            if (ml.valid(errors))
            {
                List<MovieList> mls = DataAccess.readMovieLists();
                mls.Add(ml);
                DataAccess.writeMovieLists(mls);
            }

            return errors;
        }
コード例 #6
0
        private void fillInForm(MovieList movieList)
        {
            listDataGrid.ColumnHeadersVisible = true;
            listTitleLabel.Text = movieList.name;
            listIDLabel.Hide();
            listIDLabel.Text = "" + movieList.ID;

            if(ApplicationManager.loggedIn != null && ApplicationManager.loggedIn.username.Equals(movieList.user))
            {
                editNameButton.Show();
                editContentsButton.Show();
                editOrderButton.Show();
            }
            else
            {
                editNameButton.Hide();
                editContentsButton.Hide();
                editOrderButton.Hide();
            }

            listDataGrid.DataSource = MovieManager.getMovies(movieList.movies);

            newListButton.Hide();
        }
コード例 #7
0
        private void fillOutForm(MovieList list)
        {
            int i;

            foreach (string movie in list.movies)
            {
                box().Items.Add(movie);
            }

            for (i = 0; i < box().Items.Count; i++)
            {
                box().SetItemChecked(i, true);
            }
        }
コード例 #8
0
        public static bool saveMovieList(MovieList list)
        {
            List<MovieList> lists = DataAccess.readMovieLists();
            int i = 0;

            while(i < lists.Count && lists[i].ID != list.ID)
            {
                i++;
            }

            if(i < lists.Count)
            {
                lists[i].movies = list.movies;
                DataAccess.writeMovieLists(lists);
            }

            return false;
        }