예제 #1
0
        protected override void GetDepsFromImpl(object obj, GetDepsFromContext context)
        {
            base.GetDepsFromImpl(obj, context);
            if (obj == null)
            {
                return;
            }

            object persistentCalls = m_persistentCallGroupInfo.GetValue(obj);

            if (persistentCalls == null)
            {
                return;
            }

            object calls = m_callsInfo.GetValue(persistentCalls);

            if (calls == null)
            {
                return;
            }

            IList list = (IList)calls;

            for (int i = 0; i < list.Count; ++i)
            {
                object call = list[i];
                PersistentPersistentCall <TID> persistentCall = new PersistentPersistentCall <TID>();
                persistentCall.GetDepsFrom(call, context);
            }
        }
예제 #2
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            if (obj == null)
            {
                return;
            }

            object persistentCalls = m_persistentCallGroupInfo.GetValue(obj);

            if (persistentCalls == null)
            {
                return;
            }

            object calls = m_callsInfo.GetValue(persistentCalls);

            if (calls == null)
            {
                return;
            }

            IList list = (IList)calls;

            m_calls = new PersistentPersistentCall <TID> [list.Count];
            for (int i = 0; i < list.Count; ++i)
            {
                object call = list[i];
                PersistentPersistentCall <TID> persistentCall = new PersistentPersistentCall <TID>();
                persistentCall.ReadFrom(call);
                m_calls[i] = persistentCall;
            }
        }
예제 #3
0
        protected override void GetDepsImpl(GetDepsContext <TID> context)
        {
            base.GetDepsImpl(context);
            if (m_calls == null)
            {
                return;
            }

            for (int i = 0; i < m_calls.Length; ++i)
            {
                PersistentPersistentCall <TID> persistentCall = m_calls[i];
                if (persistentCall != null)
                {
                    persistentCall.GetDeps(context);
                }
            }
        }
예제 #4
0
        protected override object WriteToImpl(object obj)
        {
            obj = base.WriteToImpl(obj);
            if (obj == null)
            {
                return(null);
            }

            if (m_calls == null)
            {
                return(obj);
            }

            object persistentCalls = Activator.CreateInstance(m_persistentCallGroupInfo.FieldType);
            object calls           = Activator.CreateInstance(m_callsInfo.FieldType);

            IList list = (IList)calls;

            for (int i = 0; i < m_calls.Length; ++i)
            {
                PersistentPersistentCall <TID> persistentCall = m_calls[i];
                if (persistentCall != null)
                {
                    object call = Activator.CreateInstance(m_callType);
                    persistentCall.WriteTo(call);
                    list.Add(call);
                }
                else
                {
                    list.Add(null);
                }
            }
            m_callsInfo.SetValue(persistentCalls, calls);
            m_persistentCallGroupInfo.SetValue(obj, persistentCalls);
            return(obj);
        }