Abstract base class used to encapsulate a command to a hosted service
Inheritance: ICommand
コード例 #1
0
 /// <summary>
 /// Gets the name of the command from the list
 /// </summary>
 /// <param name="command">The ServiceCommand</param>
 /// <returns>The "name" of the command within the Service Management API</returns>
 public string GetCommandName(ServiceCommand command)
 {
     string commandType = CommandNameMapContainer[command.GetType()];
     if (commandType == null)
         return command.ToString();
     return commandType;
 }
コード例 #2
0
        /// <summary>
        /// Gets the name of the command from the list
        /// </summary>
        /// <param name="command">The ServiceCommand</param>
        /// <returns>The "name" of the command within the Service Management API</returns>
        public string GetCommandName(ServiceCommand command)
        {
            if (CommandNameMapContainer.ContainsKey(command.GetType()))
            {
                return CommandNameMapContainer[command.GetType()];
            }

            return command.GetType().Name;
        }
コード例 #3
0
 /// <summary>
 /// Constructs a router for the type of command and exception that has been generated
 /// </summary>
 /// <param name="statusCode">An Http Status code between 100-500</param>
 /// <param name="command">The type of ServiceCommand being sent</param>
 public ErrorRouter(int statusCode, ServiceCommand command)
 {
     _command = command;
     _statusCode = statusCode;
 }
コード例 #4
0
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new DeleteDeploymentCommand("bob", DeploymentSlot.Staging);
 }
コード例 #5
0
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new CreateHostedServiceCommand("bob", "bill");
 }
コード例 #6
0
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new AddServiceCertificateCommand(new byte[] { 0x00, 0x02 }, "password", "myservice");
 }