/// <summary> /// Create a new token. /// </summary> /// <param name="uniqueIdentifier">The unique client identifier.</param> /// <param name="serviceName">The service name the client is connected to.</param> /// <param name="callback">The callback handler when a result is retured, a client web response.</param> /// <param name="actionName">The current action callback name.</param> /// <param name="state">The state callback handler object.</param> /// <exception cref="System.Exception"></exception> /// <exception cref="System.ArgumentNullException"></exception> public async void Create(string uniqueIdentifier, string serviceName, Action <string, object> callback, string actionName = "", object state = null) { Exception exec = null; var tokenData = await Nequeo.Threading.AsyncOperationResult <bool> . RunTask <string>(() => { try { return(TokenReader.Create(uniqueIdentifier, serviceName, _tokenData)); } catch (Exception ex) { exec = ex; return(null); } }); if (exec != null) { if (_callback_Exception != null) { _callback_Exception("Create", exec); } } if (callback != null) { callback(tokenData, state); } }