public static void AddServiceFileRecord(ServiceFileRecord serviceFileRecord)
        {
            if (instance == null)
                instance = new ServiceFileRecordRegistry();

            if (!instance.serviceFileRecords.ContainsKey(serviceFileRecord.Name))
                instance.serviceFileRecords.Add(serviceFileRecord.Name, serviceFileRecord);
            else
                instance.serviceFileRecords[serviceFileRecord.Name] = serviceFileRecord;
        }
Beispiel #2
0
        public static ISensor BuildSensor(ServiceFileRecord serviceFileRecord)
        {
            if (!store.ContainsKey(serviceFileRecord.Protocol))
            {
                throw new Exception("Can't find builder for " + serviceFileRecord.Protocol);
            }

            ISensor sensor = store[serviceFileRecord.Protocol](serviceFileRecord);

            return(sensor);
        }
        public static void AddServiceFileRecord(ServiceFileRecord serviceFileRecord)
        {
            if (instance == null)
            {
                instance = new ServiceFileRecordRegistry();
            }

            if (!instance.serviceFileRecords.ContainsKey(serviceFileRecord.Name))
            {
                instance.serviceFileRecords.Add(serviceFileRecord.Name, serviceFileRecord);
            }
            else
            {
                instance.serviceFileRecords[serviceFileRecord.Name] = serviceFileRecord;
            }
        }