Пример #1
0
        //이제 그 이미지를 화면에 표시하고, 아래로 추락시키는 스레드를 연결시킨다.
        public static void fallingItem(ILwin.ShowScreen showscreen, WebItem thisitem, bool isFinal)
        {
            int item_y = 0;


            while (true)
            {
                //현재 webitem의 margin top 값을 가져온다
                showscreen.getMWinReference().Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate
                    {
                        item_y = (int)thisitem.imgrec.Margin.Top;
                    }));

                Thread.Sleep(50);

                if (item_y > thisitem.FallYpos)
                {
                    break;
                }

                else
                {
                    showscreen.getMWinReference().Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate
                        {
                            thisitem.imgrec.Margin = new Thickness(thisitem.imgrec.Margin.Left, thisitem.imgrec.Margin.Top + 8,
                                thisitem.imgrec.Margin.Right, thisitem.imgrec.Margin.Bottom);

                        }));
                }

            }


            //마지막 webitem이라면 다 떨어질때까지 더 webitem을 호출하지 못하도록 블록을 시킨 걸 해제한다.
            if (isFinal == true)
            {
                showscreen.doingWebitem = false;

                //박스 이미지를 일반 이미지로 바꾼다.
                flyingBox.changeImg(showscreen.getFlyingboxReference(), showscreen.getMWinReference(), false);
            }
                
                
        }