コード例 #1
0
 /// <summary>
 /// Overriden in derived classes and used to ping back to determine the state
 /// </summary>
 /// <param name="state">an object state containing details of the command response</param>
 protected override void Pingback(object state)
 {
     var command = new GetDeploymentStatusCommand(HostedServiceName, ProductionOrStaging)
                       {
                           SubscriptionId = SubscriptionId,
                           Certificate = ManagementCertificate
                       };
     command.Execute();
     DeploymentStatus status = command.DeploymentStatus;
     if (status != CurrentState && RoleStatusChangeHandler != null)
         RoleStatusChangeHandler(status, CurrentState);
     CurrentState = status;
 }
コード例 #2
0
        /// <summary>
        /// Overriden in derived classes and used to ping back to determine the state
        /// </summary>
        /// <param name="state">an object state containing details of the command response</param>
        protected override void Pingback(object state)
        {
            DeploymentStatus status;
            var command = new GetDeploymentStatusCommand(HostedServiceName, ProductionOrStaging)
                              {
                                  SubscriptionId = SubscriptionId,
                                  Certificate = ManagementCertificate
                              };
            try
            {
                command.Execute();
                status = command.DeploymentStatus;
            }
            catch (WebException webx)
            {
                // put this in if we can't get a reading back from this!!
                status = DeploymentStatus.Unknown;
            }

            if (status != CurrentState && RoleStatusChangeHandler != null)
                RoleStatusChangeHandler(this, new CloudServiceState(CurrentState, status));
            CurrentState = status;
        }