Ejemplo n.º 1
0
 public Miner(int p, string t, bool l, PoolItem pi, Process pr, string log)
 {
     pid = p;
     threads = t;
     lowCpu = l;
     pool = pi;
     proc = pr;
     logFile = log;
     hashrate = "0 h/s";
     priority = 3;
 }
Ejemplo n.º 2
0
        private void poolsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (poolsList.SelectedIndex == -1 || poolsList.SelectedIndex == null)
            {
                return;
            }

            string selItem = poolsList.SelectedItem as string;

            int id = int.Parse(selItem.Split(']')[0].Substring(1));

            curItem = poolList.Find(x => x.id == id);

            addressText.Text  = curItem.address;
            userText.Text     = curItem.user;
            passwordText.Text = curItem.password;
            notesText.Text    = curItem.description;

            removeButton.Enabled = true;
            saveButton.Enabled   = true;
            startButton.Enabled  = true;
        }
        private void ReadList()
        {
            poolList.Clear();
            poolsList.Items.Clear();
            PoolItem.resetId();

            addressText.Text     = String.Empty;
            userText.Text        = String.Empty;
            passwordText.Text    = String.Empty;
            notesText.Text       = String.Empty;
            removeButton.Enabled = false;
            saveButton.Enabled   = false;
            startButton.Enabled  = false;

            string[] items;
            try {
                items = File.ReadAllLines("pool_list.txt");
            } catch (IOException) {
                items = new string[0];
            }


            if (items.Length == 0)
            {
                return;
            }

            foreach (string item in items)
            {
                string[] itemParams = item.Split('|');
                poolList.Add(new PoolItem(itemParams[0], itemParams[1], itemParams[2], itemParams[3]));
            }

            foreach (PoolItem item in poolList)
            {
                poolsList.Items.Add("[" + item.id + "] " + item.address + " -=::=- " + item.description);
            }
        }
        private void PoolsList_SelectedIndexChanged(object sender, EventArgs e)
        {
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            if (poolsList.SelectedIndex == -1 || poolsList.SelectedIndex == null)
            {
                return;
            }
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'

            string selItem = poolsList.SelectedItem as string;

            int id = int.Parse(selItem.Split(']')[0].Substring(1));
            curItem = poolList.Find(x => x.id == id);

            addressText.Text  = curItem.address;
            userText.Text     = curItem.user;
            passwordText.Text = curItem.password;
            notesText.Text    = curItem.description;

            removeButton.Enabled = true;
            saveButton.Enabled   = true;
            startButton.Enabled  = true;
        }
Ejemplo n.º 5
0
        private void poolsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (poolsList.SelectedIndex == -1 || poolsList.SelectedIndex == null) return;

            string selItem = poolsList.SelectedItem as string;

            int id = int.Parse(selItem.Split(']')[0].Substring(1));
            curItem = poolList.Find(x => x.id == id);

            addressText.Text = curItem.address;
            userText.Text = curItem.user;
            passwordText.Text = curItem.password;
            notesText.Text = curItem.description;

            removeButton.Enabled = true;
            saveButton.Enabled = true;
            startButton.Enabled = true;
        }