Ejemplo n.º 1
0
        public XElement GetXElement()
        {
            var element = new XElement("PC");

            element.SetAttributeValue("Code", Code);
            element.SetAttributeValue("Manufacturer", Manufacturer);
            element.SetAttributeValue("Proc", Proc);
            element.SetAttributeValue("Freq", Freq.ToString());
            element.SetAttributeValue("Mem", Mem.ToString());
            element.SetAttributeValue("HDD", HDD.ToString());
            element.SetAttributeValue("Video", Video.ToString());
            element.SetAttributeValue("Price", Price);
            element.SetAttributeValue("Count", Count);
            return(element);
        }
Ejemplo n.º 2
0
        public ListViewItem GetListViewItem()
        {
            var listItem = new ListViewItem(Code);

            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Manufacturer));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Proc));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Freq.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Mem.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, HDD.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Video.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Price.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Count.ToString()));
            listItem.SubItems.Add(new ListViewItem.ListViewSubItem(listItem, Proc));
            return(listItem);
        }
Ejemplo n.º 3
0
        public void ShowComputerSpecs()
        {
            StringBuilder manufAndModel = new StringBuilder();

            manufAndModel.Append(Manufacturer);
            manufAndModel.Append(" ");
            manufAndModel.Append(Model);
            manufAndModel.Append(" Specs:");
            Console.WriteLine(manufAndModel);
            CPU.ToString();
            GPU.ToString();
            HDD.ToString();
            Monitor.ToString();
            MotherBoard.ToString();
            RAM.ToString();
        }
Ejemplo n.º 4
0
        public override string ToString()
        {
            var           itemToString = string.Empty;
            StringBuilder sb           = new StringBuilder();

            sb.Append("Desktop PC Specs:");
            sb.Append(string.Format("\t {0}", Case.ToString()));
            sb.Append(string.Format("\t {0}", Cooler.ToString()));
            sb.Append(string.Format("\t {0}", CPU.ToString()));
            sb.Append(string.Format("\t {0}", GPU.ToString()));
            sb.Append(string.Format("\t {0}", HDD.ToString()));
            sb.Append(string.Format("\t {0}", Keyboard.ToString()));
            sb.Append(string.Format("\t {0}", Monitor.ToString()));
            sb.Append(string.Format("\t {0}", MotherBoard.ToString()));
            sb.Append(string.Format("\t {0}", Mouse.ToString()));
            sb.Append(string.Format("\t {0}", PSU.ToString()));
            sb.Append(string.Format("\t {0}", RAM.ToString()));
            itemToString = sb.ToString();
            return(itemToString);
        }