コード例 #1
0
        public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                m_widget = new BR185Control(XMLConf);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse();
                }
                else
                {
                    m_widget.Inverse();
                    m_widget.Inverse();
                }
            }
            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!");
            }

            net = new Network(ref m_widget);

            if (t == null)
            {
                t = new Thread(new ThreadStart(net.Connect));
                t.IsBackground = true;
                //t.Priority = m_XMLConf.thread_prio;
                t.Priority = ThreadPriority.Highest;
                t.Start();
                Thread.Sleep(1);
            }
        }
コード例 #2
0
 public void Terminate()
 {
     m_widget.Dispose();
     m_widget = null;
     t.Abort();
     t = null;
     //net.Dispose();
     net = null;
     GC.Collect();
 }