Beispiel #1
0
 /// <summary>
 ///     Populate the set of roles which this station supports.  May be a zero-length list.
 /// </summary>
 /// <param name="configData">ConfigData for this station</param>
 protected virtual void PopulateRoles(ConfigData configData)
 {
     roles = configData.Values(Constants.StationRole).ToList();
 }
Beispiel #2
0
        /// <summary>
        /// Populate the set of commands which this station supports.  May be a zero-length list.
        /// </summary>
        /// <param name="configData">ConfigData for this station</param>
        /// <param name="commandResolver"></param>
        protected virtual void PopulateCommands(ConfigData configData, Resolver commandResolver)
        {
            var commandNames = configData.Values(Constants.StationCommand).ToList();

            foreach (var name in commandNames)
            {
                if (commandResolver == null)
                {
                    throw new Exception(string.Format("No CommandResolver available for command {0}, station {1}",
                        name, StationDescription));
                }
                var cmd = commandResolver.GetCommandByName(name);
                if (cmd == null)
                {
                    throw new Exception(string.Format("No Command found for commandName {0}, station {1}",
                        name, StationDescription));
                }
                Register(cmd);
            }
        }