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()))); }
public bool SupportsEnhancement(Type enhancementType) { lock (writeLock) { return(supportedEnhancements.Contains(enhancementType)); } }
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)); }
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); }