Inheritance: FunctionElement
        public void AddItem(FunctionActivity item)
        {
            if (item == null || _activities.Contains(item)) return;

              _activities.Add(item);
              OnActivityAdded(item);
        }
Beispiel #2
0
        public void RemoveItem(FunctionActivity item)
        {
            if (item == null || !_activities.Contains(item))
            {
                return;
            }

            _activities.Remove(item);
            OnActivityRemoved(item);
        }
Beispiel #3
0
        public void AddItem(FunctionActivity item)
        {
            if (item == null || _activities.Contains(item))
            {
                return;
            }

            _activities.Add(item);
            OnActivityAdded(item);
        }
Beispiel #4
0
        private void OnActivityRemoved(FunctionActivity element)
        {
            if (_isInitializing)
            {
                return;
            }

            var handler = ActivityRemoved;

            if (handler != null)
            {
                handler(this, new FunctionActivityEventArgs(element));
            }
        }
 public void RemoveItem(FunctionActivity item)
 {
   if (item == null) return;
   Workflow.RemoveItem(item);
 }
    private void ProcessDeletedActivity(FunctionActivity activity)
    {
      if (activity == null) return;

      var host = _surface.Children.OfType<ActivityHost>().FirstOrDefault(h => h.Id == activity.Id);
      if (host == null) return;

      host.IncomingLinks.ToList().ForEach(incoming => RemoveItem(incoming.WorkflowLink));
      host.OutgoingLinks.ToList().ForEach(outgoing => RemoveItem(outgoing.WorkflowLink));
      
      _surface.Children.Remove(host);
    }
    private void ProcessNewActivity(FunctionActivity activity)
    {
      if (activity == null) return;

      var viewFactory = ActivityViewFactories.FirstOrDefault(f => f.Metadata.TargetType == activity.GetType());
      if (viewFactory == null) return;

      var view = viewFactory.CreateExport().Value;
      view.Caption = viewFactory.Metadata.Caption;
      view.Activity = activity;

      var position = (activity.IsPropertyDefined(DesignProperties.PositionX) && activity.IsPropertyDefined(DesignProperties.PositionY))
        ? new Point(Convert.ToDouble(activity.GetValue(DesignProperties.PositionX)), Convert.ToDouble(activity.GetValue(DesignProperties.PositionY)))
        : new Point(0, 0);

      var host = new ActivityHost(activity.Id, view, position);
      _surface.Children.Add(host);
    }
 public FunctionActivityEventArgs(FunctionActivity element)
 {
     Item = element;
 }
 public FunctionActivityEventArgs(FunctionActivity element)
 {
     Item = element;
 }
        private void OnActivityRemoved(FunctionActivity element)
        {
            if (_isInitializing) return;

              var handler = ActivityRemoved;
              if (handler != null) handler(this, new FunctionActivityEventArgs(element));
        }
        public void RemoveItem(FunctionActivity item)
        {
            if (item == null || !_activities.Contains(item)) return;

              _activities.Remove(item);
              OnActivityRemoved(item);
        }