/// <summary> /// Creates and displays a ServerForm and adds a node to the WindowManagerTreeView /// </summary> /// <param name="server"></param> public void CreateServerForm(Server server) { if (InvokeRequired) { Invoke(new Action <Server>(CreateServerForm), server); } else { var newServerForm = CompositionRoot.Resolve <ServerForm>(); newServerForm.Server = server; windowManagerTreeView.AddServerNode(new ServerTreeNode(newServerForm)); newServerForm.MdiParent = this; newServerForm.Text = server.Url; newServerForm.Show(); newServerForm.Enter += newForm_Enter; } }
public void CreatePmForm(PrivateMessageSession pm) { if (InvokeRequired) { Invoke(new Action <PrivateMessageSession>(CreatePmForm), pm); } else { var newPmForm = CompositionRoot.Resolve <PrivateMessageForm>(); newPmForm.PMSession = pm; ServerTreeNode node = windowManagerTreeView.GetServerNode(pm.Server); node.AddPmNode(new PmTreeNode(newPmForm)); node.Expand(); newPmForm.MdiParent = this; newPmForm.Show(); newPmForm.Enter += newForm_Enter; } }
/// <summary> /// Creates and displays a ChannelForm and adds a node to the WindowManagerTreeView under the appropriate server node /// </summary> /// <param name="channel"></param> public void CreateChannelForm(Channel channel) { if (InvokeRequired) { Invoke(new Action <Channel>(CreateChannelForm), new object[] { channel }); } else { var newChannelForm = CompositionRoot.Resolve <ChannelForm>(new ConstructorArgument("channel", channel)); ServerTreeNode node = windowManagerTreeView.GetServerNode(channel.Server); node.AddChannelNode(new ChannelTreeNode(newChannelForm)); node.Expand(); newChannelForm.MdiParent = this; newChannelForm.Show(); newChannelForm.AddLine("Joined: " + channel.Name); newChannelForm.Enter += newForm_Enter; } }