Пример #1
0
        public bool TryGet(IndirectionInfo info, out Work method)
        {
            method = default(Work);
            if (InstanceGetters.IsDisabledProcessing())
            {
                return(false);
            }

            var holder = LooseCrossDomainAccessor.GetOrRegister <GenericHolder <TaggedBag <BodyOfNonPublicMethod, Dictionary <string, Work> > > >();

            if (holder.Source.Value == null)
            {
                return(false);
            }

            var dict = holder.Source.Value;

            lock (dict)
            {
                using (InstanceGetters.DisableProcessing())
                {
                    var key = info + "";
                    if (!dict.ContainsKey(key))
                    {
                        return(false);
                    }

                    method = dict[key];
                    return(true);
                }
            }
        }
Пример #2
0
 public static bool TryGet <T>(out T holder) where T : InstanceHolder <T>
 {
     holder = LooseCrossDomainAccessor <T> .HolderOrDefault;
     if (holder == null && !InstanceGetters.IsDisabledProcessing())
     {
         holder = GetOrRegister <T>();
     }
     return(holder != null);
 }
Пример #3
0
        public bool TryGet(IndirectionInfo info, out TDelegate method)
        {
            method = default(TDelegate);
            if (InstanceGetters.IsDisabledProcessing())
            {
                return(false);
            }

            lock (m_dict)
            {
                using (InstanceGetters.DisableProcessing())
                {
                    var key = info + "";
                    if (!m_dict.ContainsKey(key))
                    {
                        return(false);
                    }

                    method = m_dict[key];
                    return(true);
                }
            }
        }