Exemple #1
0
    IEnumerator MakeReplyTextUI(string content, float ItWillLast, float fadeSpeed = 2)
    {
        int randomNum     = Random.Range(0, availablePlaceholders.Count);
        int randomNumReal = availablePlaceholders[randomNum];

        Plceholders[randomNum].gameObject.name = "PlaceHolder occupied";
        GameObject go = Instantiate(ReplyButtonUI, Plceholders[randomNumReal].position, Quaternion.identity, MainPanel.transform);

        availablePlaceholders.Remove(randomNumReal);
        ReplyButton replyButton = go.GetComponent <ReplyButton>();

        replyButton.waitingTime = fadeSpeed;
        go.GetComponent <TextMeshProUGUI>().text = content;
        replyButton.OnClicked    += buttonClicked;
        replyButton.MakeOrderOut += UnsubscribeToMakingOutOfOrderOnTheReplayButtonSide;
        makeOutOfOrder           += replyButton.MakeOutOfOrder;
        LeanTween.alphaCanvas(go.GetComponent <CanvasGroup>(), 1, fadeSpeed);
        yield return(new WaitForSeconds(ItWillLast));

        if (go != null)
        {
            if (!replyButton.WasClicked)
            {
                replyButton.Deprecated = true;
                FadeOut(go, fadeSpeed);
            }
        }
        yield return(new WaitForSeconds(fadeSpeed));

        Plceholders[randomNum].gameObject.name = "PlaceHolder";
        availablePlaceholders.Add(randomNumReal);
    }
Exemple #2
0
        public Task VisitReplyButton(ReplyButton button)
        {
            if (button.Caption.IsNotNullOrEmpty())
            {
                log.Debug(button.Caption);
            }

            log.Debug($"<ReplyButton key=\"{button.Go}\">{button.Name}</ReplyButton>");

            return(Task.CompletedTask);
        }
 public static ReplyButton Add(ReplyButton rb)
 {
     if (!ReplyButtons.ContainsKey(rb.Button.Text))
     {
         ReplyButtons.Add(rb.Button.Text, rb);
     }
     else
     {
         throw new InvalidOperationException($"Не удалось добавить ReplyButton [{rb.Button.Text}].\n" +
                                             "ReplyButton с таким же названием уже была добавлена.\n");
     }
     return(rb);
 }
Exemple #4
0
        private void InitBindings()
        {
            this.SetBinding(
                () => CommentTextView.Text,
                () => ViewModel.Comments,
                BindingMode.TwoWay
                ).UpdateSourceTrigger("Changed");

            ReplyButton.SetCommand("TouchUpInside", ViewModel.ReplyCommand);

            ViewModel.RequestCanExecute      = OnRequestCanExecute;
            ViewModel.RequestDismissKeyboard = OnRequestDismissKeyboard;
        }
        void ReleaseDesignerOutlets()
        {
            if (ReplyButton != null)
            {
                ReplyButton.Dispose();
                ReplyButton = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
 public static ReplyButton Add(string command, CallbackSignature callback)
 {
     if (!ReplyButtons.ContainsKey(command))
     {
         ReplyButton rb = new ReplyButton(command, callback.AsReplyCallback());
         ReplyButtons.Add(command, rb);
         return(rb);
     }
     else
     {
         throw new InvalidOperationException($"Не удалось добавить команду {command}.\n" +
                                             "Команда с таким же названием уже была добавлена.\n");
     }
 }
 public async Task VisitReplyButton(ReplyButton button)
 {
     //todo: implement FindReplyGo
     await SendDialog(button.Caption, new ReplyKeyboardMarkup
     {
         Keyboard = new[]
         {
             new[]
             {
                 new KeyboardButton(button.Name)
             }
         },
         ResizeKeyboard = true,
     });
 }
Exemple #8
0
        public ConversationItem(string conversationID, int messageID)
        {
            InitializeComponent();
            MessageContentBox.AutoSize = true;
            this.AutoSize       = true;
            this.ConversationID = conversationID;
            this.MessageID      = messageID;

            EditDraftButton.Hide();

            if (_status == "Draft")
            {
                ReplyButton.Hide();
                ForwardButton.Hide();
                MessageContentBox.ReadOnly = true;
                EditDraftButton.Show();
                EditDraftButton.Click += new EventHandler(this.EditDraftButtonClick);
            }
        }