Exemplo n.º 1
0
        private void CB_ProcessID_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProcHelper _procHelper = new ProcHelper();

            _procHelper.Update();

            // if user selected some process by id, print its name to the textbox
            foreach (var p in _procHelper.CurrentProcesses)
            {
                if (CB_ProcessID.SelectedItem == null)
                {
                    break;
                }
                if (CB_ProcessID.SelectedItem.ToString() == p.Id.ToString())
                {
                    TB_ProcessName.Text = p.ProcessName;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the forwardDir and sidewaysDir of the store.
        /// </summary>
        void RandomDirections()
        {
            // Set a random forward direction.
            int dirIndex = ProcHelper.RandomDirectionIndex(random);

            // Set the forward size and direction.
            forwardDir  = ProcHelper.directions[dirIndex];
            forwardSize = GetSize(dirIndex);

            // Increase the dirIndex by one, if it's out of range for the direction
            // array, loop it back to 0.
            dirIndex++;
            if (dirIndex > 3)
            {
                dirIndex = 0;
            }

            // Set the sideways size and direction.
            sidewaysDir  = ProcHelper.directions[dirIndex];
            sidewaysSize = GetSize(dirIndex);
        }