void GetMediaHandler(ShareResponse data) { var task = new WebBrowserTask { Uri = new Uri(data.Url) }; task.Show(); }
void OnShareSuccess(ShareResponse response) { Utilities.ShowProgressIndicator(false); ShareLink = response.Url; var vm = SimpleIoc.Default.GetInstance <MetaDataViewModel>(SelectedImage.ImagePath); Messenger.Default.Send(vm, MessengerToken.GetLink); }
private void SlushMiningPoolClient_OnEnqueMessage(object sender, string e) { Task.Factory.StartNew(() => { var str = ""; lock (this.synObject) { str = this._queue.Dequeue(); } var jObject = JObject.Parse(str); var id = jObject["id"]; if (id != null && this._requestTable.ContainsKey(id.ToString())) { var request = this._requestTable[id.ToString()]; var reponse = JsonConvert.DeserializeObject <JsonRpcResponse>(str); if (request is AuthorizeRequest) { var authResponse = AuthorizeResponse.BuildFrom(reponse); this.RaiseOnAuthorizeResponse(new ReceiveMessageEventArgs <AuthorizeResponse>(authResponse)); } if (request is SubscribeRequest) { var subScribeResponse = SubscribeResponse.BuildFrom(reponse); this.RaiseOnSubscribeResponse(new ReceiveMessageEventArgs <SubscribeResponse>(subScribeResponse)); } if (request is ShareRequest) { var shareResponse = ShareResponse.BuildFrom(reponse); this.RaiseOnShareResponse(new ReceiveMessageEventArgs <ShareResponse>(shareResponse)); } } else { var method = jObject["method"].ToString(); if (!string.IsNullOrWhiteSpace(method)) { if (method == "mining.notify") { var jsonRequest = JsonConvert.DeserializeObject <JsonRpcRequest>(str); var request = NotifyRequest.BuildFrom(jsonRequest); this.RaiseOnNotifyRequest(new ReceiveMessageEventArgs <NotifyRequest>(request)); } if (method == "mining.set_difficulty") { var jsonRequest = JsonConvert.DeserializeObject <JsonRpcRequest>(str); var request = SetDifficultyRequest.BuildFrom(jsonRequest); this.RaiseOnSetDifficultyRequest(new ReceiveMessageEventArgs <SetDifficultyRequest>(request)); } } } }); }
public String Share(String dropbox_path) { try { ShareResponse share = client.GetShare(dropbox_path); return(share.Url); } catch (DropboxException ex) { MessageBox.Show(new Form { TopMost = true }, ex.Message); } return(String.Empty); }
public String GetMedialUrl(string path, AuthCredential credential) { if (String.IsNullOrEmpty(path)) { return(null); } var _client = new DropNetClient(MogConstants.DROPBOX_KEY, MogConstants.DROPBOX_SECRET); UserLogin User = new UserLogin() { Token = credential.Token, Secret = credential.Secret }; _client.UserLogin = User; _client.UseSandbox = true; ShareResponse response = _client.GetMedia(path); return(response != null ? response.Url : null); }
void OnShareSuccess(ShareResponse response) { Utilities.ShowProgressIndicator(false); ShareLink = response.Url; Messenger.Default.Send(this, MessengerToken.GetLink); }