Exemple #1
0
        public ComponentWindowThumbnailsFullHD(int TestID, string MT, int PrinterID, string Status, string Login)
        {
            //this.Topmost = true;
            _testID    = TestID;
            _mt        = MT;
            _printerID = PrinterID;
            _status    = Status;
            _login     = Login;

            _managers          = Managers.CreateManagers();
            _printerManager    = _managers.GetPrinterManager();
            _buttonListManager = _managers.GetButtonListManager();
            _autoUpdate        = AUTOUPDATE.AutoUpdate.CreateAutoUpdate();
            _mysqlManager      = _managers.GetMySQLManager();

            //_printer = _printerManager.GetPrinterByMT(_mt);
            _printer = _printerManager.GetPrinterByID(_printerID);
            _imageStatusButtonList    = new List <Image>();
            _dismantledComponentsList = new List <Component>();
            foreach (var value in _printer.GetComponentList())
            {
                _dismantledComponentsList.Add(value);
            }

            InitializeComponent();

            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick    += timer_Tick;
            _timer.Start();

            _maxButtonsOnPage = _maxColumnsOnPage * _maxRowsOnPage;
            _pageMax          = _dismantledComponentsList.Count / (_maxButtonsOnPage);
            if ((_dismantledComponentsList.Count % _maxButtonsOnPage) > 0)
            {
                _pageMax++;
            }
            if (_dismantledComponentsList.Count < _maxButtonsOnPage)
            {
                _pageMax = 1;
            }
            if (_pageMax > 1)
            {
                btnRight.Visibility = Visibility.Visible;
            }

            //CreateButtons
            CreateButtonList();
            ButtonSetVisibility();
            CreateImageButtonList();

            _pageCount = _mysqlManager.GetPageCountByTestID(_testID);

            this.lblPC.Content      = "Page Count: " + _pageCount;
            this.lblMT.Content      = "MT: " + _mt + " \tStrona: " + _pageCurrent + " / " + _pageMax;
            _dismantleStartDateTime = DateTime.Now;
        }