Пример #1
0
		public static int Main(string[] args) {
			main_window = new MainWindow();
			active = main_window;

			Application.Run(main_window);
			return 0;
		}
Пример #2
0
		public static int Main(string[] args) {
			if (args.Length > 0) {
				for (int i=0; i< args.Length; i++) {
					if ((args[i] == "-d") || (args[i] == "--debug")) {
						debug++;
						continue;
					}

					if ((args[i] == "-v") || (args[i] == "--verbose")) {
						verbose++;
						continue;
					}

					if ((args[i] == "-g") || (args[i] == "--gui")) {
						visual = true;
						continue;
					}

					if ((args[i] == "-e") || (args[i] == "--exception")) {
						exception = true;
						continue;
					}

					if ((args[i] == "-?") || (args[i] == "-h") || (args[i] == "--help")) {
						Console.WriteLine("Usage: <cmd> [-d | --debug] [-v | --verbose] [-g | --gui] [e | --exception]");
						return 0;
					}
				}
			}
			main_window = new MainWindow();
			active = main_window;

			// We don't want to run it, tests are already complete
			if (visual) {
				Application.Run(main_window);
			}

			if (failed == 0) {
				return 0;
			}

			return failed;
		}
Пример #3
0
		public static void Main(string[] args) {
			Stream		s;
			MenuItem	item1;
			MenuItem	item2;
			MenuItem[]	items;

			s = null;
			notify = new NotifyIcon();
			try {
				s = File.OpenRead("notify.ico");

				notify.Icon = new Icon(s);

			}

			catch {
				MessageBox.Show("File 'notify.ico' cannot be found", "Error");
				Console.WriteLine("File 'notify.ico' cannot be found");
				return;
			}

			finally {
				if (s != null) {
					s.Close();
				}
			}

			icon_bitmap = notify.Icon.ToBitmap();

			item1 = new MenuItem("Open");
			item1.Click += new EventHandler(notify_menuOpen);

			item2 = new MenuItem("Exit");
			item2.Click += new EventHandler(notify_menuExit);

			items = new MenuItem[] {item1, item2};

			menu = new ContextMenu(items);

			notify.Text = "Tester tooltip text";
			notify.Visible = true;
			notify.ContextMenu = menu;
			notify.Click +=new EventHandler(notify_Click);
			notify.DoubleClick +=new EventHandler(notify_DoubleClick);
			notify.MouseDown +=new MouseEventHandler(notify_MouseDown);
			notify.MouseMove += new MouseEventHandler(notify_MouseMove);
			notify.MouseUp +=new MouseEventHandler(notify_MouseUp);

			main_window = new MainWindow();

			Application.Run(main_window);
		}