Exemplo n.º 1
0
        private void ThreadPlay(object obj)
        {
            ThreadContext threadContext = (ThreadContext)obj;

            try
            {
                if (threadContext.HWnd != IntPtr.Zero && !threadContext.IsExit)
                {
                    if (threadContext.Path != null && !threadContext.Path.Equals(""))
                    {
                        PlayPath(threadContext);
                    }
                    else
                    {
                        if (threadContext.Images == null)
                        {
                            threadContext.Images = ToArray();
                        }

                        if (threadContext.Images.Count > 0 && !threadContext.IsExit)
                        {
                            PlayImages(threadContext);
                        }
                    }
                }
                lock (mThreadContexts.SyncRoot)
                {
                    mThreadContexts.Remove("ThreadContext_" + threadContext.Handle);
                }
            }
            finally
            {
                if (threadContext.Progress != 100)
                {
                    threadContext.Progress = 100;
                }

                threadContext.Dispose();
            }
        }
Exemplo n.º 2
0
        private void ThreadSave(object obj)
        {
            ThreadContext threadContext = (ThreadContext)obj;

            try
            {
                if (!threadContext.IsExit)
                {
                    if (threadContext.Images == null)
                    {
                        threadContext.Images = ToArray();
                    }

                    if (threadContext.Images.Count > 0)
                    {
                        SaveImages(threadContext);
                    }
                    else
                    {
                        threadContext.Progress = 100;
                    }
                }
                lock (mThreadContexts.SyncRoot)
                {
                    mThreadContexts.Remove("ThreadContext_" + threadContext.Handle);
                }
            }
            finally
            {
                if (threadContext.Progress != 100)
                {
                    threadContext.Progress = 100;
                }

                threadContext.Dispose();
            }
        }