/// <summary> /// 注册自动化类型 /// </summary> public void Register(IAutomation automation) { if (!_automationTable.Contains(automation.Guid)) { _automationTable.Add(automation.Guid, automation.GetType()); } }
public IAutomation RegisterAutomation(IAutomation a) { if (a == null) { throw new ArgumentNullException(); } if (RegisteredAutomations.ContainsKey(a.Name)) { throw new ArgumentException($"Canot register automation '{a.Name}' of type '{a.GetType()}'. It's already registered."); } RegisteredAutomations.Add(a.Name, a); LOGGER.Info($"Registered automation '{a.Name}' of type '{a.GetType()}'"); return(a); }