示例#1
0
        public FlowAction(object owner, Action action, params IFlowChangeable[] sources)
        {
            Action = action;
            SubscribeTo(sources);

            // Bound to the owner in order to prevent GC (the object will be guaranteed to outlive the owner)
            WeakHolder.Add(owner, this);
        }
示例#2
0
        private void AddUnderLock(LinkedObject ro, Action <UInt32> setter)
        {
            do
            {
                nextLocalId++;
            }while (nextLocalId == 0 || activeLinks.ContainsKey(nextLocalId));

            setter(nextLocalId);
            var holder = new WeakHolder(ro);

            activeLinks.Add(holder.LocalLinkId, holder);
            indexByKey.Add(holder.Key, holder);
        }