Example #1
0
            public IPeripheralsGroup GetOrCreate(string name)
            {
                IPeripheralsGroup result;

                if (!TryGetByName(name, out result))
                {
                    result = new PeripheralsGroup(name, machine);
                    groups.Add((PeripheralsGroup)result);
                }

                return(result);
            }
Example #2
0
            public IPeripheralsGroup GetOrCreate(string name, IEnumerable <IPeripheral> peripherals)
            {
                IPeripheralsGroup existingResult = null;
                var result = (PeripheralsGroup)existingResult;

                if (!TryGetByName(name, out existingResult))
                {
                    result = new PeripheralsGroup(name, machine);
                    groups.Add(result);
                }

                foreach (var p in peripherals)
                {
                    result.Add(p);
                }

                return(result);
            }