Esempio n. 1
0
        public FDownloader(int cmd, int conf, bool valid, bool borrar, string carpeta, bool decrypt)
        {
            _ = valid;
            _ = borrar;

            this.cmd     = cmd;
            this.carpeta = carpeta;
            this.decrypt = decrypt;

            bag = TargetBag.FromCode(BagCode.Genesis);
        }
Esempio n. 2
0
        private void HandleSecondaryAction(Item TargetItem)
        {
            if (TargetItem is ItemBag TargetBag)
            {
                //IClickableMenu PreviousMenu = this.Bag.PreviousMenu;
                //this.Bag.CloseContents(false, false);
                //TargetBag.OpenContents(InventorySource, ActualInventoryCapacity, PreviousMenu);
                TargetBag.OpenContents(IBM.InventorySource, IBM.ActualInventoryCapacity, this.Bag.ContentsMenu);

                this.HoveredSlot = null;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            bag = TargetBag.FromCode(BagCode.Genesis);
            if (!File.Exists("aclas.cfg"))
            {
                btConfComu_Click(null, null);
            }
            else
            {
                SetProtoHandler(new ProtoHandler(bag));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="bag">El tipo de target al que nos estamos conectando</param>
        public TargetConfigure(TargetBag bag)
        {
            InitializeComponent();

            this.originalBag = bag;
            portList         = new List <PortDescription>();
            tbIP.Top         = tbPort.Top = cbSpeed.Top;
            btPing.Top       = cbSpeed.Top - 1;
            lbPort.Top       = cbSpeed.Top + 3;

            try
            {
                using (ManagementObjectSearcher searcher =
                           new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity"))
                {
                    foreach (ManagementObject queryObj in searcher.Get())
                    {
                        object obj = queryObj["Name"];
                        if (obj != null)
                        {
                            var nom   = obj.ToString();
                            var index = nom.ToLower().IndexOf("(com");
                            if (index >= 0)
                            {
                                index++;
                                for (int i = index; i < nom.Length; i++)
                                {
                                    if (nom[i] == ')')
                                    {
                                        string portName = nom.Substring(index, i - index);
                                        portList.Add(new PortDescription {
                                            Name = portName, Description = nom
                                        });
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (ManagementException e)
            {
                MessageBox.Show($"Error examinando el equipo: '{e.Message}'");
            }

            portList.Add(new PortDescription {
                Name = "Red", Description = "Red Ethernet por TCP/IP"
            });
            portList.Sort((a, b) => a.Name.ToUpper().CompareTo(b.Name.ToUpper()));

            cbPortName.Items.Clear();
            foreach (var kvp in portList)
            {
                cbPortName.Items.Add(kvp);
                bool doSelect = originalBag.UseNetwork ?
                                kvp.Name.ToLower() == "red" :
                                kvp.Name.ToLower() == originalBag.PortName.ToLower();
                if (doSelect)
                {
                    cbPortName.SelectedIndex = cbPortName.Items.Count - 1;
                }
            }

            this.useSpeed = bag.Speed;
            this.Text     = " " + bag.Name;

            int    sel    = -1;
            string actual = useSpeed.ToString();

            foreach (var vn in Enum.GetNames(typeof(SpeedCode)))
            {
                if (vn == actual)
                {
                    sel = cbSpeed.Items.Count;
                }
                cbSpeed.Items.Add(vn.Substring(1));
            }
            if (sel >= 0)
            {
                cbSpeed.SelectedIndex = sel;
            }
            tbIP.Text = bag.IPAddress;
        }