Example #1
0
 /// <summary>
 /// Searches the text control_ search text.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 private void searchTextControl_SearchText(object sender, TextArgs args)
 {
     this.Page         = 0;
     this.TextSearched = args.Text;
     Args.UsersArgs userArgs = new UsersArgs(args.Text, this.Page, null);
     this.SearchText(sender, userArgs);
 }
Example #2
0
 /// <summary>
 /// Searches the text control_ search text.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 private void searchTextControl_SearchText(object sender, TextArgs args)
 {
     this.Page         = 0;
     this.TextSearched = args.Text;
     Args.GroupsArgs groupArgs = new GroupsArgs(args.Text, this.Page, null);
     this.SearchText(sender, groupArgs);
 }
Example #3
0
    public void AddText(string content, Color color = default(Color))
    {
        TextArgs args = new TextArgs()
        {
            Color = color, Content = content
        };

        m_Queue.Enqueue(args);
    }
Example #4
0
    public void AddText(string content, Color color = default(Color), int fontIndex = -1, bool isShowTyping = false, System.Action onComplete = null)
    {
        TextArgs args = new TextArgs()
        {
            Color = color, Content = content, FontIndex = fontIndex, IsShowTyping = isShowTyping, OnComplete = onComplete
        };

        m_Queue.Enqueue(args);
    }
 void wss_OnIncommingTextData(object sender, TextArgs e)
 {
     Debug.WriteLine("");
     Debug.WriteLine("Incomming TextMessage");
     Debug.WriteLine("Handler: " + ((IXBaseSocket)sender).Alias);
     Debug.WriteLine("Sender: " + ((IXBaseSocket)sender).XNode.ClientGuid);
     Debug.WriteLine("Event: " + e.@event);
     Debug.WriteLine("Data: " + e.data);
     Debug.WriteLine("");
 }
 void wss_OnIncommingTextData(object sender, TextArgs e)
 {
     Debug.WriteLine("");
     Debug.WriteLine("Incomming TextMessage");
     Debug.WriteLine("Handler: " + ((IXBaseSocket)sender).Alias);
     Debug.WriteLine("Sender: " + ((IXBaseSocket)sender).XNode.ClientGuid);
     Debug.WriteLine("Event: " + e.@event);
     Debug.WriteLine("Data: " + e.data);
     Debug.WriteLine("");            
 }
        private void TextMarshaler(object o, EventArgs args)
        {
            TextArgs arg = (TextArgs)args;

            arg.Target.Text = arg.Text;

            if (this.rapi.Connected)
            {
                this.ReadDeviceInfo();
            }
        }
Example #8
0
    private void Update()
    {
        if (m_Queue.Count > 0)
        {
            if (Time.time - m_PreviourTime >= TimeInterval)
            {
                m_PreviourTime = Time.time;
                TextArgs   args = m_Queue.Dequeue();
                GameObject go   = null;
                if (m_Cache.Count > 0)
                {
                    go = m_Cache.Dequeue();
                    go.gameObject.SetActive(true);
                }
                else
                {
                    go = Instantiate(TipPrefab);
                }
                go.SetParent(transform, true);

                Text text = go.GetComponentInChildren <Text>();
                if (text != null)
                {
                    text.text = string.Empty;
                    if (args.Color != default(Color))
                    {
                        text.color = args.Color;
                    }
                    if (args.IsShowTyping)
                    {
                        text.DOText(args.Content, TextAnimationDuration, false, ScrambleMode.None, null);
                    }
                    else
                    {
                        text.text = args.Content;
                    }
                    if (args.FontIndex >= 0 && m_TextFonts != null && args.FontIndex < m_TextFonts.Length)
                    {
                        text.font = m_TextFonts[args.FontIndex];
                    }
                }
                go.transform.DOLocalMove(TargetLocalPosition, Duration).SetEase(Ease.Linear).OnComplete(() =>
                {
                    go.SetActive(false);
                    m_Cache.Enqueue(go);
                    if (args.OnComplete != null)
                    {
                        args.OnComplete();
                    }
                });
            }
        }
    }
Example #9
0
 protected virtual void UpdateDebugDisplay(object sender, TextArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new EventHandler <TextArgs>(UpdateDebugDisplay), new object[] { sender, e });
     }
     else
     {
         rtbDebug.AppendText(e.Message + "\r\n");
         rtbDebug.ScrollToCaret();
     }
 }
Example #10
0
 void wss_OnIncommingTextData(object sender, TextArgs e)
 {
     try
     {
         Debug.WriteLine("");
         Debug.WriteLine("Incomming TextMessage");
         Debug.WriteLine("Handler: " + ((IXBaseSocket)sender).Alias);
         Debug.WriteLine("Sender: " + ((IXBaseSocket)sender).ClientGuid);
         Debug.WriteLine("Event: " + e.@event);
         Debug.WriteLine("Data: " + e.data);
         Debug.WriteLine("");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         Debug.WriteLine(ex.StackTrace);
     }
 }
Example #11
0
 /// <summary>
 /// Searches the text control_ search text.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 private void searchTextControl_SearchText(object sender, TextArgs args)
 {
     this.TagArgs.Text = args.Text;
     this.TagArgs.Page = 0;
     this.SearchText(sender, this.TagArgs);
 }
Example #12
0
        public override bool ParseArgs(IScenarioContent content, ref TextArgs args, out string error)
        {
            // text position text0 text1 ...;
            if (content.length < 3)
            {
                error = GetLengthErrorString();
                return(false);
            }

            string position = content[1].ToLower();

            if (position != "top" && position != "bottom" && position != "global")
            {
                error = string.Format(
                    "{0} ParseArgs error: position must be one of [top, bottom, global].",
                    typeName,
                    content[1]);
                return(false);
            }
            args.position = position;

            TextInfoConfig config  = TextInfoConfig.Get <TextInfoConfig>();
            StringBuilder  builder = new StringBuilder();

            int index = 2;

            while (index < content.length)
            {
                string line;
                if (content[index].StartsWith("\""))
                {
                    if (!ScenarioUtility.ParseContentString(content, ref index, out line, out error))
                    {
                        return(false);
                    }
                }
                else
                {
                    // 可能是个变量
                    int id = -1;
                    if (!ParseOrGetVarValue(content[index], ref id, out error))
                    {
                        return(false);
                    }

                    TextInfo info = config[id];
                    if (info == null)
                    {
                        error = string.Format(
                            "{0} ParseArgs error: text id `{1}` was not found.",
                            typeName,
                            content[index]);
                        return(false);
                    }

                    line = info.text;
                    index++;
                }
                builder.AppendLine(line);
            }

            args.text = builder.ToString();

            /// 从游戏设置中读取
            /// 最常见的形式是类似J-AVG快进的形式
            args.async = true;

            error = null;
            return(true);
        }
Example #13
0
        protected override ActionStatus Run(IGameAction gameAction, IScenarioContent content, TextArgs args, out string error)
        {
            UITextPanel panel = UIManager.views.OpenView <UITextPanel>(UINames.k_UITextPanel, false);

            panel.WriteText(args.position, args.text, args.async);

            error = null;

            // 如果是快进模式,要等待一帧,否则有可能看不到界面,连闪屏都没有。
            return(args.async ? ActionStatus.WaitWriteTextDone : ActionStatus.NextFrame);
        }
Example #14
0
        /// <summary>
        /// Handles the Click event of the bSearch control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void bSearch_Click(object sender, EventArgs e)
        {
            TextArgs args = new TextArgs(this.tBSearchText.Text);

            this.SearchText(sender, args);
        }
 public void handleEvent(object sender, TextArgs e)
 {
     MessageBox.Show("Message Received\n" + e.Message, "serialHandle");
     Console.WriteLine("SerialHandle: " + e.Message);
 }
Example #16
0
        private void TextMarshaler(object o, EventArgs args)
        {
            TextArgs arg = (TextArgs)args;

            arg.Target.Text = arg.Text;
        }