예제 #1
0
        public void Start()
        {
            StopProcessing = false;
            cgGate.Close();

            cgExecutingThread      = new Thread(ThreadProc);
            cgExecutingThread.Name = "Screenshot Provider";
            cgExecutingThread.Start();
        }
예제 #2
0
        /// <summary>
        /// Closes the gate and updates return value on failure
        /// </summary>
        /// <param name="gate">Gate to close</param>
        /// <param name="returnValue">Return value</param>
        /// <returns>True if closed successfully</returns>
        private bool CloseGate(IGate <T> gate, ref T returnValue)
        {
            T value = gate.Close();

            if (!IsSuccess(value))
            {
                // Makes sure return value has the last occured failure
                returnValue = value;
                LogHelper.LogError("Failed to close gate '{0}'", gate.GetType().Name);
                return(false);
            }
            return(true);
        }