bool ICookieManager.DeleteCookies(string url, string name, IDeleteCookiesCallback callback) { if (managerReady) { return(manager.DeleteCookies(url, name, callback)); } throw new InvalidOperationException(NotInitialziedExceptionMsg); }
public bool del_cookie(string url, string name_value) { //base if (chrome.RequestContext == null) { return(Cef.GetGlobalCookieManager().DeleteCookies(url, name_value)); } else { //RequestContext ICookieManager cookie_del = chrome.RequestContext.GetCookieManager(null); return(cookie_del.DeleteCookies(url, name_value)); } }
public void DeleteCookies(string url, string name, bool global) { ICookieManager cookieManager = null; if (global) { cookieManager = Cef.GetGlobalCookieManager(); } else { cookieManager = ((ChromiumWebBrowser)Browser).RequestContext.GetDefaultCookieManager(null); } if (cookieManager != null) { cookieManager.DeleteCookies(url, name); } }
private async Task PerformAction(ActionType action) { switch (action) { case ActionType.DisplayIncome: _displayer.DisplayIncome(await _financeService.GetIncomeHistory()); break; case ActionType.DisplayExpenses: _displayer.DisplayExpenses(await _financeService.GetExpenseHistory()); break; case ActionType.DisplayFullInformation: _displayer.DisplayFullInformation(await _financeService.GetFullInformation()); break; case ActionType.AddNewIncome: await AddNewIncome(); break; case ActionType.AddNewExpense: await AddNewExpense(); break; case ActionType.ClearHistory: await _financeService.ClearHistory(); break; case ActionType.Exit: TurnOffApp(); break; case ActionType.Logout: await _cookieManager.DeleteCookies(); TurnOffApp(); break; default: break; } }
/// <summary> /// Deletes all cookies that matches all the provided parameters asynchronously. /// If both <paramref name="url"/> and <paramref name="name"/> are empty, all cookies will be deleted. /// </summary> /// <param name="cookieManager">cookie manager</param> /// <param name="url">The cookie URL. If an empty string is provided, any URL will be matched.</param> /// <param name="name">The name of the cookie. If an empty string is provided, any URL will be matched.</param> /// <returns>Returns -1 if a non-empty invalid URL is specified, or if cookies cannot be accessed; /// otherwise, a task that represents the delete operation. The value of the TResult will be the number of cookies that were deleted or -1 if unknown.</returns> public static Task <int> DeleteCookiesAsync(this ICookieManager cookieManager, string url = null, string name = null) { if (cookieManager == null) { throw new NullReferenceException("cookieManager"); } if (cookieManager.IsDisposed) { throw new ObjectDisposedException("cookieManager"); } var callback = new TaskDeleteCookiesCallback(); if (cookieManager.DeleteCookies(url, name, callback)) { return(callback.Task); } //There was a problem deleting cookies return(Task.FromResult(TaskDeleteCookiesCallback.InvalidNoOfCookiesDeleted)); }
private void ClearCookie() { Token.TokenCode = ""; userName.Text = ""; mCookieManager.DeleteCookies(Domain, TokenKey); }