private string GetNameForOwnLife(IHasOwnLife ownLife) { var peripheral = ownLife as IPeripheral; if (peripheral != null) { return(GetAnyNameOrTypeName(peripheral)); } return(ownLife.ToString()); }
public void UnregisterIHasOwnLife(IHasOwnLife own) { lock (externals) { registeredIHasOwnLifeObjects.RemoveAll(x => x.Target == own); if (alreadyStarted) { own.Pause(); } } }
public void RegisterIHasOwnLife(IHasOwnLife own) { lock (externals) { registeredIHasOwnLifeObjects.Add(new SerializableWeakReference <IHasOwnLife>(own)); if (!paused) { own.Start(); } } }