/// <summary> /// 次セクション生成 /// </summary> /// <param name="p_invocation"></param> private void Next(ViewModel.IShellInvocation p_invocation) { var l_section = new InvocationSection(this, p_invocation); this.Document.Blocks.Add(l_section); if (l_section.CanEditing) { this.currentSection = l_section; this.CaretPosition = l_section.Editor.ContentEnd; } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="p_owner">オーナーコンソール</param> /// <param name="p_invocation">呼び出しオブジェクト</param> public InvocationSection(ShellConsole p_owner, ViewModel.IShellInvocation p_invocation) { if (p_invocation.Result == null) { this.owner = p_owner; this.Invocation = p_invocation; this.Invocation.PropertyChanged += this.HandleInvocationPropertyChanged; this.Prompt = $"[{p_invocation.Number}] > "; this.Editor = new Paragraph(); this.Editor.Inlines.Add(this.Prompt); this.Blocks.Add(this.Editor); this.CanEditing = p_invocation.Status == Constants.InvocationStatus.Ready; } else { this.owner = p_owner; this.Invocation = p_invocation; this.SetResult(p_invocation.Result); this.CanEditing = false; } }