Example #1
0
        private void MoveSelectedItem(int delta)
        {
            ProjectConfigurationListViewItemAdaptor currentlySelected = selected;
            int reinsertIndex = selectedIndex + delta;

            lvProjects.Items.RemoveAt(selectedIndex);
            lvProjects.Items.Insert(reinsertIndex, currentlySelected.Item);
        }
Example #2
0
        private Project[] BuildProjectListFromListView()
        {
            Project[] newProjectList = new Project[lvProjects.Items.Count];

            for (int i = 0; i < lvProjects.Items.Count; i++)
            {
                ProjectConfigurationListViewItemAdaptor adaptor = (ProjectConfigurationListViewItemAdaptor)lvProjects.Items[i].Tag;
                newProjectList[i] = adaptor.Project;
            }
            return(newProjectList);
        }
		private void lvProjects_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (lvProjects.SelectedItems.Count == 0)
			{
				selected = null;
				selectedIndex = -1;
			}
			else
			{
				selected = (ProjectConfigurationListViewItemAdaptor)lvProjects.SelectedItems[0].Tag;
				selectedIndex = lvProjects.SelectedIndices[0];
			}

			UpdateButtons();
		}
Example #4
0
        private void lvProjects_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvProjects.SelectedItems.Count == 0)
            {
                selected      = null;
                selectedIndex = -1;
            }
            else
            {
                selected      = (ProjectConfigurationListViewItemAdaptor)lvProjects.SelectedItems[0].Tag;
                selectedIndex = lvProjects.SelectedIndices[0];
            }

            UpdateButtons();
        }