Exemple #1
0
        /// <summary>
        /// 刷新当前连接数
        /// </summary>
        private void RefreshOnlineUserCount(string str = "")
        {
            str = UserList.Count.ToString();

            if (TextCount.InvokeRequired)
            {
                RefreshOnlineUserCountDelegate d = new RefreshOnlineUserCountDelegate(RefreshOnlineUserCount);
                TextCount.Invoke(d, new object[] { str });
            }
            else
            {
                TextCount.Text = str;
                //TextMain.ScrollToCaret();
            }
        }
Exemple #2
0
        public TweetViewModel()
        {
            Text = new ReactiveProperty <string>().AddTo(this.CompositeDisposable);

            TextCount = Text
                        .Select(x => 140 - x.Length)
                        .ToReactiveProperty()
                        .AddTo(this.CompositeDisposable);

            SubscribingCommand = TextCount
                                 .Select(x => x > 0 && x < 141)
                                 .ToReactiveCommand()
                                 .AddTo(this.CompositeDisposable);

            SubscribingCommand.Subscribe(_ =>
            {
            });
        }
        //for input streams, we use the Initialize() method to tally up the number of items to be analyzed
        public void Initialize()
        {
            RowCounter = 0;
            TextCount  = 0;

            var lines = ReadLines(IncomingTextLocation, Encoding.GetEncoding(SelectedEncoding));

            foreach (var line in lines)
            {
                try
                {
                    TextCount++;
                }
                catch
                {
                }
            }

            TextCountPadding = TextCount.ToString().Length;
        }