Example #1
0
        private static EventWireNode GetEventWireNode(WiredLookupEntry m)
        {
            var memberCache = (MethodBaseCache)AnalysisManager.Instance.GetMemberCache(m.EventMethod);

            MemberInfo source;

            if (m.Source is MethodBase)
            {
                // use property instead of get method of property
                var sourceCache = (MethodBaseCache)AnalysisManager.Instance.GetMemberCache(m.Source);
                if (sourceCache.SpecialReference is PropertyInfo)
                {
                    source = sourceCache.SpecialReference;
                }
                else
                {
                    source = m.Source;
                }
            }
            else
            {
                source = m.Source;
            }

            if (memberCache.SpecialReference != null)
            {
                var n = new EventWireNode((EventInfo)memberCache.SpecialReference, source, true);
                n.Nodes.Clear();
                return(n);
            }
            else
            {
                return(null);
            }
        }
Example #2
0
 public void AddWiredForEvent(WiredLookupEntry m)
 {
     lock (wiredForEventLock) WiredForEvent.Add(m);
 }