Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up typos and comments for ServiceClient SetUserAgent #1

Merged
merged 1 commit into from
May 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,48 +210,48 @@ protected void InitializeHttpClient(HttpClientHandler httpClientHandler, params
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(type.FullName,
GetClientVersion()));
}
/// <summary>
///A mehtod to set user agent
/// </summary>

/// <summary>
/// Sets the product name to be used in the user agent header when making requests
/// </summary>
/// <param name="productName">Name of the product to be used in the user agent</param>
public bool SetUserAgent(string productName)
{
if(!_disposed && HttpClient != null)
if (!_disposed && HttpClient != null)
{
/// <summary>
/// Dispose the the old useragent.
/// </summary>
// Clear the old user agent
HttpClient.DefaultRequestHeaders.UserAgent.Clear();
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName, GetClientVersion()));
// returns true if the userAgent was added

// Returns true if the user agent was set
return true;
}
/// <summary>
///returns false if the httpclient was disposed before invoking the method
/// </summary>

// Returns false if the HttpClient was disposed before invoking the method
return false;
}
/// <summary>
///Another method to setuseragent and its version
/// </summary>
public bool SetUserAgent(string productName,string version)

/// <summary>
/// Sets the product name and version to be used in the user agent header when making requests
/// </summary>
/// <param name="productName">Name of the product to be used in the user agent</param>
/// <param name="version">Version of the product to be used in the user agent</param>
public bool SetUserAgent(string productName, string version)
{
if(!_disposed && HttpClient != null)
if (!_disposed && HttpClient != null)
{
/// <summary>
/// Dispose the the old useragent.
/// </summary>
// Clear the old user agent
HttpClient.DefaultRequestHeaders.UserAgent.Clear();
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName,version));
/// <summary>
// returns true if the userAgent was added
/// </summary>
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName, version));

// Returns true if the user agent was set
return true;
}
/// <summary>
/// returns false if the httpclient was disposed before invoking the method
/// </summary>

// Returns false if the HttpClient was disposed before invoking the method
return false;
}

/// <summary>
/// Gets the AssemblyInformationalVersion if available
/// if not it gets the AssemblyFileVerion
Expand Down