Ejemplo n.º 1
0
        private static bool CancelPlay(bool manualActivate)
        {
            lock (typeof(YouTube))
            {
                if (oldState == null && httpResponse == null)
                {
                    return(false);
                }

                if (httpResponse != null)
                {
                    httpResponse.Abort();
                    httpResponse = null;
                }

                if (!manualActivate && oldState != null)
                {
                    oldState.Revert();
                    SystemTray.ProgressIndicator.IsVisible = false;
                    oldState = null;
                }

                return(true);
            }
        }