/// <summary> /// Call from WC to retreive an RM by name. /// </summary> /// <param name="name">name of RM to get</param> /// <returns>RM object</returns> public RM GetResourceMananger(string name) { lock (resourceManagers) { if (!this.resourceManagers.ContainsKey(name)) { return(null); } try { // get the RM and check to see if it is still alive RM rm = this.resourceManagers[name]; rm.GetName(); return(rm); } catch (Exception e) { Console.WriteLine(e.Message); this.resourceManagers.Remove(name); return(null); } } }
protected RM GetRM(RM rm, string url) { bool done = false; while (!done) { try { if (null == rm) { rm = (RM)System.Activator.GetObject(typeof(RM), url); } rm.GetName(); done = true; } catch (Exception) { rm = null; } } return rm; }
protected RM GetRM(RM rm, string url) { bool done = false; while (!done) { try { if (null == rm) { rm = (RM)System.Activator.GetObject(typeof(RM), url); } rm.GetName(); done = true; } catch (Exception) { rm = null; } } return(rm); }
public bool Contains(RM rm) { var name = rm.GetName(); return ResourceManagers.Any(r => String.Compare(r.GetName(), name, StringComparison.OrdinalIgnoreCase) == 0); }
public void Add(RM rm) { ResourceManagers.Add(rm); RMNames.Add(rm.GetName()); }
public bool Contains(RM rm) { var name = rm.GetName(); return(ResourceManagers.Any(r => String.Compare(r.GetName(), name, StringComparison.OrdinalIgnoreCase) == 0)); }