public IPlugin Activate(IMacroPlayer player) { //起動済みの場合は例外 if (this.Core != null) { throw new InvalidOperationException("Already activated"); } //メインモデルを生成 this.Core = new CoreModel(player); //プラグイン側からのウインドウ表示要求 this.Core.OpenWindowRequested += args => this.OpenWindowRequested?.Invoke(args); //マクロ用のプラグインを返却 return this.Core.Plugin; }
internal Plugin(IMacroPlayer player) { this.Player = player; }
public CoreModel(IMacroPlayer player) { this.Player = player; this.Plugin = new Plugin(player); }