Ejemplo n.º 1
0
        private void addTrackButton_Click(object sender, EventArgs e)
        {
            ModelsData.Model.Track newTrack    = new ModelsData.Model.Track();
            ManageTrackForm        manageTrack = new ManageTrackForm(newTrack, ManageTrackForm.CallType.Add, -1);

            manageTrack.ShowDialog();
            if (manageTrack.DialogResult == DialogResult.OK)
            {
                model.trackList.Add(manageTrack.track);
                GenerateModel();
            }
        }
Ejemplo n.º 2
0
        private void EditTrack()
        {
            Logger.Trace(System.Reflection.MethodBase.GetCurrentMethod().Name);

            if (tracksDataGridView.SelectedRows.Count == 1)
            {
                string editTrackJson                   = Newtonsoft.Json.JsonConvert.SerializeObject(model.trackList[tracksDataGridView.SelectedRows[0].Index]);
                ModelsData.Model.Track editTrack       = Newtonsoft.Json.JsonConvert.DeserializeObject <ModelsData.Model.Track>(editTrackJson);
                ManageTrackForm        manageTrackEdit = new ManageTrackForm(editTrack, ManageTrackForm.CallType.Edit, tracksDataGridView.SelectedRows[0].Index);
                manageTrackEdit.ShowDialog();
                if (manageTrackEdit.DialogResult == DialogResult.OK)
                {
                    model.trackList[tracksDataGridView.SelectedRows[0].Index] = manageTrackEdit.track;
                    GenerateModel();
                }
            }
        }
Ejemplo n.º 3
0
        private void copyTrackButton_Click(object sender, EventArgs e)
        {
            Logger.Trace(System.Reflection.MethodBase.GetCurrentMethod().Name);

            if (tracksDataGridView.SelectedRows.Count == 1)
            {
                string copyTrackJson                   = Newtonsoft.Json.JsonConvert.SerializeObject(model.trackList[tracksDataGridView.SelectedRows[0].Index]);
                ModelsData.Model.Track copyTrack       = Newtonsoft.Json.JsonConvert.DeserializeObject <ModelsData.Model.Track>(copyTrackJson);
                ManageTrackForm        manageTrackCopy = new ManageTrackForm(copyTrack, ManageTrackForm.CallType.Copy, -1);
                manageTrackCopy.ShowDialog();
                if (manageTrackCopy.DialogResult == DialogResult.OK)
                {
                    model.trackList.Add(manageTrackCopy.track);
                    GenerateModel();
                }
            }
        }