private void HandleSettingsError(object sender, SettingsErrorEventArgs e) { var activeContent = _dockManager.ActiveContent as MainOutputWindow; if (activeContent != null) { var outputWindow = _outputWindows.FirstOrDefault(x => { return(x.Uid == activeContent.RootModel.Uid); }); if (outputWindow != null) { outputWindow.RootModel.PushMessageToConveyor(new ErrorMessage(e.Message)); } } else if (_outputWindows.Count > 0) { _outputWindows.First().RootModel.PushMessageToConveyor(new ErrorMessage(e.Message)); } }
public void ConstructorTest() { AssertHelper.ExpectedException <ArgumentNullException>(() => new SettingsErrorEventArgs(null !, SettingsServiceAction.Open, "file")); var settings = new SettingsErrorEventArgs(new InvalidOperationException("Test"), SettingsServiceAction.Open, null); }
/// <summary>Raise the ErrorOccurred event.</summary> /// <param name="e">The error event args.</param> public void RaiseErrorOccurred(SettingsErrorEventArgs e) { ErrorOccurred?.Invoke(this, e); }
private void OnErrorOccurred(SettingsErrorEventArgs e) { ErrorOccurred?.Invoke(this, e); }