private static Exception GETMOREINFO(Type t, int size, CHashSet <int> xdone)
        {
            StringBuilder sb = new StringBuilder(4096);

            sb.AppendLine("------- BEGIN INFORMATION -------");

            MethodInfo[] vs = t.GetMethods(flag_i);

            int len = vs.Length - 1;
            int x   = 0;

            for (; x < len; x++)
            {
                if (!xdone.Contains(x))
                {
                    sb.AppendLine(vs[x].ToString());
                    sb.AppendLine();
                }
            }
            if (!xdone.Contains(len))
            {
                sb.AppendLine(vs[len].ToString());
            }

            sb.AppendLine("------- END INFOMATION -------");

            return
                (new Exception($"Number of methods not implemented: {size - xdone.Count}",
                               new Exception(sb.ToString())));
        }
Example #2
0
 public bool SupportsEnhancement(Type enhancementType)
 {
     lock (writeLock)
     {
         return(supportedEnhancements.Contains(enhancementType));
     }
 }
Example #3
0
        public IServiceResult GetORIsOfService(IServiceDescription serviceDescription, ExecuteServiceDelegate executeServiceDelegate)
        {
            if (!UseResultCache)
            {
                return(executeServiceDelegate.Invoke(serviceDescription));
            }
            ServiceResultCacheKey key = BuildKey(serviceDescription);
            IServiceResult        serviceResult;

            lock (serviceCallToPendingResult)
            {
                serviceResult = serviceCallToResult.Get(key);
                if (serviceResult != null)
                {
                    return(CreateServiceResult(serviceResult));
                }
                while (serviceCallToPendingResult.Contains(key))
                {
                    Monitor.Wait(serviceCallToPendingResult);
                }
                serviceResult = serviceCallToResult.Get(key);
                if (serviceResult != null)
                {
                    return(CreateServiceResult(serviceResult));
                }
                serviceCallToPendingResult.Add(key);
            }
            bool success = false;

            try
            {
                if (SecurityActivation != null)
                {
                    serviceResult = SecurityActivation.ExecuteWithoutFiltering(new IResultingBackgroundWorkerDelegate <IServiceResult>(delegate()
                    {
                        return(executeServiceDelegate.Invoke(serviceDescription));
                    }));
                }
                else
                {
                    serviceResult = executeServiceDelegate.Invoke(serviceDescription);
                }
                success = true;
            }
            finally
            {
                lock (serviceCallToPendingResult)
                {
                    serviceCallToPendingResult.Remove(key);

                    if (success)
                    {
                        serviceCallToResult.Put(key, serviceResult);
                    }
                    Monitor.PulseAll(serviceCallToPendingResult);
                }
            }
            return(CreateServiceResult(serviceResult));
        }
Example #4
0
 public static bool IsImmutableType(Type type)
 {
     return(type.IsPrimitive || type.IsValueType || type.IsEnum || immutableTypeSet.Contains(type) || typeof(IImmutableType).IsAssignableFrom(type) || "RuntimeType".Equals(type.Name) ||
            immutableSuperTypes.GetExtension(type) != null);
 }