コード例 #1
0
        /// <summary>
        /// Retrieves the action to perform.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="client">The client.</param>
        /// <param name="action">The action definition.</param>
        /// <returns>The action to perform.</returns>
        private static Action <string> RetrieveAction(ILogger logger, CruiseServerClientBase client, CruiseServerControlTaskAction action)
        {
            Action <string> projectAction = null;

            switch (action.Type)
            {
            case CruiseServerControlTaskActionType.StartProject:
                logger.Info("Performing start project action");
                projectAction = p =>
                {
                    client.StartProject(p);
                };
                break;

            case CruiseServerControlTaskActionType.StopProject:
                logger.Info("Performing stop project action");
                projectAction = p =>
                {
                    client.StopProject(p);
                };
                break;
            }
            return(projectAction);
        }
コード例 #2
0
 /// <summary>
 /// Retrieves the action to perform.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="client">The client.</param>
 /// <param name="action">The action definition.</param>
 /// <returns>The action to perform.</returns>
 private static Action<string> RetrieveAction(ILogger logger, CruiseServerClientBase client, CruiseServerControlTaskAction action)
 {
     Action<string> projectAction = null;
     switch (action.Type)
     {
         case CruiseServerControlTaskActionType.StartProject:
             logger.Info("Performing start project action");
             projectAction = p =>
             {
                 client.StartProject(p);
             };
             break;
         case CruiseServerControlTaskActionType.StopProject:
             logger.Info("Performing stop project action");
             projectAction = p =>
             {
                 client.StopProject(p);
             };
             break;
     }
     return projectAction;
 }