private void PerformQuickDuplication() { int?iter1StartObserved = ParsingUtilities.ParseIntNullable( _gui.TextBoxQuickDuplication1stIterationStart.Text); int?iter2StartObserved = ParsingUtilities.ParseIntNullable( _gui.TextBoxQuickDuplication2ndIterationStart.Text); int?totalIters = ParsingUtilities.ParseIntNullable( _gui.TextBoxQuickDuplicationTotalIterations.Text); if (!iter1StartObserved.HasValue || !iter2StartObserved.HasValue || !totalIters.HasValue) { return; } int iter1Start = iter1StartObserved.Value - 1; int iter2Start = iter2StartObserved.Value - 1; int multiplicity = totalIters.Value - 1; int iter1End = iter2Start - 1; M64CopiedData copiedData = M64CopiedData.CreateCopiedData( _gui.DataGridViewInputs, _m64File.CurrentFileName, iter1Start, iter1End, true /* useRow */); _m64File.Paste(copiedData, iter2Start, true /* insert */, multiplicity); }
private void CopyClipboardForJoystick(bool?component = null) { M64CopiedData copiedData = M64CopiedData.CreateCopiedDataFromClipboardForJoystick(component); if (copiedData == null) { return; } _gui.ListBoxCopied.Items.Add(copiedData); _gui.ListBoxCopied.SelectedItem = copiedData; }
private void ListBoxCopied_KeyDown() { if (KeyboardUtilities.IsDeletishKeyHeld()) { M64CopiedData copiedData = _gui.ListBoxCopied.SelectedItem as M64CopiedData; if (copiedData == null || copiedData == M64CopiedData.OneEmptyFrame) { return; } int index = _gui.ListBoxCopied.SelectedIndex; _gui.ListBoxCopied.Items.Remove(copiedData); if (index == _gui.ListBoxCopied.Items.Count) { index--; } _gui.ListBoxCopied.SelectedIndex = index; } }
private void CopyData(bool useRow) { (int?startFrame, int?endFrame) = GetFrameBounds(); string inputsString = _gui.TextBoxSelectionInputs.Text; if (!startFrame.HasValue || !endFrame.HasValue) { return; } M64CopiedData copiedData = M64CopiedData.CreateCopiedData( _gui.DataGridViewInputs, _m64File.CurrentFileName, startFrame.Value, endFrame.Value, useRow, inputsString); if (copiedData == null) { return; } _gui.ListBoxCopied.Items.Add(copiedData); _gui.ListBoxCopied.SelectedItem = copiedData; }
private void PasteData(bool insert) { M64CopiedData copiedData = _gui.ListBoxCopied.SelectedItem as M64CopiedData; if (copiedData == null) { return; } (int?startFrame, int?endFrame) = GetFrameBounds(); if (!startFrame.HasValue) { return; } int?multiplicity = ParsingUtilities.ParseIntNullable(_gui.TextBoxPasteMultiplicity.Text); if (!multiplicity.HasValue) { return; } _m64File.Paste(copiedData, startFrame.Value, insert, multiplicity.Value); }