Beispiel #1
0
		///<summary>
		///	Constructor
		/// Creates a ChatWindow and a conversation according to the type requested
		///</summary>		
		public TargetWindow (ServiceLocator serviceLocator) :
			base (WindowType.Toplevel)
		{
			this.serviceLocator = serviceLocator;
			targets = new Dictionary<string,Giver.TargetService> ();
			InitWindow();
			SetupLocatorEvents();
			SetupApplicationEvents ();
		}
Beispiel #2
0
		///<summary>
		///	Present
		/// Presents the window
		///</summary>			
/*		public new void Present ()
		{
			if (everShown == false) {
				Show ();
				everShown = true;
			} else {
				base.Present ();
			}
		}
*/
		#endregion


		#region Public Properties
		#endregion

		public static void ShowWindow(ServiceLocator serviceLocator)
		{
			if(targetWindow != null) {
				if(targetWindow.IsActive) {
		            int x;
		            int y;

		            targetWindow.GetPosition(out x, out y);
		            
		            lastXPos = x;
		            lastYPos = y;

					targetWindow.Hide();
				} else {
					if(!targetWindow.Visible) {
			        	int x = lastXPos;
						int y = lastYPos;

						if (x >= 0 && y >= 0)
							targetWindow.Move(x, y);						
					}
					targetWindow.Present();
				}
			} else {
				TargetWindow.targetWindow = new TargetWindow(serviceLocator);
	        	int x = lastXPos;
				int y = lastYPos;

				if (x >= 0 && y >= 0)
					targetWindow.Move(x, y);						

				targetWindow.ShowAll();
			}
		}
Beispiel #3
0
		private bool InitializeIdle()
		{
			requestHandler = new RequestHandler();
			sendingHandler = new SendingHandler();
			sendingHandler.Start();

			sendingHandler.TransferStarted += TransferStartedHandler;
			sendingHandler.FileTransferStarted += FileTransferStartedHandler;
			sendingHandler.TransferProgress += TransferProgressHandler;
			sendingHandler.TransferEnded += TransferEndedHandler;

			try {
				photoService = new Giver.PhotoService ();
				photoService.PhotoResolved += OnPhotoResolved;
				photoService.Start ();
			} catch (Exception e) {
				Logger.Fatal ("Failed to start the Photo Service");
				throw e;
			}
			

			try {
				locator = new ServiceLocator();
			} catch (Exception e) {
				if(e.Message.CompareTo("Daemon not running") == 0) {
					Logger.Fatal("The Avahi Daemon is not running... start it before running Giver");
				}
				else
					Logger.Debug("Error starting ServiceLocator: {0}", e.Message);

				throw e;
			}
			try {
				service = new GiverService();
			} catch (Exception e) {
				if(e.Message.CompareTo("Daemon not running") == 0) {
					Logger.Fatal("The Avahi Daemon is not running... start it before running Giver");
				}
				else
					Logger.Debug("Error starting GiverService: {0}", e.Message);

				throw e;
			}

			locator.ServiceRemoved += OnServicesChanged;
			locator.ServiceAdded += OnServicesChanged;
			service.ClientConnected += OnClientConnected;

			//tray = new NotificationArea("RtcApplication");
			SetupTrayIcon();

			if (!quiet)
				TargetWindow.ShowWindow(locator);

			return false;
		}