Exemple #1
0
        private void dgvSoundRecordingsAndReleases_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int editIndex   = 0;
            int deleteIndex = 1;

            if (e.ColumnIndex == editIndex)
            {
                TrackModel track = (TrackModel)dgvSoundRecordingsAndReleases.CurrentRow.DataBoundItem;
                if (track != null)
                {
                    using (var frm = new ERN_382TrackReleaseForm((TrackModel)track.Copy()))
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            track.CopyFromSource(frm.Model);
                        }
                    }
                }
            }
            else if (e.ColumnIndex == deleteIndex)
            {
                using (var f = new MRMessageBox("Želite li obrisati zapis?", MRMessageBox.eMessageBoxStyle.YesNo))
                {
                    if (f.ShowDialog() == DialogResult.Yes)
                    {
                        dgvSoundRecordingsAndReleases.Rows.RemoveAt(e.RowIndex);
                    }
                }
            }
        }
Exemple #2
0
        private void dgvSoundRecordingsAndReleases_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            TrackModel track = (TrackModel)dgvSoundRecordingsAndReleases.CurrentRow.DataBoundItem;

            if (track != null)
            {
                using (var frm = new ERN_382TrackReleaseForm((TrackModel)track.Copy())
                {
                    Editable = false
                })
                {
                    frm.ShowDialog();
                }
            }
        }
Exemple #3
0
        private void tbTrackReleases_ButtonClicked(object sender, Framework.UI.Controls.MRTitleBar.ActionButtonEventArgs e)
        {
            if (e.Action == Framework.UI.Controls.MRTitleBar.eButtonAction.Add)
            {
                var track = new TrackModel()
                {
                    Ordinal = 1
                };

                if (Model.Tracks.Any())
                {
                    track.Ordinal = Model.Tracks.Max(x => x.Ordinal) + 1;
                }

                using (var frm = new ERN_382TrackReleaseForm(track))
                {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        Model.Tracks.Add(track);
                        dgvSoundRecordingsAndReleases.ClearSelection();
                    }
                }
            }
        }