private void server_PartSelf(object sender, PartEventArgs e) { NetworkSettings nwSettings = IrcSettingsManager.Instance.GetNetwork(Server); ChannelSettings chan = nwSettings.GetChannel(e.Channel.Name); chan.AutoJoin = false; }
private void addNetworkToolStripMenuItem_Click(object sender, EventArgs e) { NetworkSettings net = IrcSettingsManager.Instance.AddNetwork("New Network"); var node = new NetworkSettingsTreeNode(net, networkContextMenuStrip); ircSettingsTree.Nodes.Add(node); node.BeginEdit(); }
private void ParentServer_OnJoinSelf(object sender, Common.DataEventArgs <Channel> e) { ((MainForm)MdiParent).CreateChannelForm(e.Data); NetworkSettings nwSettings = IrcSettingsManager.Instance.GetNetwork(Server); ChannelSettings chan = nwSettings.GetChannel(e.Data.Name) ?? nwSettings.AddChannel(e.Data); chan.AutoJoin = true; }
private void Load() { try { var serializer = new XmlSerializer(typeof(NetworkSettingsList), new XmlRootAttribute("EpicServerList")); var fs = new FileStream(settingsPath, FileMode.Open); Networks = (NetworkSettingsList)serializer.Deserialize(fs); fs.Close(); } catch (FileNotFoundException) { NetworkSettings net = AddNetwork("RandomIRC"); net.AddServer(new ServerSettings("apps.randomirc.com", "Random", "6667", false)); net.AddChannel(new ChannelSettings("#ortzirc", true)); } }
public NetworkSettingsTreeNode(NetworkSettings settings, ContextMenuStrip menu) { Text = settings.Name; Settings = settings; ContextMenuStrip = menu; }
public bool RemoveNetwork(NetworkSettings network) { return(Networks.Remove(network)); }
private void DoRegister() { string network = Server.Connection.ServerProperties["Network"]; NetworkSettings networkSettings = IrcSettingsManager.Instance.GetNetwork(Server); if (networkSettings == null) { NetworkSettings tempNet; if (network == String.Empty) { tempNet = IrcSettingsManager.Instance.AddNetwork(Server.Url); //TODO: Get domain name to use as network name, or something network = "Network"; } else { tempNet = IrcSettingsManager.Instance.AddNetwork(network); } tempNet.AddServer(new ServerSettings(Server.Url, "Random", Server.Port.ToString(), Server.Connection.ConnectionData.Ssl) { AutoConnect = true }); } else { if (network == String.Empty) { network = networkSettings.Name; } else { networkSettings.Name = network; } ServerSettings nServer = networkSettings.GetServer(Server.Url); if (nServer == null) { networkSettings.AddServer(new ServerSettings(Server.Url, "Random", Server.Port.ToString(), Server.Connection.ConnectionData.Ssl) { AutoConnect = true }); } } Text = ServerStrings.ServerFormTitleBar.With( server.UserNick, network, server.Url, server.Port); if (nickRetryFailed) { AddLine(ServerStrings.RandomNickMessage); } nickRetry = 0; nickRetryFailed = false; if (networkSettings == null || networkSettings.Channels == null) { return; } foreach (ChannelSettings channel in networkSettings.Channels) { if (channel.AutoJoin) { Server.JoinChannel(channel.Name); } } }