public void Add(BulletinBoardObject pdo)
        {
            for (int mm = 0;
                 mm < _elements.Count;
                 mm++)
            {
                BulletinBoardObject pdm = _elements[mm] as BulletinBoardObject;

                if (pdm != null && pdo._msgser != pdm._msgser && pdo._parentSerial == pdm._msgser && pdm._msgser != 0 &&
                    pdo._parentSerial != 0 && pdo.index == 0)
                {
                    pdo.index = pdm.index;
                    _elements.Add(pdo);
                }
                else if (pdm != null && pdo._msgser != pdm._msgser && pdo._parentSerial == 0 && pdo.index == 0
                         )
                {
                    _indexMax++;
                    pdo.index = _indexMax;
                    _elements.Add(pdo);
                }
            }

            if (_elements.Count == 0)
            {
                pdo.index = 1;
                _indexMax = 1;
                _elements.Add(pdo);
            }

            if (_elements.Count == _item.Items.Count)
            {
                int conta = 1;
                int tolti = 0;
                while (tolti < _elements.Count)
                {
                    bool insert = false;
                    for (int m = 0; m < _elements.Count; m++)
                    {
                        BulletinBoardObject bob = _elements[m] as BulletinBoardObject;
                        if (bob != null && bob.index == conta)
                        {
                            _area.Add(bob);
                            insert    = true;
                            bob.index = 0;
                            tolti++;
                        }
                    }

                    if (insert)
                    {
                        conta++;
                    }
                }
                _elements.Clear();
                _indexMax = 0;
            }
        }
示例#2
0
        public void AddBulletinObject(uint serial, string msg)
        {
            foreach (var c in _area.Children)
            {
                if (c.LocalSerial == serial)
                {
                    c.Dispose();
                    break;
                }
            }

            BulletinBoardObject obj = new BulletinBoardObject(serial, msg);

            _area.Add(obj);
        }
示例#3
0
        public void AddBulletinObject(uint serial, string msg)
        {
            foreach (Control c in _databox.Children)
            {
                if (c.LocalSerial == serial)
                {
                    c.Dispose();

                    break;
                }
            }

            BulletinBoardObject obj = new BulletinBoardObject(serial, msg);

            _databox.Add(obj);

            _databox.WantUpdateSize = true;
            _databox.ReArrangeChildren();
        }
 public void Add(BulletinBoardObject obj)
 {
     _area.Add(obj);
 }