Exemplo n.º 1
0
		private void Page_Loaded(object sender, RoutedEventArgs e) {
			HistoryBox.LoadCompleted += async (s, nea) => {
				await HistoryBox.InvokeScriptAsync("scrollToEnd", null);
			};
			_html += "<font color=\"grey\" face=\"Segoe UI\" size=\"4\">" +
							WebUtility.HtmlEncode(DateTime.Now.ToString()) + " Chat initialized.<br/></font>";
			HistoryBox.NavigateToString(_html + _htmlSuffix);

			_api = new ChatAPI("dMnnHfYH4X7M2irQ") {
				Name = "Anon", Channel = "b"
			};
        }
Exemplo n.º 2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            HistoryBox.LoadCompleted += async(s, nea) => {
                await HistoryBox.InvokeScriptAsync("scrollToEnd", null);
            };
            _html += "<font color=\"grey\" face=\"Segoe UI\" size=\"4\">" +
                     WebUtility.HtmlEncode(DateTime.Now.ToString()) + " Chat initialized.<br/></font>";
            HistoryBox.NavigateToString(_html + _htmlSuffix);

            _api = new ChatAPI("dMnnHfYH4X7M2irQ")
            {
                Name = "Anon", Channel = "b"
            };
        }
Exemplo n.º 3
0
		private void Page_Loaded(object sender, RoutedEventArgs e) {
			// Add autoscroll to end each time that chat content has been modified
			HistoryBox.LoadCompleted += async (s, nea) => {
				await HistoryBox.InvokeScriptAsync("scrollToEnd", null);
			};
			// Chat initialization
			_html += "<font color=\"grey\" face=\"Segoe UI\" size=\"4\">" +
							WebUtility.HtmlEncode(DateTime.Now.ToString()) + " Chat initialized.<br/></font>";
			HistoryBox.NavigateToString(_html + _htmlSuffix);
			_previousRefreshDate = DateTime.Now.Subtract(new TimeSpan(24,0,0));
			// API initialization
			_api = new ChatAPI("dMnnHfYH4X7M2irQ") {
				Name = "Anon", Channel = "b"
			};
			// Setup timer
			_refreshTimer.Interval = new TimeSpan(0, 0, 2);
			_refreshTimer.Tick += _refreshTimer_Tick;
			_refreshTimer.Start();
        }