Esempio n. 1
0
 public static void LoadPage(Type type, object dat = null)
 {
     if (typeof(HotUIPage).IsAssignableFrom(type))
     {
         if (CurrentPage != null)
         {
             if (CurrentPage.GetType() == type)
             {
                 CurrentPage.Show(dat);
                 return;
             }
         }
         if (HCanvas.MainCanvas != null)//释放当前页面所有事件
         {
             HCanvas.MainCanvas.ClearAllAction();
         }
         TextInput.Clear();
         if (CurrentPage != null)
         {
             CurrentPage.Dispose();
         }
         var t = Activator.CreateInstance(type) as HotUIPage;
         CurrentPage = t;
         t.Initial(Root, dat);
         t.ReSize();
         t.Recovery();
     }
 }
Esempio n. 2
0
        void OnSubmitButtonClick(object sender, RoutedEventArgs e)
        {
            var text = TextInput.Text;

            TextEngine.Instance.OnRead(text);
            TextInput.Clear();
        }
Esempio n. 3
0
    public static void LoadPage <T>(object dat = null) where T : HotUIPage, new()
    {
        if (CurrentPage is T)
        {
            CurrentPage.Show(dat);
            return;
        }
        if (HCanvas.MainCanvas != null)//释放当前页面所有事件
        {
            HCanvas.MainCanvas.ClearAllAction();
        }
        TextInput.Clear();
        if (CurrentPage != null)
        {
            CurrentPage.Save();
            CurrentPage.Dispose();
        }
        var t = new T();

        t.Initial(Root, dat);
        t.ReSize();
        CurrentPage = t;
    }
Esempio n. 4
0
        public override void FTSUpdate(GameTime timeSpend)
        {
            if (_imanager.ActionsManager.isTriggered(UtopiaActions.ToggleInterface))
            {
                IsHided = !IsHided;
            }

            if (Stopwatch.GetTimestamp() > _lastUpdateTime + _hideChatInTick)
            {
                SetFontAlphaColor(0);
            }
            else
            {
                SetFontAlphaColor(200);
            }


            if (Activated && _imanager.ActionsManager.isTriggered(UtopiaActions.ExitChat, CatchExclusiveActions))
            {
                Activated = false;
                _textInput.Clear();
                _lastUpdateTime = Stopwatch.GetTimestamp();
                _refreshDisplay = true;
            }

            if (_imanager.ActionsManager.isTriggered(UtopiaActions.ToggleChat, CatchExclusiveActions))
            {
                if (Activated == false)
                {
                    CatchExclusiveActions = true;
                    _lastUpdateTime       = Stopwatch.GetTimestamp();

                    Activated       = true;
                    _refreshDisplay = true;
                    _textInput.Clear();
                    _textInput.isListening = true;
                }
                else
                {
                    //Send message to server !
                    Activated             = false;
                    CatchExclusiveActions = false;
                    var input = _textInput.GetText();
                    if (!string.IsNullOrWhiteSpace(input))
                    {
                        var ea = new ChatMessageEventArgs {
                            Message = input
                        };

                        OnMessageOut(ea);

                        if (!ea.DoNotSend)
                        {
                            var msg = new ChatMessage {
                                DisplayName = _server.DisplayName, Message = input
                            };
                            if (input.StartsWith("/me ", StringComparison.CurrentCultureIgnoreCase))
                            {
                                msg.Action  = true;
                                msg.Message = input.Remove(0, 4);
                            }

                            if (input.StartsWith("/"))
                            {
                                _server.ServerConnection.Send(new EntityUseMessage()
                                {
                                    DynamicEntityId = _server.Player.DynamicId,
                                    UseType         = UseType.Command,
                                    State           = _server.Player.EntityState
                                });
                            }

                            _server.ServerConnection.Send(msg);
                        }
                    }
                    _textInput.isListening = false;
                    _textInput.Clear();
                    _refreshDisplay = true;
                }
            }

            _textInput.Refresh();
        }
Esempio n. 5
0
 private void FocusChanged()
 {
     NameInput.Clear();
     Focus = false;
 }
Esempio n. 6
0
 private void Clear_Click(object sender, EventArgs e)
 {
     TextInput.Clear();
     TextInput.Text = "SELECT";
 }
Esempio n. 7
0
 private void SendMessage_Click(object sender, EventArgs e)
 {
     irc.SendMessage(TextInput.Text);
     TextInput.Clear();
 }
Esempio n. 8
0
 private void CloseDialogEvent(object sender, RoutedEventArgs e)
 {
     (sender as FrameworkElement).BindingGroup.CommitEdit();
     CloseDialog();
     TextInput.Clear();
 }