Esempio n. 1
0
 protected override void OnDragEnter(DragEventArgs e)
 {
     if (DragDropHelper.AllowDrop(
             e.Data,
             Context,
             typeof(Activity)))
     {
         e.Effects = (DragDropEffects.Move & e.AllowedEffects);
         e.Handled = true;
     }
     else
     {
         var data = e.Data.GetData(Constants.DATA_FORMAT) as XElement;
         if (Utilities.CheckValidDrop(data, Constants.SCRIPT))
         {
             e.Effects = (DragDropEffects.Move & e.AllowedEffects);
             e.Handled = true;
         }
         else
         {
             e.Effects = DragDropEffects.None;
             e.Handled = true;
         }
     }
     base.OnDragEnter(e);
 }
 private void CheckAnimate(DragEventArgs e, string storyboardResourceName)
 {
     if (!e.Handled)
     {
         if (this.Context.Items.GetValue <ReadOnlyState>().IsReadOnly ||
             !DragDropHelper.AllowDrop(e.Data, this.Context, new Type[] { this.AllowedItemType }))
         {
             e.Effects = DragDropEffects.None;
             e.Handled = true;
         }
         else
         {
             base.BeginStoryboard((Storyboard)base.Resources[storyboardResourceName]);
         }
     }
 }
 void CheckAnimate(DragEventArgs args, string storyboardResourceName)
 {
     if (!args.Handled)
     {
         if (!Context.Items.GetValue <ReadOnlyState>().IsReadOnly&&
             DragDropHelper.AllowDrop(args.Data, Context, new[] { AllowedItemType }))
         {
             BeginStoryboard((Storyboard)Resources[storyboardResourceName]);
         }
         else
         {
             args.Effects = DragDropEffects.None;
             args.Handled = true;
         }
     }
 }
 void CheckAnimate(DragEventArgs e, string storyboardResourceName)
 {
     if (!e.Handled)
     {
         if (!this.Context.Items.GetValue <ReadOnlyState>().IsReadOnly&&
             DragDropHelper.AllowDrop(e.Data, this.Context, this.AllowedItemType))
         {
             BeginStoryboard((Storyboard)this.Resources[storyboardResourceName]);
             return;
         }
         else
         {
             e.Effects = DragDropEffects.None;
         }
         e.Handled = true;
     }
 }
 private void CheckAnimate(DragEventArgs e, string storyboardResourceName)
 {
     if (e.Handled)
     {
         return;
     }
     if (!Context.Items.GetValue <ReadOnlyState>().IsReadOnly)
     {
         if (DragDropHelper.AllowDrop(e.Data, Context, AllowedItemType))
         {
             BeginStoryboard((Storyboard)Resources[storyboardResourceName]);
             return;
         }
     }
     e.Effects = DragDropEffects.None;
     e.Handled = true;
 }
Esempio n. 6
0
 private void DragOverTestCase(DragEventArgs e)
 {
     if (DragDropHelper.AllowDrop(
             e.Data,
             Context,
             typeof(Activity)))
     {
         e.Effects = (DragDropEffects.Move & e.AllowedEffects);
         e.Handled = true;
     }
     else
     {
         var data = e.Data.GetData(Constants.DATA_FORMAT) as XElement;
         if (!Utilities.CheckValidDrop(data, Constants.SCRIPT, Constants.DATUM))
         {
             return;
         }
         e.Effects = (DragDropEffects.Move & e.AllowedEffects);
         e.Handled = true;
     }
 }
Esempio n. 7
0
 private void DragEnterTestCase(DragEventArgs e)
 {
     if (DragDropHelper.AllowDrop(
             e.Data,
             Context,
             typeof(Activity)))
     {
         e.Effects = (DragDropEffects.Move & e.AllowedEffects);
         e.Handled = true;
     }
     else
     {
         var data = e.Data.GetData(Constants.DATA_FORMAT) as XElement;
         if (Utilities.CheckValidDrop(data, Constants.SCRIPT, Constants.DATUM))
         {
             //var activity = Utilities.GetActivityFromXElement(data);
             //if (activity != null)
             //{
             //    var mi = Context.Services.GetService<ModelTreeManager>().CreateModelItem(ModelItem,
             //        activity);
             //    Utilities.AddVariable(mi, data.GetAttributeValue(Constants.NAME).Replace(" ", "_"));
             //    var dO = new DataObject(DragDropHelper.ModelItemDataFormat, mi);
             //    try
             //    {
             //        DragDrop.DoDragDrop(this, dO, DragDropEffects.Move);
             //    }
             //    catch (Exception)
             //    {
             //    }
             //}
             e.Effects = (DragDropEffects.Move & e.AllowedEffects);
             e.Handled = true;
         }
         else
         {
             e.Effects = DragDropEffects.None;
             e.Handled = true;
         }
     }
 }