void IShortcutCommand.Execute(CommandArgs commandArgs) { // ウィンドウ状態が通常の場合にのみ実行する if (form.WindowState != FormWindowState.Normal) { return; } ScreenSplitCommandArgs args = (ScreenSplitCommandArgs)commandArgs; // 分割サイズを設定 if (args.WidthNum > 0) { int formWidth = Screen.GetWorkingArea(form).Width / args.WidthNum; form.Width = formWidth; int movieHeight = (int)(pecaPlayer.Width / pecaPlayer.AspectRate); pecaPlayer.SetSize(pecaPlayer.Width, movieHeight); } else if (args.HeightNum > 0) { int formHeight = Screen.GetWorkingArea(form).Height / args.HeightNum; form.Height = formHeight; int movieWidth = (int)(pecaPlayer.Height * pecaPlayer.AspectRate); pecaPlayer.SetSize(movieWidth, pecaPlayer.Height); } }
string IShortcutCommand.GetDetail(CommandArgs commandArgs) { ScreenSplitCommandArgs args = (ScreenSplitCommandArgs)commandArgs; if (args.WidthNum > 0) { return(string.Format("サイズ (画面幅{0}分の1)", args.WidthNum)); } else if (args.HeightNum > 0) { return(string.Format("サイズ (画面高さ{0}分の1)", args.HeightNum)); } return(string.Empty); }