Exemple #1
0
		protected void InitWidget(string baseDir)
		{
			string IconName, IconSrc;
			XReader xr = new XReader(baseDir + "Widget.Config");
			IconName = xr["Widget"]["$Text"].Value;
			IconSrc = xr.Reset()["Widget"]["Img"]["$Src"].Value;

			EventListViewItem item = new EventListViewItem(IconName);
			item.OnItemLaunch += new EventListViewItem.MouseActionHandler(delegate(EventListViewItem oSender, MouseEventArgs oEvtArgs)
			{
				LaunchMailGenerator();
			});
			item.ImageIndex = 0;
			item.SubItems.Add("None");
			imgIcons.Images.Add(Image.FromFile(baseDir + IconSrc));
			lvMain.LargeImageList = imgIcons;
			lvMain.Columns.Add("Application Name", 150);
			lvMain.Columns.Add("Shortcut Key", 90);
			lvMain.Items.Add(item);

			EventTreeNode tn = new EventTreeNode();
			tn.MouseOnClick += new EventTreeNode.MouseActionHandler(delegate(EventTreeNode node, MouseEventArgs mEvt)
			{
				LaunchMailGenerator();
			});
			tn.Text = "Outlook Mail Generator";

			tvMain.Nodes.Add(tn);
			tvMain.NodeMouseClick += new TreeNodeMouseClickEventHandler(tvMain_NodeMouseClick);
		}
Exemple #2
0
 void EventListView_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (SelectedItems != null && SelectedItems.Count > 0)
     {
         EventListViewItem item = (EventListViewItem)SelectedItems[0];
         if (item.OnItemLaunch != null)
         {
             item.OnItemLaunch(item, e);
         }
     }
 }