Beispiel #1
0
        public void AddToRepository(string SystemName)
        {
            SystemRepositoryRoot RepositoryManager = ReadRepository();
            SystemAttributes     SystemAttrib      = new SystemAttributes();

            SystemAttrib.SystemName = SystemName;
            RepositoryManager.SystemRepository.Add(SystemAttrib);
            SaveRepository(RepositoryManager);
        }
Beispiel #2
0
        public void RemoveFromRepository(string MachineName)
        {
            bool MachineFound = false;
            SystemRepositoryRoot SystemListRoot = ReadRepository();
            SystemAttributes     TargetMachine  = SystemListRoot.SystemRepository.RetrieveMachine(MachineName, ref MachineFound);

            if (MachineFound)
            {
                SystemListRoot.SystemRepository.Delete(TargetMachine);
                SaveRepository(SystemListRoot);
            }
        }
Beispiel #3
0
        public SystemAttributes RetrieveMachine(string SystemName, ref bool Found)
        {
            bool             FoundFlag     = false;
            SystemAttributes TargetMachine = new SystemAttributes();

            foreach (object MachineObj in List)
            {
                SystemAttributes MachineAttrib = MachineObj as SystemAttributes;
                if (MachineAttrib.SystemName.CompareTo(SystemName) == 0)
                {
                    FoundFlag     = true;
                    TargetMachine = MachineAttrib;
                    break;
                }
            }
            Found = FoundFlag;
            return(TargetMachine);
        }
Beispiel #4
0
 public void Delete(SystemAttributes SysAttribute)
 {
     List.Remove(SysAttribute);
 }
Beispiel #5
0
 public void Add(SystemAttributes SysAttribute)
 {
     List.Add(SysAttribute);
 }