/// <summary> /// Creates talk window. Doesn't show the form though, just /// creates the object. /// </summary> /// <returns>true on success</returns> public bool CreateTalkWindow() { if (_talkWindowForm == null) { IsPaused = false; _talkWindowForm = Context.AppPanelManager.CreatePanel("TalkWindow"); _talkWindow = _talkWindowForm as ITalkWindow; _talkWindowForm.FormClosed += _talkWindowForm_FormClosed; _talkWindow.FontSize = _fontSize; _fontSize = _talkWindow.FontSize; _talkWindowForm.TopMost = true; if (_designWidth == 0) { _designWidth = _talkWindowForm.Width; } if (_designHeight == 0) { _designHeight = _talkWindowForm.Height; } subscribeEvents(); } else { Log.Debug("_TalkWindow is not null!!"); } return true; }
/// <summary> /// Closes the talk window. Unsubscribe from events. Set /// force to true to close the window even if it was not /// previously active /// </summary> /// <param name="force"></param> public void CloseTalkWindow(bool force = false) { if ((IsTalkWindowActive || force) && _talkWindow != null) { IsPaused = false; _fontSize = _talkWindow.FontSize; Log.Debug("_fontsize: " + _fontSize); IsTalkWindowActive = false; _zoomModeTalkWindowEmpty = false; TTSManager.Instance.ActiveEngine.Stop(); PanelManagement.Glass.HideGlass(); unsubscribeEvents(); if (CoreGlobals.AppPreferences.RetainTalkWindowContentsOnHide) { _talkWindowText = _talkWindow.TalkWindowText; } Windows.CloseForm(_talkWindowForm); _talkWindowForm = null; _talkWindow = null; AuditLog.Audit(new AuditEventTalkWindow("close")); } }
/// <summary> /// Closes the talk window. Unsubscribe from events. Set /// force to true to close the window even if it was not /// previously active /// </summary> /// <param name="force"></param> public void CloseTalkWindow(bool force = false) { if ((IsTalkWindowActive || force) && _talkWindow != null) { if (_showingTalkWindow) { return; } _closingTalkWindow = true; IsPaused = false; _fontSize = _talkWindow.FontSize; Log.Debug("_fontsize: " + _fontSize); IsTalkWindowActive = false; _zoomModeTalkWindowEmpty = false; TTSManager.Instance.ActiveEngine.Stop(); hideGlass(); unsubscribeEvents(); if (CoreGlobals.AppPreferences.RetainTalkWindowContentsOnHide) { _talkWindowText = _talkWindow.TalkWindowText; } Log.Debug("Removing talkwindowagent"); Context.AppAgentMgr.RemoveAgent(_talkWindowForm.Handle); Windows.CloseForm(_talkWindowForm); _talkWindowForm = null; _talkWindow = null; _closingTalkWindow = false; AuditLog.Audit(new AuditEventTalkWindow("close")); } }
/// <summary> /// Create talk window. Doesn't show the form though, just /// creates the object. /// </summary> /// <returns>true on success</returns> public bool CreateTalkWindow() { if (_talkWindowForm == null) { IsPaused = false; _talkWindowForm = PanelManagement.Context.AppPanelManager.CreatePanel("TalkWindow"); _talkWindow = _talkWindowForm as ITalkWindow; _talkWindowForm.FormClosed += _talkWindowForm_FormClosed; _talkWindow.FontSize = _fontSize; _fontSize = _talkWindow.FontSize; _talkWindowForm.TopMost = true; subscribeEvents(); } else { Log.Debug("ACHTUNG! _TalkWindow is not null!!"); } return(true); }
/// <summary> /// Disposer. Release resources and cleanup. /// </summary> /// <param name="disposing">true to dispose managed resources</param> protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!_disposed) { Log.Debug(); if (disposing) { if (_talkWindowForm != null) { _talkWindowForm.Close(); _talkWindowForm = null; _talkWindow = null; } } // Release unmanaged resources. } _disposed = true; }
/// <summary> /// Disposer. Release resources and cleanup. /// </summary> /// <param name="disposing">true to dispose managed resources</param> protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!_disposed) { Log.Debug(); if (disposing) { if (_talkWindowForm != null) { _talkWindowForm.Close(); _talkWindowForm = null; _talkWindow = null; } } // Release unmanaged resources. } _disposed = true; }
/// <summary> /// Creates talk window. Doesn't show the form though, just /// creates the object. /// </summary> /// <returns>true on success</returns> public bool CreateTalkWindow() { if (_talkWindowForm == null) { IsPaused = false; _talkWindowForm = Context.AppPanelManager.CreatePanel("TalkWindow"); _talkWindow = _talkWindowForm as ITalkWindow; _talkWindowForm.FormClosed += _talkWindowForm_FormClosed; _talkWindow.FontSize = _fontSize; _fontSize = _talkWindow.FontSize; _talkWindowForm.TopMost = true; if (_designWidth == 0) { _designWidth = _talkWindowForm.Width; } if (_designHeight == 0) { _designHeight = _talkWindowForm.Height; } subscribeEvents(); } else { Log.Debug("ACHTUNG! _TalkWindow is not null!!"); } return true; }
/// <summary> /// Closes the talk window. Unsubscribe from events. Set /// force to true to close the window even if it was not /// previously active /// </summary> /// <param name="force"></param> public void CloseTalkWindow(bool force = false) { if ((IsTalkWindowActive || force) && _talkWindow != null) { IsPaused = false; _fontSize = _talkWindow.FontSize; Log.Debug("_fontsize: " + _fontSize); IsTalkWindowActive = false; _zoomModeTalkWindowEmpty = false; TTSManager.Instance.ActiveEngine.Stop(); hideGlass(); unsubscribeEvents(); if (CoreGlobals.AppPreferences.RetainTalkWindowContentsOnHide) { _talkWindowText = _talkWindow.TalkWindowText; } Log.Debug("Removing talkwindowagent"); Context.AppAgentMgr.RemoveAgent(_talkWindowForm.Handle); Windows.CloseForm(_talkWindowForm); _talkWindowForm = null; _talkWindow = null; AuditLog.Audit(new AuditEventTalkWindow("close")); } }
/// <summary> /// Create talk window. Doesn't show the form though, just /// creates the object. /// </summary> /// <returns>true on success</returns> public bool CreateTalkWindow() { if (_talkWindowForm == null) { IsPaused = false; _talkWindowForm = PanelManagement.Context.AppPanelManager.CreatePanel("TalkWindow"); _talkWindow = _talkWindowForm as ITalkWindow; _talkWindowForm.FormClosed += _talkWindowForm_FormClosed; _talkWindow.FontSize = _fontSize; _fontSize = _talkWindow.FontSize; _talkWindowForm.TopMost = true; subscribeEvents(); } else { Log.Debug("ACHTUNG! _TalkWindow is not null!!"); } return true; }