private void ProcessChildren(object thisKey, IReference <RuntimeGroupLeafObj> parentObj, IReference <RuntimeGroupLeafObj> thisObj)
        {
            ChildLeafInfo value = null;

            if (m_parentInfo != null)
            {
                m_parentInfo.TryGetValue(thisKey, out value);
            }
            if (value == null)
            {
                return;
            }
            for (int i = 0; i < value.Count; i++)
            {
                RuntimeGroupLeafObjReference runtimeGroupLeafObjReference = value[i];
                using (runtimeGroupLeafObjReference.PinValue())
                {
                    RuntimeGroupLeafObj runtimeGroupLeafObj = runtimeGroupLeafObjReference.Value();
                    bool flag = false;
                    IReference <RuntimeGroupObj> reference = parentObj as IReference <RuntimeGroupObj>;
                    while (reference != null && !flag)
                    {
                        RuntimeGroupLeafObj runtimeGroupLeafObj2 = reference.Value() as RuntimeGroupLeafObj;
                        if (runtimeGroupLeafObj2 == runtimeGroupLeafObj)
                        {
                            flag = true;
                        }
                        reference = runtimeGroupLeafObj2?.Parent;
                    }
                    if (!flag)
                    {
                        runtimeGroupLeafObj.RemoveFromParent((RuntimeGroupRootObjReference)m_owner.SelfReference);
                        using (thisObj.PinValue())
                        {
                            thisObj.Value().AddChild(runtimeGroupLeafObjReference);
                        }
                    }
                }
            }
            m_parentInfo.Remove(thisKey);
        }
Exemplo n.º 2
0
        private void ProcessChildren(object thisKey, IReference <RuntimeGroupLeafObj> parentObj, IReference <RuntimeGroupLeafObj> thisObj)
        {
            ChildLeafInfo childLeafInfo = null;

            if (this.m_parentInfo != null)
            {
                this.m_parentInfo.TryGetValue(thisKey, out childLeafInfo);
            }
            if (childLeafInfo != null)
            {
                for (int i = 0; i < childLeafInfo.Count; i++)
                {
                    RuntimeGroupLeafObjReference runtimeGroupLeafObjReference = ((List <RuntimeGroupLeafObjReference>)childLeafInfo)[i];
                    using (runtimeGroupLeafObjReference.PinValue())
                    {
                        RuntimeGroupLeafObj runtimeGroupLeafObj = runtimeGroupLeafObjReference.Value();
                        bool flag = false;
                        IReference <RuntimeGroupObj> reference = parentObj as IReference <RuntimeGroupObj>;
                        while (reference != null && !flag)
                        {
                            RuntimeGroupLeafObj runtimeGroupLeafObj2 = reference.Value() as RuntimeGroupLeafObj;
                            if (runtimeGroupLeafObj2 == runtimeGroupLeafObj)
                            {
                                flag = true;
                            }
                            reference = ((runtimeGroupLeafObj2 != null) ? runtimeGroupLeafObj2.Parent : null);
                        }
                        if (!flag)
                        {
                            runtimeGroupLeafObj.RemoveFromParent((RuntimeGroupRootObjReference)base.m_owner.SelfReference);
                            using (thisObj.PinValue())
                            {
                                thisObj.Value().AddChild(runtimeGroupLeafObjReference);
                            }
                        }
                    }
                }
                this.m_parentInfo.Remove(thisKey);
            }
        }