Пример #1
0
        private void getItemsData()
        {
            DataTable     itemsTable = new DataTable();
            SQLiteManager mngr       = new SQLiteManager();

            itemsTable = mngr.getListItems("WINDOWS");
            mngr.ConnectionClose();
            foreach (DataRow row in itemsTable.Rows)
            {
                if (row[0].ToString().Equals(tableBD))
                {
                    itemsInWidth  = Convert.ToInt32(row[1]);
                    itemsInHeight = Convert.ToInt32(row[2]);
                    itemSpace     = Convert.ToDouble(row[3]);
                    itemWidth     = Convert.ToDouble(row[5]);
                    itemHeight    = Convert.ToDouble(row[4]);
                    try
                    {
                        fontSize = Convert.ToDouble(row[6]);
                    }
                    catch
                    {
                        fontSize = 14.0;
                    }

                    break;
                }
            }
            itemsCount = itemsInWidth * itemsInHeight;
        }
Пример #2
0
        public override void enablePreset()
        {
            string[] files = FileManager.getOnlyFileNamesFromDirectory(_text);
            foreach (string s in files)
            {
                DirectoryInfo source = new DirectoryInfo(_text);
                DirectoryInfo target = new DirectoryInfo(INIT.GAME_ROOT);
                FileManager.CopyAllDirectoryContent(source, target);
            }

            SQLiteManager mngr = new SQLiteManager();

            mngr.setENBInDB(_name);

            mngr.ConnectionClose();
            rb.IsChecked            = true;
            INIT.CURRENT_ENB_OPTION = _name;
        }
Пример #3
0
        private void install()
        {
            try
            {
                removeFiles();

                FileManager.downloadBig(httpLink, INIT.CTRL_PANEL_DIR + "Update" + _position.ToString() + ".exe");
                unpackArchive(INIT.CTRL_PANEL_DIR + "Update" + _position.ToString() + ".exe");
                SQLiteManager checkAsInstalled = new SQLiteManager();
                checkAsInstalled.setUpdateInstalled("WINDOW_UPDATES", _position);

                checkAsInstalled.ConnectionClose();
                instButton.MouseDown -= installbtn_Click;
            }
            catch (downloadArchiveUpdateException)
            {
                MessageBox.Show("Не удалось скачать обновление номер " + _position.ToString());
                lblnumber.Foreground  = Brushes.Red;
                lbldate.Foreground    = Brushes.Red;
                lblname.Foreground    = Brushes.Red;
                instButton.Foreground = Brushes.Red;
                instButton.Content    = "НЕ УСТАНОВЛЕНО";
            }
            catch (unpackArchiveUpdateException)
            {
                MessageBox.Show("Не удалось распаковать архив с обновлением номер " + _position.ToString());
                lblnumber.Foreground  = Brushes.Red;
                lbldate.Foreground    = Brushes.Red;
                lblname.Foreground    = Brushes.Red;
                instButton.Foreground = Brushes.Red;
                instButton.Content    = "НЕ УСТАНОВЛЕНО";
            }
            lblnumber.Foreground  = Brushes.Green;
            lbldate.Foreground    = Brushes.Green;
            lblname.Foreground    = Brushes.Green;
            instButton.Foreground = Brushes.Green;
            instButton.Content    = "УСТАНОВЛЕНО";
        }