void RefreshNewsSyncThreadEntry(Action onSuccess, Action<Exception> onError) { try { var client = new Client(RPC_URI); client.LogIn(USERNAME, PASSWORD); var resp = client.ListNewsHeadlines(ApplicationSettings.Instance.CategoryCode, ApplicationSettings.Instance.MaxCount); News = resp.Headlines; client.LogOut(); onSuccess(); } catch (Exception exc) { onError(exc); } }