Пример #1
0
        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;
            }
        }
Пример #2
0
        /// <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;
            }
        }