コード例 #1
0
        private void matchSessionDataGridView_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                var selectedRow = (DataRowView)matchSessionBindingSource.Current;
                if (selectedRow == null) return;
                var selectedSessionCopy = copyMatchSessionsTable.GetCopyItem(selectedRow.Row);
                if (selectedSessionCopy.IsNone()) return;
                var selectedSession = copyMatchSessionsTable.GetItem(selectedRow.Row);
                SessionData wrapperTable;
                if (!sessionData.TryGetValue(selectedSession, out wrapperTable))
                {
                    var wrapperMatchmediaTable = Helpers.GetWrapper(selectedSession.Matchmedia);
                    var wrapperPlayerTable = Helpers.GetWrapper(selectedSession.MatchSessions_Player);
                    wrapperTable = Tuple.Create(wrapperMatchmediaTable, wrapperPlayerTable);
                    sessionData.Add(selectedSession, wrapperTable);
                }

                var editForm = new EditMatchSession(logger, context, wrapperTable, selectedSession, false);
                selectedRow.EndEdit();
                copyMatchSessionsTable.ImportChangesToOriginal(selectedSession, selectedSessionCopy.Value);
                editForm.ShowDialog();
                copyMatchSessionsTable.UpdateItem(selectedSession, selectedSession);
            }
            catch (Exception ex)
            {
                ex.ShowError(logger, "Couldn't Show EditWindow");
            }
        }
コード例 #2
0
        private void switchToAdvancedViewButton_Click(object sender, EventArgs e)
        {
            try
            {
                SaveData();

                var managePlayer = new EditMatchSession(logger, context, sessionData, session, true);
                Visible = false;
                managePlayer.ShowDialog();
                DeleteMatchmedia = managePlayer.DeleteMatchmedia;
                Close();
            }
            catch (Exception ex)
            {
                ex.ShowError(logger, "Could not open EditMatchSession");
            }
        }