コード例 #1
0
        private void btnAddSong_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var song = new Song(Uow);

            using (var dlg = new SongEditorForm(song)) {
                dlg.IconOptions.SvgImage = this.IconOptions.SvgImage;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.Save();
                    LoadData();
                }
            }
        }
コード例 #2
0
        private void gridView_DoubleClick(object sender, EventArgs e)
        {
            var record = gridView.GetFocusedRow() as ViewRecord;

            if (record.IsNotNull())
            {
                var id   = record["Id"].ToInt();
                var song = new XPQuery <Song>(Uow).Where(x => x.Oid == id).FirstOrDefault();
                using (var dlg = new SongEditorForm(song)) {
                    dlg.IconOptions.SvgImage = this.IconOptions.SvgImage;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        dlg.Save();
                        LoadData();
                    }
                }
            }
        }