Ubisam-MergeTool/src/MergeHub/Views/ShortcutHelpWindow.xaml.cs
ksj09406 7719094edf 최초 커밋: MergeHub (사내 Git Merge/Diff 도구)
UbisamBase 플랫폼 위에서 도는 플러그인. 지금까지 만든 것을 그대로 담는다.
- 폴더 비교 / 파일 비교(부분 수용·워드랩·찾기) / 3-Way 병합 / Git 조작
- 비교 엔진: histogram 정렬 · 이동 블록 감지 · 무시 규칙 · 13개 언어 토크나이저
- doc/ 에 작업 지시서와 진행 기록

빌드 산출물(bin/obj)은 추적하지 않는다 - 플랫폼 런타임이 빌드 때마다
D:\UbisamPlatform\bin 에서 복사되어 들어오므로 저장소에 담을 이유가 없다.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 10:13:27 +09:00

55 lines
1.7 KiB
C#

using System.Linq;
using System.Windows;
using System.Windows.Input;
using MergeHub.Services;
namespace MergeHub.Views
{
/// <summary>
/// 단축키 목록 창.
///
/// 목록을 여기에 다시 적지 않는다 - <see cref="ShortcutMap"/> 하나에서 읽어 온다.
/// 설명과 실제 키 처리가 갈라지면 설명이 곧 거짓말이 되기 때문이다.
/// </summary>
public partial class ShortcutHelpWindow : Window
{
public ShortcutHelpWindow()
{
InitializeComponent();
GroupList.ItemsSource = ShortcutMap.ByGroup().ToList();
if (Application.Current?.MainWindow is { IsLoaded: true } main && !ReferenceEquals(main, this))
{
Owner = main;
WindowStartupLocation = WindowStartupLocation.CenterOwner;
}
else
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
}
private void TitleBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) => DragMove();
private void Close_Click(object sender, RoutedEventArgs e) => Close();
/// <summary>이미 떠 있으면 앞으로 가져온다. 누를 때마다 창이 쌓이면 성가시다.</summary>
private static ShortcutHelpWindow? open;
public static void ShowOrActivate(Window? owner = null)
{
if (open is { IsLoaded: true })
{
open.Activate();
return;
}
open = new ShortcutHelpWindow();
if (owner is not null) open.Owner = owner;
open.Closed += (_, _) => open = null;
((Window)open).Show();
}
}
}