Пример #1
0
        public virtual void ReplaceScreen(Screen screen, MoveMethod m)
        {
            if (screen != null && screen != this)
            {
                screen.SetOnLoadState(false);
                SetLock(true);
                screen.SetLock(true);
                this.replaceMethod = m;
                this.replaceDstScreen = screen;

                screen.SetRepaintMode(SCREEN_CANVAS_REPAINT);
                switch (m)
                {
                    case MoveMethod.FROM_LEFT:
                        dstPos.SetLocation(-GetWidth(), 0);
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_RIGHT:
                        dstPos.SetLocation(GetWidth(), 0);
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UP:
                        dstPos.SetLocation(0, -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_DOWN:
                        dstPos.SetLocation(0, GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UPPER_LEFT:
                        dstPos.SetLocation(-GetWidth(), -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UPPER_RIGHT:
                        dstPos.SetLocation(GetWidth(), -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_LOWER_LEFT:
                        dstPos.SetLocation(-GetWidth(), GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_LOWER_RIGHT:
                        dstPos.SetLocation(GetWidth(), GetHeight());
                        isScreenFrom = true;
                        break;
                    default:
                        dstPos.SetLocation(0, 0);
                        isScreenFrom = false;
                        break;
                }

                Replace_Thread loading = new Replace_Thread(screen);
                CallEvent(loading);
                replaceLoading = true;
            }
        }
Пример #2
0
 public void SetCurrentScreen(Screen screen)
 {
     if (screen != null)
     {
         this.isInstance = false;
         if (currentControl != null)
         {
             currentControl.Destroy();
         }
         this.currentControl = screen;
         currentControl.SetLock(false);
         currentControl.SetLocation(0, 0);
         currentControl.SetClose(false);
         currentControl.SetOnLoadState(true);
         if (screen.GetBackground() != null)
         {
             currentControl.SetRepaintMode(Screen.SCREEN_BITMAP_REPAINT);
         }
         this.isInstance = true;
         if (screen is EmulatorListener)
         {
             SetEmulatorListener((EmulatorListener)screen);
         }
         else
         {
             SetEmulatorListener(null);
         }
         screens.AddLast(screen);
     }
 }