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[], ICommandBinding)View.InvokeCommand(Command, ICommandBinding)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.GetTopSuperView(View, View)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.DefaultAcceptViewView.CommandsToBubbleUpView.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.ActivatedView.HandlingHotKeyView.HotKeyCommandView.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
HasPendingReplyIndicator
public bool HasPendingReplyIndicator { 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?, bool?, 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, bool? isProtected = null, bool? isSystem = 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
SetReplyingTo(string?)
Shows/clears the "replying to" strip on the input frame's title. Pass null to clear.
public void SetReplyingTo(string? label)
Parameters
labelstring
SetStagedAttachments(IReadOnlyList<string>, string)
Updates the attachment staging indicator shown on the input frame's title, including the current ASCII-art size for images. Passing an empty list restores the default hint.
public void SetStagedAttachments(IReadOnlyList<string> fileNames, string asciiSizeLabel)
Parameters
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
OnDeleteMessageRequested
Fired when the user presses Delete on the selected message. Parameter is the message id.
public event Action<Guid>? OnDeleteMessageRequested
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
OnFilesStaged
Fired when local files arrive via paste or drag-and-drop to be staged as attachments. Parameters: channel name, absolute paths of existing files.
public event Action<string, IReadOnlyList<string>>? OnFilesStaged
Event Type
OnImageOpenRequested
Fired when the user activates an image's "[open]" action to view it without saving. Parameters: attachmentUrl, fileName.
public event Action<string, string>? OnImageOpenRequested
Event Type
OnImagePasted
Fired when raw image data is pasted from the clipboard (e.g. copied from a browser or a screenshot tool). Parameters: channel name, PNG-encoded image bytes.
public event Action<string, byte[]>? OnImagePasted
Event Type
OnImageSaveRequested
Fired when the user activates an image's "[save original]" line. Parameters: attachmentUrl, fileName.
public event Action<string, string>? OnImageSaveRequested
Event Type
OnLoadMoreRequested
Fired when the user scrolls to the top of the message list and older messages should be loaded.
public event Action? OnLoadMoreRequested
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
OnReplyCancelRequested
Fired when the user cancels a pending reply (Esc in the input field).
public event Action? OnReplyCancelRequested
Event Type
OnReplyRequested
Fired when the user picks "Reply" on a message. Parameters: message id, sender username, a short plain-text snippet for the reply strip.
public event Action<Guid, string, string>? OnReplyRequested
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
OnSearchRequested
Fired when the user requests to open the search dialog (via menu or Ctrl+K).
public event Action? OnSearchRequested
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