Пример #1
0
        public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf, int side)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                m_widget = new ICE3Control(XMLConf, this);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse = true;
                }
                else
                {
                    m_widget.Inverse = false;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Fehler beim Erstellen des Widgets! ("+e.Message+")");
            }

            try
            {
                pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE);
            }
            catch(Exception)
            {
                MessageBox.Show("Fehler! Das Hintergrundbild \""+BACKGROUND_IMAGE+"\" konnte nicht geladen werden!");
            }

            if (side == 1)
                net = new Network(ref m_widget, "(links)");
            else if (side == 2)
                net = new Network(ref m_widget, "(rechts)");
            else
                return;

            if (t == null)
            {
                t = new Thread(new ThreadStart(net.Connect));
                t.IsBackground = true;
                t.Priority = m_XMLConf.thread_prio;
                t.Start();
                Thread.Sleep(1);
            }

            /*
            MMI.EBuLa.Network ebula_net = null;
            m_widget_ebula = new MMI.EBuLa.EbulaControl(m_XMLConf, ref ebula_net);
            m_widget_ebula.Visible = false;
            P_Display.Controls.Add(m_widget_ebula);
            /*if (m_XMLConf.Inverse)
            {
                m_widget_ebula.Inverse();
            }*/
        }
Пример #2
0
 public void Terminate()
 {
     m_widget.Dispose();
     m_widget = null;
     t.Abort();
     t = null;
     net = null;
     GC.Collect();
 }