예제 #1
0
 private void PauseThenClose()
 {
     BtnAction.Visible = true;
     BtnAction.Text    = @"OK";
     BtnAction.Refresh();
     new Timer(_ => Close(), null, CloseAfterWorkCompletedTimeMilliSec, Timeout.Infinite);
 }
예제 #2
0
        public override sealed void Subscribe()
        {
            Mediator.ViewModel.Update = () =>
            {
                viewModelBindingSource.CurrencyManager.Refresh();
                DisplayText.MoveCursorToEnd();
            };

            BtnAction.GetClick()
            .Where(_ => BtnAction.Visible)
            .Where(_ => Mediator.BackgroundWorkerEndingState == BackgroundWorkerEndingState.NotSet)
            .Subscribe(_ => Mediator.Cancel());

            BtnAction.GetClick()
            .Where(_ => Mediator.BackgroundWorkerEndingState != BackgroundWorkerEndingState.NotSet)
            .Subscribe(_ => Close());

            this.GetVisibleChanged()
            .Where(_ => Visible)
            .Subscribe(_ => Mediator.Execute());

            Mediator.BackgroundWorkFinishedToken = new MessageToken();
            Messenger.Instance().OfType <StringMessage>()
            .Where(sp => sp.Token == Mediator.BackgroundWorkFinishedToken)
            .Subscribe(sp => PauseThenClose());
        }
예제 #3
0
파일: Btn.cs 프로젝트: colincapurso/IC2013
 public Btn(Rectangle dst, Element ele, BtnAction action, Color[] colours)
 {
     this.DstRect = UsefulTools.GridToPixel(Game1.TILE_SIZE, dst);
       this.Element = ele;
       this.Action = action;
       this.StateColours = colours;
       this.DrawText = false;
 }
예제 #4
0
파일: Btn.cs 프로젝트: colincapurso/IC2013
 public Btn(int x, int y, int w, int h, Element ele, BtnAction action, Color[] colours)
     : this(new Rectangle(x, y, w, h), ele, action, colours)
 {
 }
 public ButtonActionsPress(Hand hand, BtnAction button, bool pressed)
 {
     this.hand    = hand;
     this.button  = button;
     this.pressed = pressed;
 }