Exemple #1
0
 public virtual void OnDocumentLoaded(WebViewLoadedEventArgs e)
 {
     if (documentLoaded != null)
     {
         documentLoaded(this, e);
     }
 }
Exemple #2
0
 public virtual void OnNavigated(WebViewLoadedEventArgs e)
 {
     if (navigated != null)
     {
         navigated(this, e);
     }
 }
Exemple #3
0
		/// <summary>
		/// Raises the <see cref="Navigated"/> event.
		/// </summary>
		/// <param name="e">Event arguments.</param>
		protected virtual void OnNavigated(WebViewLoadedEventArgs e)
		{
			Properties.TriggerEvent(NavigatedEvent, this, e);
		}
Exemple #4
0
		public virtual void OnDocumentLoaded (WebViewLoadedEventArgs e)
		{
			if (documentLoaded != null)
				documentLoaded (this, e);
		}
		void HandleDocumentLoaded (object sender, WebViewLoadedEventArgs e)
		{
			
		}
Exemple #6
0
 /// <summary>
 /// Raises the document loaded event.
 /// </summary>
 public void OnDocumentLoaded(WebView widget, WebViewLoadedEventArgs e)
 {
     using (widget.Platform.Context)
         widget.OnDocumentLoaded(e);
 }
Exemple #7
0
 /// <summary>
 /// Raises the <see cref="DocumentLoaded"/> event.
 /// </summary>
 /// <param name="e">Event arguments.</param>
 protected virtual void OnDocumentLoaded(WebViewLoadedEventArgs e)
 {
     Properties.TriggerEvent(DocumentLoadedEvent, this, e);
 }
Exemple #8
0
 /// <summary>
 /// Raises the <see cref="Navigated"/> event.
 /// </summary>
 /// <param name="e">Event arguments.</param>
 protected virtual void OnNavigated(WebViewLoadedEventArgs e)
 {
     Properties.TriggerEvent(NavigatedEvent, this, e);
 }
Exemple #9
0
		protected override void HandleDocumentLoaded (object sender, WebViewLoadedEventArgs e)
		{
			if (this.Channel != null && Server.IsConnected) {
				BeginLoad ();
				var getChannelInfo = this.Channel.GetChannelInfo ();
				if (getChannelInfo != null) {
					getChannelInfo.ContinueWith(t => {
						var channel = t.Result;
						Application.Instance.AsyncInvoke (delegate {
							SetTopic (channel.Topic);
							UserList.SetUsers (channel.Users);
							var getHistory = channel.GetHistory (LastHistoryMessageId);
							if (getHistory != null) {
								getHistory.ContinueWith(r => {
									Application.Instance.AsyncInvoke (delegate {
										try {
											Debug.WriteLine ("Starting live");
											StartLive ();
											Debug.WriteLine ("Adding History");
											AddHistory (r.Result, true);
											AddNotification (new NotificationMessage (DateTimeOffset.Now, string.Format ("You just entered {0}", Channel.Name)));
											Debug.WriteLine ("Set Marker");
											SetMarker ();
											Debug.WriteLine ("Replay delayed");
											ReplayDelayedCommands ();
	
											Debug.WriteLine ("Finished Load");
											FinishLoad ();
										}
										catch (Exception ex) {
											Debug.WriteLine ("Getting Initial History {0}", ex);
											throw;
										}
									});
								}, TaskContinuationOptions.OnlyOnRanToCompletion);
								getHistory.ContinueWith (r => {
									Debug.WriteLine ("Error getting history {0}", r.Exception);
								}, TaskContinuationOptions.OnlyOnFaulted);
							}
							else
								FinishLoad ();
						});
					}, TaskContinuationOptions.OnlyOnRanToCompletion);
					getChannelInfo.ContinueWith (t => {
						Debug.WriteLine ("Error getting channel info {0}", t.Exception);	
					}, TaskContinuationOptions.OnlyOnFaulted);
				}
				else
					FinishLoad ();
			}
			else {
				StartLive ();
				ReplayDelayedCommands ();
				AddNotification (new NotificationMessage(DateTimeOffset.Now, "Disconnected"));
			}
		}
Exemple #10
0
 public virtual void OnNavigated(WebViewLoadedEventArgs e)
 {
     if (navigated != null)
         navigated(this, e);
 }
 void HandleDocumentLoaded(object sender, WebViewLoadedEventArgs e)
 {
     var newIsLocal = string.IsNullOrEmpty(e.Uri.AbsolutePath) || e.Uri.IsLoopback;
     if (isLocal != newIsLocal)
     {
         isLocal = newIsLocal;
         var newSize = isLocal ? defaultSize : expandedSize;
         var location = this.Location;
         var rect = new Rectangle(location, this.ClientSize);
         rect.Inflate((newSize.Width - rect.Width) / 2, (newSize.Height - rect.Height) / 2);
         if (Generator.IsMac)
             rect.Y = location.Y;
         this.Location = rect.Location;
         this.ClientSize = rect.Size;
     }
 }
Exemple #12
0
        protected override void HandleDocumentLoaded(object sender, WebViewLoadedEventArgs e)
        {
            if (this.Channel != null && Server.IsConnected)
            {
                BeginLoad();
                var getChannelInfo = this.Channel.GetChannelInfo();
                if (getChannelInfo != null)
                {
                    getChannelInfo.ContinueWith(t => {
                        if (t.IsFaulted)
                        {
                            LoadError(t.Exception, "Error getting channel info");
                            return;
                        }
                        var channel = t.Result;
                        Application.Instance.AsyncInvoke(delegate
                        {
                            SetTopic(channel.Topic);
                            UserList.SetUsers(channel.Users);
                            var getHistory = channel.GetHistory(LastHistoryMessageId);
                            if (getHistory != null)
                            {
                                getHistory.ContinueWith(r => {
                                    if (r.IsFaulted)
                                    {
                                        LoadError(r.Exception, "Error getting history");
                                        return;
                                    }
                                    Application.Instance.AsyncInvoke(delegate
                                    {
                                        StartLive();
                                        AddHistory(r.Result, true);
                                        AddNotification(new NotificationMessage(DateTimeOffset.Now, string.Format("You just entered {0}", Channel.Name)));
                                        SetMarker();
                                        ReplayDelayedCommands();

                                        FinishLoad();
                                    });
                                });
                            }
                            else
                                FinishLoad();
                        });
                    });
                }
                else
                    FinishLoad();
            }
            else
            {
                StartLive();
                ReplayDelayedCommands();
                AddNotification(new NotificationMessage(DateTimeOffset.Now, "Disconnected"));
            }
        }
 protected virtual void HandleDocumentLoaded(object sender, WebViewLoadedEventArgs e)
 {
     Application.Instance.AsyncInvoke(delegate
     {
         StartLive();
         ReplayDelayedCommands();
     });
 }
 protected override async void HandleDocumentLoaded(object sender, WebViewLoadedEventArgs e)
 {
     if (Channel != null && Server.IsConnected)
     {
         BeginLoad();
         try
         {
             var channel = await Channel.GetChannelInfo();
             if (channel != null)
             {
                 SetTopic(channel.Topic);
                 UserList.SetUsers(channel.Users);
                 var history = await channel.GetHistory(LastHistoryMessageId);
                 if (history != null)
                 {
                     StartLive();
                     AddHistory(history, true);
                     AddNotification(new NotificationMessage(DateTimeOffset.Now, string.Format("You just entered {0}", Channel.Name)));
                     SetMarker();
                     ReplayDelayedCommands();
                 }
             }
         }
         catch (Exception ex)
         {
             LoadError(ex, "Error getting channel info");
         }
         FinishLoad();
     }
     else
     {
         StartLive();
         ReplayDelayedCommands();
         AddNotification(new NotificationMessage(DateTimeOffset.Now, "Disconnected"));
     }
 }
Exemple #15
0
		/// <summary>
		/// Raises the <see cref="DocumentLoaded"/> event.
		/// </summary>
		/// <param name="e">Event arguments.</param>
		protected virtual void OnDocumentLoaded(WebViewLoadedEventArgs e)
		{
			Properties.TriggerEvent(DocumentLoadedEvent, this, e);
		}
Exemple #16
0
			/// <summary>
			/// Raises the document loaded event.
			/// </summary>
			public void OnDocumentLoaded(WebView widget, WebViewLoadedEventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnDocumentLoaded(e));
			}
Exemple #17
0
 /// <summary>
 /// Raises the document loaded event.
 /// </summary>
 public void OnDocumentLoaded(WebView widget, WebViewLoadedEventArgs e)
 {
     widget.Platform.Invoke(() => widget.OnDocumentLoaded(e));
 }