Beispiel #1
0
        /// <summary>
        /// 进度返回处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="pce"></param>
        void worker_ProgressChanged(object sender, ProgressChangedEventArgs pce)
        {
            int number = pce.ProgressPercentage;

            if (number == -1)
            {
                //清空
                ClearAllColorExceptMembrane();
                iplay.EndPlayEvent();

                return;
            }
            if (number == 0)
            {
                //开始播放事件 - 进程中
                iplay.StartPlayEvent();
            }
            if (number == timeList.Count - 1)
            {
                //结束播放事件 - 进程中
                iplay.EndPlayEvent();
            }

            List <Light> x = timeDictionary[timeList[number]];

            for (int i = 0; i < x.Count(); i++)
            {
                //RoundedCornersPolygon rcp = lfe[x[i]] as RoundedCornersPolygon;
                if (x[i].Action == 128)
                {
                    if (GetButton(x[i].Position) is RoundedCornersPolygon rcp)
                    {
                        rcp.Fill = closeBrush;
                    }
                    if (GetButton(x[i].Position) is Ellipse e)
                    {
                        e.Fill = closeBrush;
                    }
                    if (GetButton(x[i].Position) is Rectangle r)
                    {
                        r.Fill = closeBrush;
                    }
                }
                else
                {
                    if (GetButton(x[i].Position) is RoundedCornersPolygon rcp)
                    {
                        rcp.Fill = StaticConstant.brushList[x[i].Color];
                    }
                    if (GetButton(x[i].Position) is Ellipse e)
                    {
                        e.Fill = StaticConstant.brushList[x[i].Color];
                    }
                    if (GetButton(x[i].Position) is Rectangle r)
                    {
                        r.Fill = StaticConstant.brushList[x[i].Color];
                    }
                }
            }
        }
        /// <summary>
        /// 进度返回处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (NowTime == SmallTime)
            {
                //开始播放事件 - 进程中
                if (iplay != null)
                {
                    iplay.StartPlayEvent();
                }
            }
            if (NowTime == MaxTime)
            {
                //结束播放事件 - 进程中
                if (iplay != null)
                {
                    iplay.EndPlayEvent();
                }
            }
            int i = SmallTime;

            for (int l = i; l < lightList.Count; l++)
            {
                if (lightList[l].Time == NowTime)
                {
                    i = l + 1;
                    if (lightList[l].Action == 128)
                    {
                        //停止播放=取消着色
                        SetButtonBackground(lightList[l].Position, closeBrush);
                    }
                    if (lightList[l].Action == 144)
                    {
                        //开始播放=开始着色
                        SetButtonBackground(lightList[l].Position, brushList[lightList[l].Color]);
                    }
                }
            }
        }
        /// <summary>
        /// 进度返回处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="pce"></param>
        void worker_ProgressChanged(object sender, ProgressChangedEventArgs pce)
        {
            int number = pce.ProgressPercentage;

            if (number == -1)
            {
                //清空
                ClearAllColorExceptMembrane();
                iplay.EndPlayEvent();

                return;
            }
            if (number == 0)
            {
                //开始播放事件 - 进程中
                iplay.StartPlayEvent();
            }
            if (number == timeList.Count - 1)
            {
                //结束播放事件 - 进程中
                iplay.EndPlayEvent();
            }

            int[] x = timeDictionary[timeList[number]];

            for (int i = 0; i < x.Count(); i++)
            {
                //RoundedCornersPolygon rcp = lfe[x[i]] as RoundedCornersPolygon;
                if (x[i] == 0)
                {
                    continue;
                }
                if (x[i] == -1)
                {
                    RoundedCornersPolygon rcp = GetButton(i) as RoundedCornersPolygon;
                    if (rcp != null)
                    {
                        rcp.Fill = closeBrush;
                    }
                    Ellipse e = GetButton(i) as Ellipse;
                    if (e != null)
                    {
                        e.Fill = closeBrush;
                    }
                    Rectangle r = GetButton(i) as Rectangle;
                    if (r != null)
                    {
                        r.Fill = closeBrush;
                    }
                }
                else
                {
                    RoundedCornersPolygon rcp = GetButton(i) as RoundedCornersPolygon;
                    if (rcp != null)
                    {
                        rcp.Fill = brushList[x[i] - 1];
                    }
                    Ellipse e = GetButton(i) as Ellipse;
                    if (e != null)
                    {
                        e.Fill = brushList[x[i] - 1];
                    }
                    Rectangle r = GetButton(i) as Rectangle;
                    if (r != null)
                    {
                        r.Fill = brushList[x[i] - 1];
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// 进度返回处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="pce"></param>
        void worker_ProgressChanged(object sender, ProgressChangedEventArgs pce)
        {
            int number = pce.ProgressPercentage;

            if (number == -1)
            {
                //清空
                ClearAllColorExceptMembrane();
                iplay.EndPlayEvent();
                return;
            }
            if (number == SmallTime)
            {
                //开始播放事件 - 进程中
                iplay.StartPlayEvent();
            }
            if (number == timeList.Count - 1)
            {
                //结束播放事件 - 进程中
                iplay.EndPlayEvent();
            }

            List <Light> x = timeDictionary[timeList[number]];

            for (int i = 0; i < x.Count(); i++)
            {
                //RoundedCornersPolygon rcp = lfe[x[i]] as RoundedCornersPolygon;
                if (x[i].Action == 128)
                {
                    (GetButton(x[i].Position) as Shape).Fill = closeBrush;
                }
                else
                {
                    (GetButton(x[i].Position) as Shape).Fill = StaticConstant.brushList[x[i].Color];
                }
            }

            //new Thread(() => {
            //    Dispatcher.Invoke(new Action(() =>
            //    {
            //        int number = pce.ProgressPercentage;

            //        if (number == -1)
            //        {
            //            //清空
            //            ClearAllColorExceptMembrane();
            //            iplay.EndPlayEvent();
            //            return;
            //        }
            //        if (number == SmallTime)
            //        {
            //            //开始播放事件 - 进程中
            //            iplay.StartPlayEvent();
            //        }
            //        if (number == timeList.Count - 1)
            //        {
            //            //结束播放事件 - 进程中
            //            iplay.EndPlayEvent();
            //        }

            //        List<Light> x = timeDictionary[timeList[number]];
            //        for (int i = 0; i < x.Count(); i++)
            //        {
            //            //RoundedCornersPolygon rcp = lfe[x[i]] as RoundedCornersPolygon;
            //            if (x[i].Action == 128)
            //            {
            //                (GetButton(x[i].Position) as Shape).Fill = closeBrush;
            //            }
            //            else
            //            {
            //                (GetButton(x[i].Position) as Shape).Fill = StaticConstant.brushList[x[i].Color];
            //            }
            //        }
            //    }));
            //}).Start();
        }