コード例 #1
0
        public void SelectOffset(int pcOffset, int column = -1, ISnesNavigation.HistoryArgs historyArgs = null)
        {
            if (pcOffset == -1)
            {
                return;
            }

            MarkHistoryPoint(SelectedOffset, historyArgs, "start");

            var col = column == -1 ? table.CurrentCell.ColumnIndex : column;

            if (pcOffset < ViewOffset)
            {
                ViewOffset = pcOffset;
                UpdateDataGridView();
                table.CurrentCell = table.Rows[0].Cells[col];
            }
            else if (pcOffset >= ViewOffset + rowsToShow)
            {
                ViewOffset = pcOffset - rowsToShow + 1;
                UpdateDataGridView();
                table.CurrentCell = table.Rows[rowsToShow - 1].Cells[col];
            }
            else
            {
                table.CurrentCell = table.Rows[pcOffset - ViewOffset].Cells[col];
            }

            MarkHistoryPoint(pcOffset, historyArgs, "end");

            InvalidateTable();
        }
コード例 #2
0
        public NavigationEntry(int snesOffset, ISnesNavigation.HistoryArgs historyArgs, Data data)
        {
            SnesOffset  = snesOffset;
            Description = historyArgs?.Description ?? "";
            Position    = historyArgs?.Position ?? "";

            Data = data;
        }
コード例 #3
0
        public void MarkHistoryPoint(int pcOffset, ISnesNavigation.HistoryArgs historyArgs, string position)
        {
            if (historyArgs == null)
            {
                return;
            }

            historyArgs.Position = position;

            RememberNavigationPoint(SelectedOffset, historyArgs); // save old position
        }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: Dotsarecool/DiztinGUIsh
    private void RememberNavigationPoint(int pcOffset, ISnesNavigation.HistoryArgs historyArgs)
    {
        var snesAddress = Project.Data.ConvertPCtoSnes(pcOffset);
        var history     = Document.NavigationHistory;

        // if our last remembered offset IS the new offset, don't record it again
        // (prevents duplication)
        if (history.Count > 0 && history[history.Count - 1].SnesOffset == snesAddress)
        {
            return;
        }

        history.Add(
            new NavigationEntry(
                snesAddress,
                historyArgs,
                Project.Data
                )
            );
    }
コード例 #5
0
 public void SelectOffset(int pcOffset, ISnesNavigation.HistoryArgs historyArgs = null)
 => SelectOffset(pcOffset, -1, historyArgs);
コード例 #6
0
 public void SelectOffset(int offset, ISnesNavigation.HistoryArgs historyArgs = null) =>
 ProjectView.SelectOffset(offset, historyArgs);