Abstract base class used to encapsulate a command to a hosted service
Inheritance: ICommand
 /// <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;
 }
        /// <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;
        }
Example #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;
 }
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new DeleteDeploymentCommand("bob", DeploymentSlot.Staging);
 }
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new CreateHostedServiceCommand("bob", "bill");
 }
 public void Initialize()
 {
     _mockQueryManager = new Mock<IQueryManager>();
     ServiceCommand.CurrentQueryManager = _mockQueryManager.Object;
     _command = new AddServiceCertificateCommand(new byte[] { 0x00, 0x02 }, "password", "myservice");
 }