private bool TimeoutFunction(TenantOperationMessage message) { if (message == TenantOperationMessage.CreatingSiteCollection) { Host.UI.Write("."); } return(Stopping); }
private bool TimeoutFunction(TenantOperationMessage message) { if (message == TenantOperationMessage.SettingSiteProperties || message == TenantOperationMessage.SettingSiteLockState) { Host.UI.Write("."); } return(Stopping); }
private bool TimeoutFunction(TenantOperationMessage message) { if (message == TenantOperationMessage.RemovingDeletedSiteCollectionFromRecycleBin) { this.Host.UI.Write("."); } return(Stopping); }
private bool TimeoutFunction(TenantOperationMessage message) { switch (message) { case TenantOperationMessage.DeletingSiteCollection: case TenantOperationMessage.RemovingDeletedSiteCollectionFromRecycleBin: Host.UI.Write("."); break; } return(Stopping); }
private static bool WaitForIsComplete(Tenant tenant, SpoOperation op, Func <TenantOperationMessage, bool> timeoutFunction = null, TenantOperationMessage operationMessage = TenantOperationMessage.None) { bool succeeded = true; while (!op.IsComplete) { if (timeoutFunction != null && timeoutFunction(operationMessage)) { succeeded = false; break; } Thread.Sleep(op.PollingInterval); op.RefreshLoad(); if (!op.IsComplete) { try { tenant.Context.ExecuteQueryRetry(); } catch (WebException webEx) { // Context connection gets closed after action completed. // Calling ExecuteQuery again returns an error which can be ignored Log.Warning(CoreResources.TenantExtensions_ClosedContextWarning, webEx.Message); } } } return(succeeded); }
private bool WaitForIsComplete(ClientContext context, SpoOperation op, Func <TenantOperationMessage, bool> timeoutFunction = null, TenantOperationMessage operationMessage = TenantOperationMessage.None) { bool succeeded = true; while (!op.IsComplete) { if (timeoutFunction != null && timeoutFunction(operationMessage)) { succeeded = false; break; } Thread.Sleep(op.PollingInterval); op.RefreshLoad(); if (!op.IsComplete) { try { context.ExecuteQueryRetry(); } catch (WebException) { // Context connection gets closed after action completed. // Calling ExecuteQuery again returns an error which can be ignored } } } return(succeeded); }