Exemplo n.º 1
0
        public bool UpdateShare(Share share, SecureItem item, string newStatus)
        {
            try
            {
                ShareRequest reqData = new ShareRequest();
                reqData.uuid = share.Id.ToString();

                reqData.data = EncriptItemForShare(share, Encoding.UTF8.GetString(Convert.FromBase64String(share.ReceiverPrivateKey)));

                dynamic response = pbWebApi.RequestShare(reqData, String.Format("{0}|{1}", pbData.ActiveUser, pbData.DeviceUUID));

                if (response.error != null)
                {
                    MessageBox.Show(response.error.details.ToString(), response.error.message.ToString());
                    return(false);
                }

                share.Data   = reqData.data;
                share.Status = reqData.status;
                pbData.AddOrUpdateShare(share);
                return(true);
            }
            catch
            {
            }
            return(false);
        }