private void SrvManager_ServerSelected(object sender, IrcShark.ServerSelectedEventArgs args) { BaseWindow window; window = (BaseWindow)this.Owner.ActiveMdiChild; window.AssociatedConnection.Server = args.SelectedServer; Close(); }
/// <summary> /// Starts the TerminalExtension. /// </summary> public override void Start(IrcShark.Extensions.ExtensionContext context) { Context = context; // Set encoding to the system ANSI codepage for special characters Console.InputEncoding = Encoding.Default; AddCommands(); // disable the default console logger and replace it with the TerminalLogger Context.Application.Log.LoggedMessage -= Context.Application.DefaultConsoleLogger; Context.Application.Log.LoggedMessage += TerminalLogger; currentTerminal = new ConsoleTerminal(); // Register the AutoCompleteEvent currentTerminal.AutoCompleteEvent += new AutoCompleteHandler(AutoComplete); drawStartupLogo(); // unregister the default console logger as of incompatibility; readerThread = new Thread(new ThreadStart(this.Run)); running = true; readerThread.Start(); }
/// <summary> /// Saves an IrcNetwork to a NetworkSettings instance. /// </summary> /// <param name="network">The IrcNetwork to save.</param> /// <returns>The generated NetworkSettings instance.</returns> public NetworkSettings SaveNetwork(IrcShark.Chatting.INetwork network) { IrcNetwork net = network as IrcNetwork; if (net == null) { throw new ArgumentException("The given network is not an irc network"); } NetworkSettings settings = new NetworkSettings(); settings.Protocol = net.Protocol.Name; settings.Name = net.Name; foreach (IrcServerEndPoint server in net) { ServerSettings servSet = new ServerSettings(); servSet.Name = server.Name; servSet.Address = string.Format("{0}:{1}", server.Address, server.Port); if (!string.IsNullOrEmpty(server.Password)) { servSet.Parameters.Add("Password", server.Password); } settings.Servers.Add(servSet); } return settings; }
public NetworkManagerForm(IrcShark.IrcSharkApplication app) { InitializeComponent(); NetManager.BoundedNetworkManager = app.Servers; }