示例#1
0
        private void setChansonInterface()
        {
            //Update interface
            panelSaisie.Visible = true;
            titreMusique.Text = Settings.Default.TitreChansonMusique;
            selection.Size = new Size(204, selection.Size.Height);
            selectionArtists.Location = new Point(255, selectionArtists.Location.Y);
            selectionAlbums.Visible = true;
            selection.SelectionMode = SelectionMode.One;
            saisie.AutoCompleteCustomSource.Clear();

            //fill in the lists
            foreach (var pair in inputFiles)
                if (!titles.ContainsKey(pair.Key))
                {
                    selection.Items.Add(pair.Value);
                    selectionArtists.Items.Add(artists[pair.Key]);
                    selectionAlbums.Items.Add(albums[pair.Key]);
                }

            //Affect those wo have already a name
            foreach (var pair in titles)
                try { storeFile(pair.Key, pair.Value); }
                catch { errors.Add(Path.GetFileName(pair.Key)); }

            //Divers
            if (selection.Items.Count == 0)
            {
                if (errors.Count != 0)
                {
                    string text = "";
                    foreach (string s in errors)
                        text += s + "\n";
                    MessageBox.Show(text, "Liste des erreurs", MessageBoxButtons.OK);
                }

                DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Musiques f = new Musiques();
                    f.MdiParent = this.MdiParent;
                    f.Show();
                    Close();
                }
                else if (dialogResult == DialogResult.No)
                {
                    Close();
                }
            }
            else
            {
                selection.SelectedIndex = 0;
                saisie.Clear();
                saisie.Focus();
            }
        }
示例#2
0
        /*
         *
         * ******************  STEP 4 : Chanson *******************
         *
         */
        private void nextStep4()
        {
            //Affect the song
            List<Object> tempS = new List<object>();
            List<Object> tempAr = new List<object>();
            List<Object> tempAl = new List<object>();
            foreach (var item in selection.SelectedItems)
            {
                try { storeFile(getKey(inputFiles, selection.GetItemText(item)).ElementAt(0), saisie.Text); }
                catch
                {
                    try { storeFile(getKey(inputFiles, selection.GetItemText(item)).ElementAt(1), saisie.Text); }
                    catch
                    {
                        errors.Add(selection.GetItemText(item));
                    }
                }
                tempS.Add(item);
                tempAr.Add(selectionArtists.Items[selection.Items.IndexOf(item)]);
                tempAl.Add(selectionAlbums.Items[selection.Items.IndexOf(item)]);
            }

            //Remove from the list
            foreach (var it in tempS)
                selection.Items.Remove(it);
            foreach (var it in tempAr)
                selectionArtists.Items.Remove(it);
            foreach (var it in tempAl)
                selectionAlbums.Items.Remove(it);

            //go to next
            if (selection.Items.Count > 0)
            {
                selection.SelectedIndex = 0;
                saisie.Clear();
                saisie.Text = Path.GetFileNameWithoutExtension(getKey(inputFiles, selection.GetItemText(selection.SelectedItem)).ElementAt(0));
                saisie.Focus();
            }
            else
            {
                DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Musiques f = new Musiques();
                    f.MdiParent = this.MdiParent;
                    f.Show();
                    Close();
                }
                else if (dialogResult == DialogResult.No)
                {
                    Close();
                }
            }
        }
示例#3
0
文件: Menu.cs 项目: npichot/TriTool
        private void startForm(int p)
        {
            Form instance = null;

            // Looking for MyForm among all opened forms
            foreach (Form form in Application.OpenForms)
            {
                switch (p)
                {
                case 0:
                    if (form is Dossiers)
                    {
                        instance = form;
                        break;
                    }
                    break;

                case 1:
                    if (form is Musiques)
                    {
                        instance = form;
                        break;
                    }
                    break;

                case 2:
                case 3:
                    if (form is Photos_Videos)
                    {
                        instance = form;
                        break;
                    }
                    break;
                }
            }

            if (Object.ReferenceEquals(null, instance))
            {
                switch (p)
                {
                case 0:
                    instance           = new Dossiers();
                    instance.MdiParent = this;
                    instance.Show();
                    break;

                case 1:
                    instance           = new Musiques();
                    instance.MdiParent = this;
                    instance.Show();
                    instance.WindowState = FormWindowState.Maximized;
                    break;

                case 2:
                    instance           = new Photos_Videos(true);
                    instance.MdiParent = this;
                    instance.Show();
                    instance.WindowState = FormWindowState.Maximized;
                    break;

                case 3:
                    instance           = new Photos_Videos(false);
                    instance.MdiParent = this;
                    instance.Show();
                    instance.WindowState = FormWindowState.Maximized;
                    break;
                }
            }
            else
            {
                instance.BringToFront();
            }
        }
示例#4
0
文件: Menu.cs 项目: npichot/TriTool
        private void startForm(int p)
        {
            Form instance = null;

            // Looking for MyForm among all opened forms
            foreach (Form form in Application.OpenForms)
                switch (p)
                {
                    case 0:
                        if (form is Dossiers)
                        {
                            instance = form;
                            break;
                        }
                        break;
                    case 1:
                        if (form is Musiques)
                        {
                            instance = form;
                            break;
                        }
                        break;
                    case 2:
                    case 3:
                        if (form is Photos_Videos)
                        {
                            instance = form;
                            break;
                        }
                        break;
                }

            if (Object.ReferenceEquals(null, instance))
            {
                switch (p)
                {
                    case 0:
                        instance = new Dossiers();
                        instance.MdiParent = this;
                        instance.Show();
                        break;
                    case 1:
                        instance = new Musiques();
                        instance.MdiParent = this;
                        instance.Show();
                        instance.WindowState = FormWindowState.Maximized;
                        break;
                    case 2:
                        instance = new Photos_Videos(true);
                        instance.MdiParent = this;
                        instance.Show();
                        instance.WindowState = FormWindowState.Maximized;
                        break;
                    case 3:
                        instance = new Photos_Videos(false);
                        instance.MdiParent = this;
                        instance.Show();
                        instance.WindowState = FormWindowState.Maximized;
                        break;
                }
            }
            else
            {
                instance.BringToFront();
            }
        }
示例#5
0
        private void setChansonInterface()
        {
            //Update interface
            panelSaisie.Visible       = true;
            titreMusique.Text         = Settings.Default.TitreChansonMusique;
            selection.Size            = new Size(204, selection.Size.Height);
            selectionArtists.Location = new Point(255, selectionArtists.Location.Y);
            selectionAlbums.Visible   = true;
            selection.SelectionMode   = SelectionMode.One;
            saisie.AutoCompleteCustomSource.Clear();

            //fill in the lists
            foreach (var pair in inputFiles)
            {
                if (!titles.ContainsKey(pair.Key))
                {
                    selection.Items.Add(pair.Value);
                    selectionArtists.Items.Add(artists[pair.Key]);
                    selectionAlbums.Items.Add(albums[pair.Key]);
                }
            }

            //Affect those wo have already a name
            foreach (var pair in titles)
            {
                try { storeFile(pair.Key, pair.Value); }
                catch { errors.Add(Path.GetFileName(pair.Key)); }
            }

            //Divers
            if (selection.Items.Count == 0)
            {
                if (errors.Count != 0)
                {
                    string text = "";
                    foreach (string s in errors)
                    {
                        text += s + "\n";
                    }
                    MessageBox.Show(text, "Liste des erreurs", MessageBoxButtons.OK);
                }


                DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Musiques f = new Musiques();
                    f.MdiParent = this.MdiParent;
                    f.Show();
                    Close();
                }
                else if (dialogResult == DialogResult.No)
                {
                    Close();
                }
            }
            else
            {
                selection.SelectedIndex = 0;
                saisie.Clear();
                saisie.Focus();
            }
        }
示例#6
0
        /*
         *
         * ******************  STEP 4 : Chanson *******************
         *
         */
        private void nextStep4()
        {
            //Affect the song
            List <Object> tempS  = new List <object>();
            List <Object> tempAr = new List <object>();
            List <Object> tempAl = new List <object>();

            foreach (var item in selection.SelectedItems)
            {
                try { storeFile(getKey(inputFiles, selection.GetItemText(item)).ElementAt(0), saisie.Text); }
                catch
                {
                    try { storeFile(getKey(inputFiles, selection.GetItemText(item)).ElementAt(1), saisie.Text); }
                    catch
                    {
                        errors.Add(selection.GetItemText(item));
                    }
                }
                tempS.Add(item);
                tempAr.Add(selectionArtists.Items[selection.Items.IndexOf(item)]);
                tempAl.Add(selectionAlbums.Items[selection.Items.IndexOf(item)]);
            }

            //Remove from the list
            foreach (var it in tempS)
            {
                selection.Items.Remove(it);
            }
            foreach (var it in tempAr)
            {
                selectionArtists.Items.Remove(it);
            }
            foreach (var it in tempAl)
            {
                selectionAlbums.Items.Remove(it);
            }

            //go to next
            if (selection.Items.Count > 0)
            {
                selection.SelectedIndex = 0;
                saisie.Clear();
                saisie.Text = Path.GetFileNameWithoutExtension(getKey(inputFiles, selection.GetItemText(selection.SelectedItem)).ElementAt(0));
                saisie.Focus();
            }
            else
            {
                DialogResult dialogResult = MessageBox.Show("Voulez recommencez ?", "Fin du process", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Musiques f = new Musiques();
                    f.MdiParent = this.MdiParent;
                    f.Show();
                    Close();
                }
                else if (dialogResult == DialogResult.No)
                {
                    Close();
                }
            }
        }