示例#1
0
		private static IEnumerable<ContextMenuItem> ContextMenuControlCallback (IEnumerable<string> paths)
		{
			Console.WriteLine ("Investigating {0}", string.Join (" ,", paths.ToArray ()));

			List<ContextMenuItem> contextMenuItems = new List<ContextMenuItem> ();

			//if (paths.All (p => p == "/Users/sync/foo.txt"))
			//{
				var contextMenuItem = new ContextMenuItem("Nativity Test: " + started);
				contextMenuItem.Selected += MainClass.ContextMenuItem_HandleSelected;

				contextMenuItems.Add(contextMenuItem);

				contextMenuItem.AddSeparator();

				for (var ctr = 0; ctr < 3; ctr++)
				{
					var sub = new ContextMenuItem(string.Empty);
					sub.Selected += (s,p) => Console.WriteLine(sub.Uuid);
					sub.Title = sub.Uuid.ToString();
					contextMenuItem.ContextMenuItems.Add(sub);
				}
			//}

			return contextMenuItems;
		}
示例#2
0
		static void ContextMenuItem_HandleSelected (ContextMenuItem sender, IEnumerable<string> paths)
		{
			Console.WriteLine("{0} selected by {1} ({2})", string.Join(" ,", paths.ToArray()), sender, MainClass.started);
		}