Class MainWindow
Main Terminal.Gui window for the EchoHub chat client.
public sealed class MainWindow : Runnable, IDisposable, IRunnable
- Inheritance
-
ViewRunnableMainWindow
- Implements
-
IRunnable
- Inherited Members
-
Runnable.SetApp(IApplication)Runnable.RequestStop()Runnable.ResultRunnable.IsRunningRunnable.IsModalRunnable.StopRequestedRunnable.IsRunningChangingRunnable.IsRunningChangedRunnable.IsModalChangedView.NewMouseEvent(Mouse)View.RaiseMouseEvent(Mouse)View.GetAdornmentsThickness()View.GetSupportedCommands()View.InvokeCommands(Command[], IInputBinding)View.InvokeCommand(Command, IInputBinding)View.InvokeCommand(Command, ICommandContext)View.InvokeCommand(Command)View.SetContentSize(Size?)View.GetContentSize()View.GetWidthRequiredForSubViews()View.GetHeightRequiredForSubViews()View.ContentToScreen(in Point)View.ScreenToContent(in Point)View.ViewportToScreen(in Rectangle)View.ViewportToScreen(in Point)View.ViewportToScreen()View.ScreenToViewport(in Point)View.GetViewportOffsetFromFrame()View.Dispose()View.ToString()View.ToDebugString()View.BeginInit()View.EndInit()View.OnEnabledChanged()View.SetCursorNeedsUpdate()View.GetCurrentAttribute()View.GetAttributeForRole(VisualRole)View.SetAttribute(Attribute)View.SetAttributeForRole(VisualRole)View.GetClip()View.SetClip(Region)View.SetClipToScreen()View.ExcludeFromClip(Rectangle)View.ExcludeFromClip(Region)View.AddViewportToClip()View.Draw(DrawContext)View.DrawAdornments()View.ClearViewport(DrawContext)View.DrawText(DrawContext)View.DrawSubViews(DrawContext)View.RenderLineCanvas(DrawContext)View.AddRune(Rune)View.FillRect(Rectangle, Color?)View.FillRect(Rectangle, Rune)View.GetScheme()View.SetScheme(Scheme)View.Add(View)View.Add(params View[])View.Remove(View)View.RemoveAll()View.RemoveAll<TView>()View.MoveSubViewTowardsEnd(View)View.MoveSubViewToEnd(View)View.MoveSubViewTowardsStart(View)View.MoveSubViewToStart(View)View.AssignHotKeysToSubViews()View.NewKeyDownEvent(Key)View.Contains(in Point)View.FrameToScreen()View.ScreenToFrame(in Point)View.Layout(Size)View.Layout()View.SetRelativeLayout(Size)View.SetNeedsLayout()View.GetContainerSize()View.GetViewsUnderLocation(in Point, ViewportSettingsFlags)View.AdvanceFocus(NavigationDirection, TabBehavior?)View.FocusDeepest(NavigationDirection, TabBehavior?)View.OnCanFocusChanged()View.ClearFocus()View.SetFocus()View.SetNeedsDraw()View.SetNeedsDraw(Rectangle)View.OnTextChanged()View.MouseBindingsView.MouseHoldRepeatView.MousePositionTrackingView.MouseStateView.MouseHighlightStatesView.MarginView.ShadowStyleView.BorderView.BorderStyleView.PaddingView.ArrangementView.ContentSizeTracksViewportView.ViewportSettingsView.ViewportView.DataView.IdView.AppView.IsInitializedView.EnabledView.VisibleView.TitleView.CursorView.DiagnosticsView.LineCanvasView.SuperViewRendersLineCanvasView.SchemeNameView.HasSchemeView.SubViewsView.SuperViewView.HotKeyView.HotKeySpecifierView.AssignHotKeysView.UsedHotKeysView.KeyBindingsView.HotKeyBindingsView.FrameView.XView.YView.HeightView.WidthView.NeedsLayoutView.ValidatePosDimView.CanFocusView.FocusedView.IsCurrentTopView.MostFocusedView.HasFocusView.TabStopView.NeedsDrawView.HorizontalScrollBarView.VerticalScrollBarView.PreserveTrailingSpacesView.TextView.TextAlignmentView.TextDirectionView.TextFormatterView.VerticalTextAlignmentView.MouseEnterView.MouseLeaveView.MouseHoldRepeatChangingView.MouseHoldRepeatChangedView.MouseEventView.MouseStateChangedView.BorderStyleChangedView.CommandNotBoundView.AcceptingView.AcceptedView.ActivatingView.HandlingHotKeyView.ContentSizeChangingView.ContentSizeChangedView.ViewportChangedView.DisposingView.InitializedView.EnabledChangedView.VisibleChangingView.VisibleChangedView.TitleChangingView.TitleChangedView.GettingAttributeForRoleView.ClearingViewportView.ClearedViewportView.DrawingTextView.DrewTextView.DrawingContentView.DrawingSubViewsView.DrawCompleteView.SchemeNameChangingView.SchemeNameChangedView.GettingSchemeView.SchemeChangingView.SchemeChangedView.SuperViewChangingView.SuperViewChangedView.SubViewAddedView.SubViewRemovedView.RemovedView.HotKeyChangedView.KeyDownView.KeyDownNotHandledView.FrameChangedView.HeightChangingView.HeightChangedView.WidthChangingView.WidthChangedView.SubViewLayoutView.SubViewsLaidOutView.AdvancingFocusView.CanFocusChangedView.FocusedChangedView.HasFocusChangingView.HasFocusChangedView.TextChanged
Constructors
MainWindow(IApplication, ChatMessageManager)
public MainWindow(IApplication app, ChatMessageManager messageManager)
Parameters
appIApplicationmessageManagerChatMessageManager
Properties
CurrentChannel
Get the current channel name.
public string CurrentChannel { get; }
Property Value
Methods
ApplyColorSchemes()
Applies the currently registered color schemes to all views. Call after theme changes to refresh colors.
public void ApplyColorSchemes()
ClearAll()
Clear all messages and channels (used on disconnect).
public void ClearAll()
EnsureChannelInList(string, bool?)
Ensure a channel exists in the left panel list (used for private channels joined via /join).
public void EnsureChannelInList(string channelName, bool? isPublic = null)
Parameters
FocusInput()
Focus the input field for typing.
public void FocusInput()
GetChannelNames()
Get all channel names that have message buffers (for broadcasting status changes).
public IReadOnlyList<string> GetChannelNames()
Returns
- IReadOnlyList<string>
RefreshMenuBar()
Rebuilds and replaces the menu bar (e.g., after theme list changes).
public void RefreshMenuBar()
RemoveChannel(string)
Remove a channel from the left panel list.
public void RemoveChannel(string channelName)
Parameters
channelNamestring
SetChannelTopic(string, string?)
Update the topic for a specific channel.
public void SetChannelTopic(string channelName, string? topic)
Parameters
SetChannels(List<ChannelDto>)
Set the list of available channels, storing topics, and refresh the channel list view.
public void SetChannels(List<ChannelDto> channels)
Parameters
channelsList<ChannelDto>
SetCurrentUser(string)
Set the current user name (delegates to message manager for @mention detection).
public void SetCurrentUser(string username)
Parameters
usernamestring
ShowError(string)
Show an error message to the user.
public void ShowError(string message)
Parameters
messagestring
SwitchToChannel(string)
Switch the chat view to the given channel, resetting its unread count and updating the topic bar.
public void SwitchToChannel(string channelName)
Parameters
channelNamestring
ToggleUsersPanel()
Toggle the online users panel visibility (F2).
public void ToggleUsersPanel()
UpdateOnlineUsers(List<UserPresenceDto>)
Update the online users list display.
public void UpdateOnlineUsers(List<UserPresenceDto> users)
Parameters
usersList<UserPresenceDto>
UpdateStatusBar(string)
Update the connection status displayed in the status bar.
public void UpdateStatusBar(string status)
Parameters
statusstring
Events
OnAudioPlayRequested
Fired when the user activates (Enter/click) an audio message. Parameters: attachmentUrl, fileName.
public event Action<string, string>? OnAudioPlayRequested
Event Type
OnChannelJoinRequested
Fired when the user activates a #channel reference in a message. Parameter is the channel name.
public event Action<string>? OnChannelJoinRequested
Event Type
OnChannelSelected
Fired when the user selects a channel. Parameter is the channel name.
public event Action<string>? OnChannelSelected
Event Type
OnCheckForUpdatesRequested
Fired when the user requests to check for updates.
public event Action? OnCheckForUpdatesRequested
Event Type
OnConnectRequested
Fired when the user requests to connect via the menu.
public event Action? OnConnectRequested
Event Type
OnCreateChannelRequested
Fired when the user requests to create a new channel.
public event Action? OnCreateChannelRequested
Event Type
OnDeleteChannelRequested
Fired when the user requests to delete the current channel.
public event Action? OnDeleteChannelRequested
Event Type
OnDisconnectRequested
Fired when the user requests to disconnect via the menu.
public event Action? OnDisconnectRequested
Event Type
OnFileDownloadRequested
Fired when the user activates (Enter/click) a file message. Parameters: attachmentUrl, fileName.
public event Action<string, string>? OnFileDownloadRequested
Event Type
OnLogoutRequested
Fired when the user requests to logout (disconnect + revoke session).
public event Action? OnLogoutRequested
Event Type
OnMessageSubmitted
Fired when the user presses Enter in the input field. Parameters: channel name, message content.
public event Action<string, string>? OnMessageSubmitted
Event Type
OnProfileRequested
Fired when the user requests to open their profile panel.
public event Action? OnProfileRequested
Event Type
OnRollbackRequested
Fired when the user requests to rollback to the previous version.
public event Action? OnRollbackRequested
Event Type
OnSavedServersRequested
Fired when the user requests to view saved servers.
public event Action? OnSavedServersRequested
Event Type
OnStatusRequested
Fired when the user requests to set their status.
public event Action? OnStatusRequested
Event Type
OnThemeSelected
Fired when the user selects a theme from the menu. Parameter is the theme name.
public event Action<string>? OnThemeSelected
Event Type
OnUserProfileRequested
Fired when the user activates a username (in userlist or message). Parameter is the username.
public event Action<string>? OnUserProfileRequested