WebAccountProviderRetrieveCookiesOperation
WebAccountProviderRetrieveCookiesOperation
WebAccountProviderRetrieveCookiesOperation
WebAccountProviderRetrieveCookiesOperation
Class
Definition
Represents a retrieve cookies operation made by a web account provider.
public : sealed class WebAccountProviderRetrieveCookiesOperation : IWebAccountProviderBaseReportOperation, IWebAccountProviderOperation, IWebAccountProviderRetrieveCookiesOperationpublic sealed class WebAccountProviderRetrieveCookiesOperation : IWebAccountProviderBaseReportOperation, IWebAccountProviderOperation, IWebAccountProviderRetrieveCookiesOperationPublic NotInheritable Class WebAccountProviderRetrieveCookiesOperation Implements IWebAccountProviderBaseReportOperation, IWebAccountProviderOperation, IWebAccountProviderRetrieveCookiesOperation// You can use this class in JavaScript.
- Attributes
Windows 10 requirements
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Examples
The following demonstrates how to handle a retrieve cookies operation:
void HandleRetrieveCookies(WebAccountProviderRetrieveCookiesOperation operation)
{
try
{
// Parse the Uri to retrieve context information
Uri myUri = ParseMyUri(operation.Context);
// Do custom logic based on the context
// INSERT LOGIC HERE
// Get the HttpCookieCollection for the Uri
HttpBaseProtocolFilter filt = new HttpBaseProtocolFilter();
HttpCookieCollection cookies = filt.CookieManager.GetCookies(myUri);
foreach (HttpCookie cookie in cookies)
{
operation.Cookies.Add(cookie);
}
operation.ReportCompleted();
}
catch (Exception ex)
{
WebProviderError error = new WebProviderError(ERROR_CODE_FOO, ex.Message);
operation.ReportError(error);
}
}
Properties
ApplicationCallbackUri ApplicationCallbackUri ApplicationCallbackUri ApplicationCallbackUri
Gets the app callback Uri.
public : Uri ApplicationCallbackUri { get; }public Uri ApplicationCallbackUri { get; }Public ReadOnly Property ApplicationCallbackUri As Uri// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
The app callback Uri.
Context Context Context Context
Gets the context of the retrieve cookies operation.
public : Uri Context { get; }public Uri Context { get; }Public ReadOnly Property Context As Uri// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
The context of the retrieve cookies operation.
Cookies Cookies Cookies Cookies
Gets the cookies.
public : IVector<HttpCookie> Cookies { get; }public IList<HttpCookie> Cookies { get; }Public ReadOnly Property Cookies As IList<HttpCookie>// You can use this property in JavaScript.
- Value
- IVector<HttpCookie> IList<HttpCookie> IList<HttpCookie> IList<HttpCookie>
The cookies to retrieve.
Kind Kind Kind Kind
Gets the kind of web account provider operation.
public : WebAccountProviderOperationKind Kind { get; }public WebAccountProviderOperationKind Kind { get; }Public ReadOnly Property Kind As WebAccountProviderOperationKind// You can use this property in JavaScript.
- Value
- WebAccountProviderOperationKind WebAccountProviderOperationKind WebAccountProviderOperationKind WebAccountProviderOperationKind
The kind of web account provider operation.
Methods
ReportCompleted() ReportCompleted() ReportCompleted() ReportCompleted()
Informs the activating app that the operation completed successfully.
public : void ReportCompleted()public void ReportCompleted()Public Function ReportCompleted() As void// You can use this method in JavaScript.
ReportError(WebProviderError) ReportError(WebProviderError) ReportError(WebProviderError) ReportError(WebProviderError)
Informs the activating app that the operation encountered an error.
public : void ReportError(WebProviderError value)public void ReportError(WebProviderError value)Public Function ReportError(value As WebProviderError) As void// You can use this method in JavaScript.
Parameters
The type of error encountered.