internal bool WindowExists(IRCConnection connection, string windowName, IceTabPage.WindowType windowType) { foreach (IceTabPage t in this.TabPages) { if (t.Connection == null) { if (t.WindowStyle == IceTabPage.WindowType.DCCFile) { if (t.TabCaption.ToLower() == windowName.ToLower()) return true; } } else if (t.Connection == connection) { if (t.WindowStyle == windowType) { if (t.TabCaption.ToLower() == windowName.ToLower()) return true; } } } return false; }
/// <summary> /// Refresh the Nicklist with the Current Channel/Query Selected /// </summary> /// <param name="window"></param> internal void RefreshList(IceTabPage page) { if (page.WindowStyle == IceTabPage.WindowType.Channel) { if (this.currentWindow != page) { selectedIndex = -1; topIndex = 0; vScrollBar.Value = 0; vScrollBar.Visible = false; } this.currentWindow = page; UpdateHeader(page.TabCaption + ":" + page.Nicks.Count); } else if (page.WindowStyle == IceTabPage.WindowType.Query) { this.currentWindow = page; UpdateHeader("Query:" + page.TabCaption); } else if (page.WindowStyle == IceTabPage.WindowType.ChannelList) { this.currentWindow = page; UpdateHeader("Channels (" + page.TotalChannels + ")"); } else if (page.WindowStyle == IceTabPage.WindowType.DCCChat) { this.currentWindow = page; UpdateHeader("DCC Chat:" + page.TabCaption); } else if (page.WindowStyle == IceTabPage.WindowType.Window) { this.currentWindow = page; UpdateHeader(page.TabCaption); } else if (page.WindowStyle == IceTabPage.WindowType.DCCFile) { this.currentWindow = page; UpdateHeader(page.TabCaption); } else if (page.WindowStyle == IceTabPage.WindowType.Debug) { this.currentWindow = page; UpdateHeader("Debug"); } }
internal void SelectTab(IceTabPage page) { if (CurrentTab != null && CurrentTab.TextWindow != null) CurrentTab.TextWindow.resetUnreadMarker(); for (int i = 0; i < _TabPages.Count; i++) { if (_TabPages[i] == page) { SelectedIndex = i; this.Invalidate(); if (this.SelectedIndexChanged != null) { TabEventArgs e = new TabEventArgs(); e.IsHandled = true; SelectedIndexChanged(this, e); } break; } } }
/// <summary> /// Create a Default Tab for showing Welcome Information /// </summary> private void CreateDefaultConsoleWindow() { IceTabPage p = new IceTabPage(IceTabPage.WindowType.Console, "Console"); p.AddConsoleTab(iceChatLanguage.consoleTabWelcome); mainTabControl.TabPages.Add(p); WindowMessage(null, "Console", "\x00034Welcome to " + ProgramID + " " + VersionID, 1, false); WindowMessage(null, "Console", "\x00034** This is a Release Candidate version, fully functional, not all the options are added **", 1, false); WindowMessage(null, "Console", "\x00033If you want a fully working version of \x0002IceChat\x0002, visit http://www.icechat.net and download IceChat 7.70", 1, false); WindowMessage(null, "Console", "\x00034Please visit \x00030,4#icechat\x0003 on \x00030,2irc://irc.quakenet.org/icechat\x0003 if you wish to help with this project", 1, true); }
/// <summary> /// Erase the Nicklist and change the Header to the Console /// </summary> /// <param name="cwindow"></param> internal void RefreshList() { this.currentWindow = null; UpdateHeader("Console"); }
/// <summary> /// Remove a Tab Window from the Main Tab Control /// </summary> /// <param name="connection">Which Connection it is for</param> /// <param name="channel">The Channel/Query Window Name</param> internal void RemoveWindow(IRCConnection connection, string windowCaption, IceTabPage.WindowType windowType) { this.Invoke((MethodInvoker)delegate() { IceTabPage t = GetWindow(connection, windowCaption, IceTabPage.WindowType.Channel); if (t != null) { mainTabControl.Controls.Remove(t); return; } IceTabPage c = GetWindow(connection, windowCaption, IceTabPage.WindowType.Query); if (c != null) { mainTabControl.Controls.Remove(c); return; } IceTabPage dcc = GetWindow(connection, windowCaption, IceTabPage.WindowType.DCCChat); if (dcc != null) { mainTabControl.Controls.Remove(dcc); return; } IceTabPage cl = GetWindow(connection, "", IceTabPage.WindowType.ChannelList); if (cl != null) { mainTabControl.Controls.Remove(cl); return; } IceTabPage de = GetWindow(null, "Debug", IceTabPage.WindowType.Debug); if (de != null) mainTabControl.Controls.Remove(de); }); }
/// <summary> /// Gets a Tab Window /// </summary> /// <param name="connection">Which Connection to use</param> /// <param name="name">Name of the Window</param> /// <param name="windowType">The Window Type</param> /// <returns></returns> internal IceTabPage GetWindow(IRCConnection connection, string sCaption, IceTabPage.WindowType windowType) { foreach (IceTabPage t in mainTabControl.TabPages) { if (t.TabCaption.ToLower() == sCaption.ToLower() && t.WindowStyle == windowType) { if (t.Connection == null && windowType == IceTabPage.WindowType.DCCFile) return t; else if (t.Connection == null && windowType == IceTabPage.WindowType.Debug) return t; else if (t.Connection == connection) return t; } else if (t.WindowStyle == windowType && windowType == IceTabPage.WindowType.ChannelList) { return t; } } return null; }
/// <summary> /// Add a new Tab Window to the Main Tab Control /// </summary> /// <param name="connection">Which Connection it came from</param> /// <param name="windowName">Window Name of the New Tab</param> /// <param name="windowType">Window Type of the New Tab</param> internal IceTabPage AddWindow(IRCConnection connection, string windowName, IceTabPage.WindowType windowType) { if (this.InvokeRequired) { AddWindowDelegate a = new AddWindowDelegate(AddWindow); return (IceTabPage)this.Invoke(a, new object[] { connection, windowName, windowType }); } else { IceTabPage page; if (windowType == IceTabPage.WindowType.DCCFile) page = new IceTabPageDCCFile(IceTabPage.WindowType.DCCFile, windowName); else { page = new IceTabPage(windowType, windowName); page.Connection = connection; } if (page.WindowStyle == IceTabPage.WindowType.Channel) { page.TextWindow.Font = new Font(iceChatFonts.FontSettings[1].FontName, iceChatFonts.FontSettings[1].FontSize); page.TopicWindow.Font = new Font(iceChatFonts.FontSettings[1].FontName, iceChatFonts.FontSettings[1].FontSize); //send the message string msg = GetMessageFormat("Self Channel Join"); msg = msg.Replace("$nick", connection.ServerSetting.NickName).Replace("$channel", windowName); if (FormMain.Instance.IceChatOptions.LogChannel) page.TextWindow.SetLogFile(); page.TextWindow.AppendText(msg, 1); } else if (page.WindowStyle == IceTabPage.WindowType.Query) { page.TextWindow.Font = new Font(iceChatFonts.FontSettings[2].FontName, iceChatFonts.FontSettings[2].FontSize); if (FormMain.Instance.IceChatOptions.LogQuery) page.TextWindow.SetLogFile(); } else if (page.WindowStyle == IceTabPage.WindowType.Debug) { page.TextWindow.NoColorMode = true; page.TextWindow.Font = new Font("Verdana", 10); page.TextWindow.SetLogFile(); page.TextWindow.SetDebugWindow(); } //find the last window index for this connection int index = 0; if (page.WindowStyle == IceTabPage.WindowType.Channel || page.WindowStyle == IceTabPage.WindowType.Query || page.WindowStyle == IceTabPage.WindowType.DCCChat || page.WindowStyle == IceTabPage.WindowType.DCCFile) { for (int i = 1; i < mainTabControl.TabPages.Count; i++) { if (mainTabControl.TabPages[i].Connection == connection) index = i + 1; } } if (index == 0) mainTabControl.TabPages.Add(page); else mainTabControl.TabPages.Insert(index, page); if (page.WindowStyle == IceTabPage.WindowType.Query && !iceChatOptions.NewQueryForegound) { mainTabControl.SelectTab(mainTabControl.CurrentTab); serverTree.SelectTab(mainTabControl.CurrentTab, false); } else { mainTabControl.SelectTab(page); nickList.CurrentWindow = page; serverTree.SelectTab(page, false); } if (page.WindowStyle == IceTabPage.WindowType.Query && iceChatOptions.WhoisNewQuery) ParseOutGoingCommand(page.Connection, "/whois " + page.TabCaption); return page; } }
public Logging(IceTabPage tabPage) { this._tabPage = tabPage; CreateStandardLog(); }
public FormChannelInfo(IceTabPage Channel) { InitializeComponent(); this.FormClosing += new FormClosingEventHandler(OnFormClosing); this.textTopic.KeyDown += new KeyEventHandler(textTopic_KeyDown); this.channel = Channel; this.textTopic.Text = channel.ChannelTopic.Replace("", ((char)3).ToString()); this.topic = textTopic.Text; this.Text = channel.TabCaption + " [" + channel.ChannelModes + "] {" + channel.Connection.ServerSetting.RealServerName + "}"; this.channel.HasChannelInfo = true; this.channel.ChannelInfoForm = this; buttonRemoveBan.Enabled = false; User u = channel.GetNick(channel.Connection.ServerSetting.NickName); if (u != null && u.Level != null) { for (int y = 0; y < u.Level.Length; y++) { if (u.Level[y]) { if (channel.Connection.ServerSetting.StatusModes[0][y] == 'q') buttonRemoveBan.Enabled = true; else if (channel.Connection.ServerSetting.StatusModes[0][y] == 'a') buttonRemoveBan.Enabled = true; else if (channel.Connection.ServerSetting.StatusModes[0][y] == 'o') buttonRemoveBan.Enabled = true; } } } //parse out the modes foreach (IceTabPage.channelMode cm in channel.ChannelModesHash.Values) { switch (cm.mode) { case 'n': checkModen.Checked = true; modeN = true; break; case 't': checkModet.Checked = true; modeT = true; break; case 's': checkModes.Checked = true; modeS = true; break; case 'i': checkModei.Checked = true; modeI = true; break; case 'm': checkModem.Checked = true; modeM = true; break; case 'l': checkModel.Checked = true; modeL = true; textMaxUsers.Text = cm.param; break; case 'k': checkModek.Checked = true; modeK = true; textChannelKey.Text = cm.param; break; } } ApplyLanguage(); }