Example #1
0
        public bool RemoveEntry(IActivityReference reference)
        {
            if (_instanceMapping == null)
            {
                return(false);
            }

            Activity activity = reference.Activity;

            InstanceList mappedInstances;

            if (!this.InstanceMapping.TryGetValue(activity, out mappedInstances))
            {
                return(false);
            }

            if (mappedInstances.Count == 1)
            {
                this.InstanceMapping.Remove(activity);
            }
            else
            {
                mappedInstances.Remove(reference);
            }

            return(true);
        }
Example #2
0
        public void AddEntry(IActivityReference reference, bool skipIfDuplicate)
        {
            Activity activity = reference.Activity;

            if (this.InstanceMapping.TryGetValue(activity, out InstanceList mappedInstances))
            {
                mappedInstances.Add(reference, skipIfDuplicate);
            }
            else
            {
                this.InstanceMapping.Add(activity, new InstanceList(reference));
            }
        }
Example #3
0
        public void AddEntry(IActivityReference reference, bool skipIfDuplicate)
        {
            InstanceList list;
            Activity     key = reference.Activity;

            if (this.InstanceMapping.TryGetValue(key, out list))
            {
                list.Add(reference, skipIfDuplicate);
            }
            else
            {
                this.InstanceMapping.Add(key, new InstanceList(reference));
            }
        }
Example #4
0
        public bool RemoveEntry(IActivityReference reference)
        {
            InstanceList list;

            if (this.instanceMapping == null)
            {
                return(false);
            }
            Activity key = reference.Activity;

            if (!this.InstanceMapping.TryGetValue(key, out list))
            {
                return(false);
            }
            if (list.Count == 1)
            {
                this.InstanceMapping.Remove(key);
            }
            else
            {
                list.Remove(reference);
            }
            return(true);
        }
Example #5
0
 public void AddEntry(IActivityReference reference)
 {
     AddEntry(reference, false);
 }