public IBusEnvironmentForTest(bool withWindow, bool withIBus) { ErrorReport.IsOkToInteractWithUser = false; wasibusrunning = IBusAdaptor.EngineAvailable; if (withIBus) { if (!IBusAdaptor.StartIBus()) { throw new ApplicationException("Could not start IBus"); } } else if (wasibusrunning) { if (!IBusAdaptor.ExitIBus()) { throw new ApplicationException("Could not stop IBus"); } } IBusAdaptor.CloseConnection(); ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); if (withWindow) { CreateWindow(); } }
public void Setup() { ErrorReport.IsOkToInteractWithUser = false; ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); _testFilePath = Path.GetTempFileName(); _writingSystemRepository = new TestLdmlInXmlWritingSystemRepository(); _model = new WritingSystemSetupModel(_writingSystemRepository); }
public void NotifyUserOfProblem_OncePerSession() { ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); string message = "Oh no! This is quite a long message to see if it will wrap so I will have to keep typing to see if this will work now. And then some more."; ErrorReport.NotifyUserOfProblem(new ShowOncePerSessionBasedOnExactMessagePolicy(), message); ErrorReport.NotifyUserOfProblem(new ShowOncePerSessionBasedOnExactMessagePolicy(), message); }
public void NotifyUserOfProblem_SmallWithAlternateButton() { ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); string message = "Oh no!"; ErrorReport.NotifyUserOfProblem(new ShowOncePerSessionBasedOnExactMessagePolicy(), "&Caller Defined", DialogResult.Cancel, message); }
public void NotifyUserOfProblem_WithAlternateButton() { ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); string message = "Oh no! This is quite a long message to see if it will wrap so I will have to keep typing to see if this will work now. And then some more."; ErrorReport.NotifyUserOfProblem(new ShowOncePerSessionBasedOnExactMessagePolicy(), "&Caller Defined", DialogResult.Cancel, message); }
public void Dispose() { ShowOncePerSessionBasedOnExactMessagePolicy.Reset(); if (_window != null) { _window.Close(); _window.Dispose(); _window = null; } IBusAdaptor.CloseConnection(); if (wasibusrunning) { IBusAdaptor.StartIBus(); } else { IBusAdaptor.ExitIBus(); } }