예제 #1
0
        private void lstRegionDSs_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (lstRegionDSs.SelectedItems.Count < 1)
            {
                return;
            }

            Point  mousePos = e.GetPosition(null);
            Vector diff     = _startDataSourceLastPoint - mousePos;

            if (e.LeftButton == MouseButtonState.Pressed &&
                (Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
                 Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
                )
            {
                ListBox     listView     = sender as ListBox;
                ListBoxItem listViewItem = UiSearchHelper.FindAnchestor <ListBoxItem>((DependencyObject)e.OriginalSource);
                if (null == listViewItem)
                {
                    return;
                }

                DataSupplier dataSupplier = (DataSupplier)listView.ItemContainerGenerator.ItemFromContainer(listViewItem);

                // Initialize the drag & drop operation
                DataObject dragData = new DataObject(CommConst.DRAGED_DATASOURCE, dataSupplier);
                DragDrop.DoDragDrop(lstRegionDSs, dragData, DragDropEffects.Move);
            }
        }
예제 #2
0
        private void lstRegion_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (lstRegions.SelectedItems.Count < 1)
            {
                return;
            }

            Point  mousePos = e.GetPosition(null);
            Vector diff     = _StartRegionLstPoint - mousePos;

            if (e.LeftButton == MouseButtonState.Pressed &&
                (Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
                 Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
                )
            {
                ListBox     listView     = sender as ListBox;
                ListBoxItem listViewItem = UiSearchHelper.FindAnchestor <ListBoxItem>((DependencyObject)e.OriginalSource);
                if (null == listViewItem)
                {
                    return;
                }

                IAniRegion aniRegion = (IAniRegion)listView.ItemContainerGenerator.
                                       ItemFromContainer(listViewItem);

                DataObject dragData = new DataObject(CommConst.DRAGED_REGION_DATA, aniRegion);
                DragDrop.DoDragDrop(lstControls, dragData, DragDropEffects.Move);
            }
        }
예제 #3
0
        private void btnSetSourcePath_Click(object sender, RoutedEventArgs e)
        {
            SetPathProcessorsView dlg = new SetPathProcessorsView();
            dlg.Owner = UiSearchHelper.FindAnchestor<Window>(this);
            if (dlg.ShowDialog().Value)
            {
                List<ProcessText> proces = dlg.SelectedProcessors.ToList<ProcessText>();
                if (proces.Count > 0)
                {
                    this.txtSourcePath.Text = proces.Last<ProcessText>().Output.ToString();
                }
            }

        }