public ClientSampleHttpLoggerOutputSuppression(AzureContext context) { azureContext = context; if (!context.TryGetValue <bool>(AzureHttpLogger.PropertySuppressOutput, out OriginalSuppressValue)) { OriginalSuppressValue = false; } AzureHttpLogger.SetSuppressOutput(context, true); }
private AzureContext Initialise(string defaultProjectName) { if (isInitialsed) { return(this); } AzureHttpLogger loggerHandler = new AzureHttpLogger(); VssHttpMessageHandler vssHandler = new VssHttpMessageHandler( Credentials, VssClientHttpRequestSettings.Default.Clone()); this.Connection = new AzureConnection( this.AzureProjectUrl, vssHandler, new DelegatingHandler[] { loggerHandler }); //* Establishing connection, which may fail also :) this.Connection.ConnectAsync().SyncResult(); #region Configuring for project TeamProjectReference defaultProject = this.FindProject(defaultProjectName); if (defaultProject == null) { throw new Exception(string.Format("Failed to initised - Missing project '{0}'", defaultProjectName)); } SetValue("$defautProject", defaultProject); SetValue("$allAssignToUsers", this.GetAllTeamMembers().Select(item => item.Identity.DisplayName).ToArray()); #endregion isInitialsed = true; return(this); }
public void Dispose() { AzureHttpLogger.SetSuppressOutput(azureContext, OriginalSuppressValue); }