private static MethodContext GetMethodContext(string caller, string path) { var key = caller + path; lock (Callers) { if (!Callers.ContainsKey(key)) { var context = new MethodContext(); var filename = path.Split('\\').Last().Replace(".cs", ""); var type = ReflectionCache.Lookup(filename); var method = type.GetMethod(caller); if (method != null) { var attributes = method.GetCustomAttributes(true); context.Method = method; context.MethodAttributes = attributes.Cast <Attribute>().ToList(); } Callers.Add(key, context); } return(Callers[key]); } }
private static void Clean() { lock (CleanLock) { foreach (var o in Callers.Where(o => o.Value.IsDisposed)) { ICaller caller; while (Callers.TryRemove(o.Key, out caller)) { } } } }
} // Tag public virtual SilentAutomation SetTag(Callers theCaller) { this.caller = theCaller; this.tag = CreateTag(); return(this); } // SetTag