private void OnListViewDoubleClick(object sender, System.EventArgs e)
 {
     try
     {
         ListViewItem item = _listView.SelectedItems[0];
         if (item != null)
         {
             SnapInDescriptor descriptor = item.Tag as SnapInDescriptor;
             if (descriptor != null)
             {
                 SnapInDescriptorPropertyWindow window = new SnapInDescriptorPropertyWindow(descriptor);
                 window.ShowDialog(this);
             }
         }
     }
     catch (System.Exception systemException)
     {
         System.Diagnostics.Trace.WriteLine(systemException);
     }
 }
        private void OnMenuItemClick(object sender, System.EventArgs e)
        {
            SnapInDescriptor descriptor = null;

            try
            {
                ListViewItem item = _listView.SelectedItems[0];
                if (item != null)
                {
                    descriptor = item.Tag as SnapInDescriptor;
                }
            }
            catch (System.Exception systemException)
            {
                System.Diagnostics.Trace.WriteLine(systemException);
            }

            MenuItem menuItem = sender as MenuItem;

            if (menuItem != null)
            {
                if (menuItem == menuItemStart)
                {
                    if (descriptor != null)
                    {
                        SnapInHostingEngine.StartWithProgress(descriptor);
                    }
                }

                if (menuItem == menuItemStop)
                {
                    if (descriptor != null)
                    {
                        SnapInHostingEngine.StopWithProgress(descriptor);
                    }
                }

                if (menuItem == menuItemReinstall)
                {
                    if (descriptor != null)
                    {
                        SnapInHostingEngine.ReinstallWithProgress(descriptor);
                    }
                }

                if (menuItem == menuItemUninstall)
                {
                    if (descriptor != null)
                    {
                        SnapInHostingEngine.StopAndUninstallWithProgress(descriptor);
                    }
                }

                if (menuItem == menuItemProperties)
                {
                    if (descriptor != null)
                    {
                        SnapInDescriptorPropertyWindow window = new SnapInDescriptorPropertyWindow(descriptor);
                        window.ShowDialog(this);
                    }
                }
            }
        }
		private void OnMenuItemClick(object sender, System.EventArgs e)
		{
			SnapInDescriptor descriptor = null;

			try
			{
				ListViewItem item = _listView.SelectedItems[0];
				if (item != null)					
				{
					descriptor = item.Tag as SnapInDescriptor;										
				}
			}
			catch(System.Exception systemException)
			{				
				System.Diagnostics.Trace.WriteLine(systemException);
			}		

			MenuItem menuItem = sender as MenuItem;
			if (menuItem != null)
			{
				if (menuItem == menuItemStart)
				{
					if (descriptor != null)
					{
						SnapInHostingEngine.StartWithProgress(descriptor);					
					}
				}

				if (menuItem == menuItemStop)
				{
					if (descriptor != null)
					{
						SnapInHostingEngine.StopWithProgress(descriptor);
					}
				}

				if (menuItem == menuItemReinstall)
				{
					if (descriptor != null)
					{
						SnapInHostingEngine.ReinstallWithProgress(descriptor);
					}
				}

				if (menuItem == menuItemUninstall)
				{
					if (descriptor != null)
					{
						SnapInHostingEngine.StopAndUninstallWithProgress(descriptor);
					}
				}

				if (menuItem == menuItemProperties)
				{
					if (descriptor != null)
					{
						SnapInDescriptorPropertyWindow window = new SnapInDescriptorPropertyWindow(descriptor);
						window.ShowDialog(this);
					}
				}
			}
		}
		private void OnListViewDoubleClick(object sender, System.EventArgs e)
		{	
			try
			{
				ListViewItem item = _listView.SelectedItems[0];
				if (item != null)					
				{
					SnapInDescriptor descriptor = item.Tag as SnapInDescriptor;
					if (descriptor != null)
					{
						SnapInDescriptorPropertyWindow window = new SnapInDescriptorPropertyWindow(descriptor);
						window.ShowDialog(this);
					}					
				}
			}
			catch(System.Exception systemException)
			{				
				System.Diagnostics.Trace.WriteLine(systemException);
			}			
		}