Exemplo n.º 1
0
		public JabbRAuthDialog (string serverAddress, string appName)
		{
			this.ServerAddress = serverAddress;
			this.AppName = appName;
			this.DisplayMode = DialogDisplayMode.Attached;
			
			this.ClientSize = defaultSize;
			this.Resizable = true;
			this.Title = "JabbR Login";
			
			var baseDir = Path.Combine (EtoEnvironment.GetFolderPath(EtoSpecialFolder.ApplicationResources), "Styles", "default");
			webserver = new HttpServer (baseDir);
			LocalhostTokenUrl = new Uri (webserver.Url, "Authorize");
			webserver.StaticContent.Add ("/", AuthHtml(true));
			webserver.StaticContent.Add ("/Authorize", GetUserIDHtml());
			webserver.ReceivedRequest += HandleReceivedRequest;
			
			
			web = new WebView ();
			web.DocumentLoaded += HandleDocumentLoaded;
			web.Url = webserver.Url;
			
			var layout = new DynamicLayout(this);
			layout.Add (web, yscale: true);
			layout.AddSeparateRow (Padding.Empty).Add (null, this.CancelButton ());
			
			HandleEvent (ClosedEvent);
		}
Exemplo n.º 2
0
		public override void OnClosed (EventArgs e)
		{
			base.OnClosed (e);
			if (webserver != null) {
				webserver.Dispose ();
				webserver = null;
			}
		}