public Task <string> LockRequestAsync(byte[] label) { var lockFunction = new LockFunction(); lockFunction.Label = label; return(ContractHandler.SendRequestAsync(lockFunction)); }
public Task <TransactionReceipt> LockRequestAndWaitForReceiptAsync(byte[] label, CancellationTokenSource cancellationToken = null) { var lockFunction = new LockFunction(); lockFunction.Label = label; return(ContractHandler.SendRequestAndWaitForReceiptAsync(lockFunction, cancellationToken)); }
private External.CURLSH_UNLOCK_DELEGATE m_pDelUnlock; // unlock delegate /// <summary> /// Constructor /// </summary> /// <exception cref="System.InvalidOperationException">This is thrown /// if <see cref="Curl"/> hasn't bee properly initialized.</exception> /// <exception cref="System.NullReferenceException">This is thrown if /// the native <c>share</c> handle wasn't created successfully.</exception> public Share() { Curl.EnsureCurl(); m_pShare = External.curl_share_init(); EnsureHandle(); m_pfLock = null; m_pfUnlock = null; m_userData = null; InstallDelegates(); }
/// <summary> /// Set options for this object. /// </summary> /// <param name="option"> /// One of the values in the <see cref="CURLSHoption"/> /// enumeration. /// </param> /// <param name="parameter"> /// An appropriate object based on the value passed in the /// <c>option</c> argument. See <see cref="CURLSHoption"/> /// for more information about the appropriate parameter type. /// </param> /// <returns> /// A <see cref="CURLSHcode"/>, hopefully /// <c>CURLSHcode.CURLSHE_OK</c>. /// </returns> /// <exception cref="System.NullReferenceException">This is thrown if /// the native <c>share</c> handle wasn't created successfully.</exception> public CURLSHcode SetOpt(CURLSHoption option, Object parameter) { EnsureHandle(); CURLSHcode retCode = CURLSHcode.CURLSHE_OK; switch (option) { case CURLSHoption.CURLSHOPT_LOCKFUNC: LockFunction lf = parameter as LockFunction; if (lf == null) { return(CURLSHcode.CURLSHE_BAD_OPTION); } m_pfLock = lf; break; case CURLSHoption.CURLSHOPT_UNLOCKFUNC: UnlockFunction ulf = parameter as UnlockFunction; if (ulf == null) { return(CURLSHcode.CURLSHE_BAD_OPTION); } m_pfUnlock = ulf; break; case CURLSHoption.CURLSHOPT_SHARE: case CURLSHoption.CURLSHOPT_UNSHARE: { CURLlockData opt = (CURLlockData) Convert.ToInt32(parameter); if ((opt != CURLlockData.CURL_LOCK_DATA_COOKIE) && (opt != CURLlockData.CURL_LOCK_DATA_DNS)) { return(CURLSHcode.CURLSHE_BAD_OPTION); } retCode = External.curl_share_setopt(m_pShare, option, (IntPtr)opt); break; } case CURLSHoption.CURLSHOPT_USERDATA: m_userData = parameter; break; default: retCode = CURLSHcode.CURLSHE_BAD_OPTION; break; } return(retCode); }
public Task <TransactionReceipt> LockRequestAndWaitForReceiptAsync(LockFunction lockFunction, CancellationTokenSource cancellationToken = null) { return(ContractHandler.SendRequestAndWaitForReceiptAsync(lockFunction, cancellationToken)); }
public Task <string> LockRequestAsync(LockFunction lockFunction) { return(ContractHandler.SendRequestAsync(lockFunction)); }
/// <summary> /// Set options for this object. /// </summary> /// <param name="option"> /// One of the values in the <see cref="CURLSHoption"/> /// enumeration. /// </param> /// <param name="parameter"> /// An appropriate object based on the value passed in the /// <c>option</c> argument. See <see cref="CURLSHoption"/> /// for more information about the appropriate parameter type. /// </param> /// <returns> /// A <see cref="CURLSHcode"/>, hopefully /// <c>CURLSHcode.CURLSHE_OK</c>. /// </returns> /// <exception cref="System.NullReferenceException">This is thrown if /// the native <c>share</c> handle wasn't created successfully.</exception> public CURLSHcode SetOpt(CURLSHoption option, Object parameter) { EnsureHandle(); CURLSHcode retCode = CURLSHcode.CURLSHE_OK; switch(option) { case CURLSHoption.CURLSHOPT_LOCKFUNC: LockFunction lf = parameter as LockFunction; if (lf == null) return CURLSHcode.CURLSHE_BAD_OPTION; m_pfLock = lf; break; case CURLSHoption.CURLSHOPT_UNLOCKFUNC: UnlockFunction ulf = parameter as UnlockFunction; if (ulf == null) return CURLSHcode.CURLSHE_BAD_OPTION; m_pfUnlock = ulf; break; case CURLSHoption.CURLSHOPT_SHARE: case CURLSHoption.CURLSHOPT_UNSHARE: { CURLlockData opt = (CURLlockData) Convert.ToInt32(parameter); if ((opt != CURLlockData.CURL_LOCK_DATA_COOKIE) && (opt != CURLlockData.CURL_LOCK_DATA_DNS)) return CURLSHcode.CURLSHE_BAD_OPTION; retCode = External.curl_share_setopt(m_pShare, option, (IntPtr)opt); break; } case CURLSHoption.CURLSHOPT_USERDATA: m_userData = parameter; break; default: retCode = CURLSHcode.CURLSHE_BAD_OPTION; break; } return retCode; }