Esempio n. 1
0
        /// <summary>
        /// Send and recieve string message.
        /// </summary>
        /// <param name="message">The received message</param>
        /// <param name="callback">The callback action handler.</param>
        /// <param name="state">The action state.</param>
        /// <returns>The send message</returns>
        public void MessageString(string message, Action <Nequeo.Threading.AsyncOperationResult <string> > callback, object state = null)
        {
            string keyName = "MessageString";

            _callback[keyName] = callback;
            _state[keyName]    = state;
            _asyncAccount.Execute <string>(u => u.MessageString(message), keyName);
        }
Esempio n. 2
0
        /// <summary>
        /// Downloads a request uri to a local file.
        /// </summary>
        /// <param name="requestUri">The request uri to download.</param>
        /// <param name="destinationFile">The local destination file to copy the data to.</param>
        /// <param name="callback">The callback action handler.</param>
        /// <param name="state">The action state.</param>
        public void DownloadFile(string requestUri, string destinationFile, Action <Nequeo.Threading.AsyncOperationResult <bool> > callback, object state = null)
        {
            string keyName = "DownloadFile";

            _callback[keyName] = callback;
            _state[keyName]    = state;
            _asyncAccount.Execute(u => u.DownloadFile(requestUri, destinationFile), keyName);
        }