예제 #1
0
 public editMovie(dataManager DataManager)
 {
     InitializeComponent();
     this.DataManager    = DataManager;
     genreCB.DataSource  = Enum.GetValues(typeof(genreEnum));
     ratingCB.DataSource = Enum.GetValues(typeof(ratingEnum));
 }
예제 #2
0
 public editSettings(dataManager dm)
 {
     InitializeComponent();
     this.dm          = dm;
     openWithDir.Text = dm.Settings.vlc;
     stats.Show();
 }
예제 #3
0
 public searchMovie(dataManager dm)
 {
     InitializeComponent();
     resultString     = String.Empty;
     this.DataManager = dm;
     resultList       = new List <info>();
     resultKey        = new List <int>();
 }
예제 #4
0
 public viewMovie(dataManager dm)
 {
     InitializeComponent();
     this.dm = dm;
     actor   = new List <string>();
     moviePanel.Hide(); //Currently, this panel is inactive
     secondsIn.Hide();  //Currently, this value will always be zero
     imageL.Hide();
 }
예제 #5
0
 public newMovie(dataManager DataManager)
 {
     InitializeComponent();
     this.DataManager      = DataManager;
     actors                = new List <string>();
     genreCB.DataSource    = Enum.GetValues(typeof(genreEnum));
     genreCB.SelectedItem  = genreEnum.Unknown;
     ratingCB.DataSource   = Enum.GetValues(typeof(ratingEnum));
     ratingCB.SelectedItem = ratingEnum.Unknown;
     thisThread            = Thread.CurrentThread;
 }
예제 #6
0
        public mainForm()
        {
            InitializeComponent();
            //Maximize Window and adjust sizes
            this.WindowState = FormWindowState.Maximized;
            ratioX           = (1700 / Screen.FromControl(this).WorkingArea.Width);
            ratioY           = (820 / Screen.FromControl(this).WorkingArea.Height);

            //panel enums, used to control what panel is active or was active
            currentPanel = panelAct.mainForm;
            lastPanel    = panelAct.editSettings;
            //Data manager
            DataManager = new dataManager();

            #region Create Forms
            NewMovie     = new newMovie(DataManager);
            SearchMovie  = new searchMovie(DataManager);
            ViewMovie    = new viewMovie(DataManager);
            EditMovie    = new editMovie(DataManager);
            EditSettings = new editSettings(DataManager);
            #endregion

            #region Setup Forms
            NewMovie.VerticalScroll.Enabled     = false;
            ViewMovie.VerticalScroll.Enabled    = false;
            EditMovie.VerticalScroll.Enabled    = false;
            EditSettings.VerticalScroll.Enabled = false;
            SearchMovie.VerticalScroll.Enabled  = false;
            mainPanel.VerticalScroll.Enabled    = false;
            this.VerticalScroll.Enabled         = false;
            NewMovie.Dock     = DockStyle.Bottom;
            EditSettings.Dock = DockStyle.Bottom;
            ViewMovie.Dock    = DockStyle.Bottom;
            EditMovie.Dock    = DockStyle.Bottom;
            #endregion

            mainPanel.Controls.Add(SearchMovie);



            #region Delegates
            EditMovie.deleteEntry += delegate(object sender, EventArgs e) //EditMovie>Delete Button
            {
                toggleControls(panelAct.mainForm);
                newMovieButton.Text = "New Movie";
                EditMovie.clearAll();
                SearchMovie.searchButton_Click(null, null);
            };

            ViewMovie.actorEvent += delegate(object sender, EventArgs e) //ViewMovie>Double Click Actor
            {
                SearchMovie.actorSearch((string)sender);
                toggleControls(panelAct.mainForm);
                newMovieButton.Text = "New Movie";
                ViewMovie.clearAll();
            };

            ViewMovie.viewEdit += delegate(object sender, EventArgs e) //ViewMovie>Edit Button
            {
                EditMovie.editItem((info)sender);
                toggleControls(panelAct.editMovie);
            };

            EditSettings.sendEdit += delegate(object sender, EventArgs e) //EditSettings>Commit Button
            {
                toggleControls(lastPanel);
            };

            EditMovie.sendEdit += delegate(object sender, EventArgs e) //EditMovie>Send Edit Button
            {
                ViewMovie.viewItem((info)sender);
                toggleControls(panelAct.viewMovie);
                newMovieButton.Text = "Back";
            };

            SearchMovie.viewItem += delegate(object sender, MouseEventArgs e) //SearchMovie>Double Click Title
            {
                ViewMovie.viewItem((info)sender);
                toggleControls(panelAct.viewMovie);
                newMovieButton.Text = "Back";
            };

            NewMovie.movieAdded += delegate //NewMovie>Movie Was Added Statement (Called from Add Movie Button)
            {
                newMovieButton_Click(null, null);
            };

            #endregion

            //Stage is set, this adjusts sizes of all panels that require resizing
            resizeEndEvent_CorrectSizes(null, null);
        }