Esempio n. 1
0
        private void List_Click(object sender, MouseEventArgs e)
        {
            bool isDefaultTask = sender == this.ListDragSource;
            int  index         = ((ListBox)sender).IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches && !((TaskListBox)sender).Lock)
            {
                AbstractProcessingTask task = (AbstractProcessingTask)((ListBox)sender).Items[index];
                Rectangle bounds            = ((ListBox)sender).GetItemRectangle(index);
                int       settingsSize      = Math.Min(bounds.Width, bounds.Height);
                Rectangle settingsRect      = new Rectangle(bounds.Right - settingsSize, bounds.Top, settingsSize, settingsSize);
                if (settingsRect.Contains(e.Location))
                {
                    if (task != null && task.HasSettings)
                    {
                        AbstractProcessingTask ret = PropertyForm.EditSettings(this, task, sender == ListDragSource);
                        ((ListBox)sender).Items[index] = ret;
                    }
                }
            }
        }