private void PopulateGridWithDirectInputBindingLineData(ILineInFile line) { var diBinding = line as DirectInputBinding; var newRowIndex = grid.Rows.Add(); var row = grid.Rows[newRowIndex]; row.Cells["LineNum"].Value = diBinding.LineNum; row.Cells["Callback"].Value = diBinding.Callback; row.Cells["diCallbackInvocationBehavior"].Value = string.Format("{0} / {1}", diBinding.CallbackInvocationBehavior, diBinding.TriggeringEvent); switch (diBinding.BindingType) { case DirectInputBindingType.POVDirection: row.Cells["LineType"].Value = "DirectInput POV"; row.Cells["diButton"].Value = string.Format("POV # {0} ({1})", diBinding.POVHatNumber, diBinding.PovDirection); break; case DirectInputBindingType.Button: row.Cells["LineType"].Value = "DirectInput Button"; row.Cells["diButton"].Value = string.Format("DI Button # {0}", diBinding.ButtonIndex); break; } row.Cells["SoundId"].Value = diBinding.SoundId; row.Cells["Description"].Value = !string.IsNullOrEmpty(diBinding.Description) ? RemoveLeadingAndTrailingQuotes(diBinding.Description) : string.Empty; }
private void PopulateGridWithKeyBindingLineData(ILineInFile line) { var keyBinding = line as KeyBinding; var newRowIndex = grid.Rows.Add(); var row = grid.Rows[newRowIndex]; row.Cells["LineNum"].Value = keyBinding.LineNum; row.Cells["LineType"].Value = "Key"; row.Cells["Callback"].Value = keyBinding.Callback; row.Cells["SoundId"].Value = keyBinding.SoundId; row.Cells["kbKey"].Value = GetKeyDescription(keyBinding.Key); row.Cells["kbComboKey"].Value = GetKeyDescription(keyBinding.ComboKey); row.Cells["kbUIVisibility"].Value = GetUIAccessibilityDescription(keyBinding.UIVisibility); row.Cells["Description"].Value = !string.IsNullOrEmpty(keyBinding.Description) ? RemoveLeadingAndTrailingQuotes(keyBinding.Description) : string.Empty; }
private void PopulateGridWithCommentLineOrBlankLineOrUnparseableLineData(ILineInFile line) { var newRowIndex = grid.Rows.Add(); var row = grid.Rows[newRowIndex]; row.Cells["LineNum"].Value = line.LineNum; if (line is CommentLine) { var commentLine = line as CommentLine; row.Cells["LineType"].Value = "Comment Line"; row.Cells["Description"].Value = commentLine.Text ?? string.Empty; } else if (line is UnparsableLine) { var unparseableLine = line as UnparsableLine; row.Cells["LineType"].Value = "Unparseable Line"; row.Cells["Description"].Value = unparseableLine.Text ?? string.Empty; } else if (line is BlankLine) { row.Cells["LineType"].Value = "Blank Line"; } }