Esempio n. 1
0
 public void SetSoftwareAt(AbstractSoftware software, int index)
 {
     if ((index < 0) || (index >= softwares.Count))
     {
         throw new IndexOutOfRangeException();
     }
     softwares[index] = software;
 }
Esempio n. 2
0
 public void AddSoftware(AbstractSoftware software)
 {
     if (software is Virus)
     {
         throw new InvalidSoftwareException("Can't put Virus to Computer");
     }
     if (softwares.Contains(software))
     {
         throw new DuplicateSoftwareException();
     }
     softwares.Add(software);
 }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            if ((obj == null) || !(obj is AbstractSoftware))
            {
                return(false);
            }
            AbstractSoftware other = obj as AbstractSoftware;

            if ((Name != null) && Name.Equals(other.Name))
            {
                return(Version != null && Version.Equals(other.Version));
            }
            return(false);
        }
Esempio n. 4
0
 public void SetSoftwareAt(AbstractSoftware software, int index)
 {
     if (software is Virus)
     {
         throw new InvalidSoftwareException("Can't put Virus to Computer");
     }
     if (softwares.Contains(software))
     {
         throw new DuplicateSoftwareException();
     }
     if ((index < 0) || (index >= softwares.Count))
     {
         throw new IndexOutOfRangeException();
     }
     softwares[index] = software;
 }
Esempio n. 5
0
 public void AddSoftware(AbstractSoftware software)
 {
     softwares.Add(software);
 }