Inheritance: ActivityDesignerViewModel
Beispiel #1
0
        void DoDrop(object sender, DragEventArgs e)
        {
            var dataObject = e.Data;

            if (_dropEnabledActivityDesignerUtils != null)
            {
                var dropEnabled = _dropEnabledActivityDesignerUtils.LimitDragDropOptions(dataObject);
                if (!dropEnabled)
                {
                    e.Effects = DragDropEffects.None;
                    e.Handled = true;
                }
                else
                {
                    if (ForeachDesignerViewModel.MultipleItemsToSequence(dataObject))
                    {
                        e.Effects = DragDropEffects.None;
                        e.Handled = true;
                    }
                }
            }
            var multipleItemsToSequence = ForeachDesignerViewModel.MultipleItemsToSequence(dataObject);

            if (multipleItemsToSequence)
            {
                e.Effects = DragDropEffects.None;
                e.Handled = true;
            }
        }
 public void ForEachDesignerViewModel_MultipleItems_ModelItemsFormatListOfModelItemActivities_AddedToSequence()
 {
     //------------Setup for test--------------------------
     var modelItem = CreateModelItem();
     var viewModel = new ForeachDesignerViewModel(modelItem);
     var assignActivity = new DsfMultiAssignActivity();
     var gatherSystemInformationActivity = new DsfGatherSystemInformationActivity();
     var numberFormatActivity = new DsfNumberFormatActivity();
     var dataObject = new DataObject("ModelItemsFormat", new List<ModelItem> { ModelItemUtils.CreateModelItem(gatherSystemInformationActivity), ModelItemUtils.CreateModelItem(assignActivity), ModelItemUtils.CreateModelItem(numberFormatActivity) });
     //------------Execute Test---------------------------
     bool multipleItemsToSequence = viewModel.MultipleItemsToSequence(dataObject);
     //------------Assert Results-------------------------
     Assert.IsTrue(multipleItemsToSequence);
     //            var dsfSequenceActivity = multipleItemsToSequence.GetCurrentValue() as DsfSequenceActivity;
     //            Assert.IsNotNull(dsfSequenceActivity);
     //            Assert.AreEqual(3, dsfSequenceActivity.Activities.Count);
     //            Assert.AreEqual(gatherSystemInformationActivity, dsfSequenceActivity.Activities[0]);
     //            Assert.AreEqual(assignActivity, dsfSequenceActivity.Activities[1]);
     //            Assert.AreEqual(numberFormatActivity, dsfSequenceActivity.Activities[2]);
 }
 public void ForEachDesignerViewModel_MultipleItems_ModelItemsFormatNotListOfModelItem_Null()
 {
     //------------Setup for test--------------------------
     var modelItem = CreateModelItem();
     var viewModel = new ForeachDesignerViewModel(modelItem);
     var dataObject = new DataObject("ModelItemsFormat", new List<string> { "some string", "some string 2" });
     //------------Execute Test---------------------------
     bool multipleItemsToSequence = viewModel.MultipleItemsToSequence(dataObject);
     //------------Assert Results-------------------------
     Assert.IsFalse(multipleItemsToSequence);
 }
 public void ForEachDesignerViewModel_MultipleItems_ModelItemsFormatListOfModelItemContainsOneActivity_NotAddedToSequence()
 {
     //------------Setup for test--------------------------
     var modelItem = CreateModelItem();
     var viewModel = new ForeachDesignerViewModel(modelItem);
     var assignActivity = new DsfMultiAssignActivity();
     var dataObject = new DataObject("ModelItemsFormat", new List<ModelItem> { ModelItemUtils.CreateModelItem(assignActivity) });
     //------------Execute Test---------------------------
     bool multipleItemsToSequence = viewModel.MultipleItemsToSequence(dataObject);
     //------------Assert Results-------------------------
     Assert.IsFalse(multipleItemsToSequence);
 }
 public void ForEachDesignerViewModel_MultipleItems_NoModelItemsFormat_Null()
 {
     //------------Setup for test--------------------------
     var modelItem = CreateModelItem();
     var viewModel = new ForeachDesignerViewModel(modelItem);
     var dataObject = new DataObject("Some format", new object());
     //------------Execute Test---------------------------
     bool multipleItemsToSequence = viewModel.MultipleItemsToSequence(dataObject);
     //------------Assert Results-------------------------
     Assert.IsFalse(multipleItemsToSequence);
 }