Ejemplo n.º 1
0
 /// <summary>
 /// 注册自动化类型
 /// </summary>
 public void Register(IAutomation automation)
 {
     if (!_automationTable.Contains(automation.Guid))
     {
         _automationTable.Add(automation.Guid, automation.GetType());
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// 注册自动化类型
		/// </summary>
		public void Register(IAutomation automation)
		{
			if (!_automationTable.Contains(automation.Guid))
			{
				_automationTable.Add(automation.Guid, automation.GetType());
			}
		}