public CommandCanvasList() { InitializeComponent(); AssetXML = new _AssetXML <CommandCanvasList>(this); ClearPublicExecuteEntryPoint(null); Instance = this; // Consoleの出力先を変更する Console.SetOut(new SystemTextWriter()); Tab.Items.Clear(); Dispatcher.BeginInvoke(new Action(() => { // アイドル状態になってから新規シートを作成する AddNewContents(); if (reserveLoadCbsFilePath != null) { // 起動読み込みをキックする(タイミングが不安…) KickLoadCbsFile(); } }), DispatcherPriority.ApplicationIdle); }
private object _CallPublicExecuteEntryPoint(object owner, bool fromScript, string entryPointName = null) { if (!fromScript && CommandCanvasList.GetOwnerCursor() == Cursors.Wait) { return(null); } object result = null; if (entryPointName != null) { if (entryPointName.Trim().Length == 0) { entryPointName = null; } else if (PublicExecuteEntryPointList.Where(n => n.function.Invoke(false, ":" + entryPointName) != null).Count() > 1) { if (owner != null) { // CommandCanvas から呼ばれた Console.WriteLine(nameof(CommandCanvas) + $": multiple \"{entryPointName}\" entry points!"); return(null); } else { // CallEntryPoint から呼ばれた throw new Exception($"multiple \"{entryPointName}\" entry points!"); } } } var entryPoints = PublicExecuteEntryPointList.Where(n => n.function != null); if (owner != null) { // オーナー限定 entryPoints = PublicExecuteEntryPointList.Where(n => n.owner == owner); } // 1件のみ実行 if (!entryPoints.Any(n => { result = n.function.Invoke(fromScript, entryPointName); return(result != null); })) { if (entryPointName != null) { var errorMessage = $"\"{entryPointName}\" entry point not found!"; if (owner != null) { // CommandCanvas から呼ばれた Console.WriteLine(nameof(CommandCanvas) + $": {errorMessage}"); } else { // CallEntryPoint から呼ばれた throw new Exception(errorMessage); } } } return(result); }
private void Grid_MouseLeave(object sender, MouseEventArgs e) { CommandCanvasList.SetOwnerCursor(null); }
private void Grid_MouseEnter(object sender, MouseEventArgs e) { CommandCanvasList.SetOwnerCursor(Cursors.Hand); }