public void BuildLogUpdateEventHandler(object sender, BuildLogUpdateEventArgs e) { if (_m.BuildEntries != null && _m.SelectedBuildIndex < _m.BuildEntries.Count && _m.BuildEntries[_m.SelectedBuildIndex].Item2 == e.Log.BuildId && _m.ScriptEntries != null && _m.SelectedScriptIndex < _m.ScriptEntries.Count && _m.ScriptEntries[_m.SelectedScriptIndex].Item2 == e.Log.ScriptId) { Application.Current.Dispatcher.Invoke(() => { _m.BuildLogs.Add(e.Log); _m.OnPropertyUpdate(nameof(_m.BuildLogs)); if (0 < BuildLogSimpleListView.Items.Count) { BuildLogSimpleListView.UpdateLayout(); BuildLogSimpleListView.ScrollIntoView(BuildLogSimpleListView.Items[BuildLogSimpleListView.Items.Count - 1]); } if (0 < BuildLogDetailListView.Items.Count) { BuildLogDetailListView.UpdateLayout(); BuildLogDetailListView.ScrollIntoView(BuildLogDetailListView.Items[BuildLogDetailListView.Items.Count - 1]); } }); } }
public void BuildLogUpdateEventHandler(object sender, BuildLogUpdateEventArgs e) { if (m.SelectBuildEntries != null && m.SelectBuildIndex < m.SelectBuildEntries.Count && m.SelectBuildEntries[m.SelectBuildIndex].Item2 == e.Log.BuildId && m.SelectPluginEntries != null && m.SelectPluginIndex < m.SelectPluginEntries.Count && m.SelectPluginEntries[m.SelectPluginIndex].Item2 == e.Log.PluginId) { Application.Current.Dispatcher.Invoke(() => { m.BuildLogListModel.Add(e.Log); m.OnPropertyUpdate("BuildLogListModel"); if (0 < BuildLogSimpleListView.Items.Count) { BuildLogSimpleListView.UpdateLayout(); BuildLogSimpleListView.ScrollIntoView(BuildLogSimpleListView.Items[BuildLogSimpleListView.Items.Count - 1]); } if (0 < BuildLogDetailListView.Items.Count) { BuildLogDetailListView.UpdateLayout(); BuildLogDetailListView.ScrollIntoView(BuildLogDetailListView.Items[BuildLogDetailListView.Items.Count - 1]); } }); } }