public BFULayerHost GetHost(string id) { BFULayerHost host = null; if (hosts.ContainsKey(id)) { host = hosts[id]; } return(host); }
public void RemoveHost(BFULayerHost host) { if (host.Id != null) { if (hostSubjects.ContainsKey(host.Id)) { var subject = hostSubjects[host.Id]; subject.OnCompleted(); hostSubjects.Remove(host.Id); } if (hosts.ContainsKey(host.Id)) { hosts.Remove(host.Id); } } }
public IObservable <BFULayerHost> GetHostObs(string id) { BehaviorSubject <BFULayerHost> subject = null; if (hostSubjects.ContainsKey(id)) { subject = hostSubjects[id]; } else { BFULayerHost host = null; if (hosts.ContainsKey(id)) { host = hosts[id]; } subject = new BehaviorSubject <BFULayerHost>(host); hostSubjects.Add(id, subject); } return(subject.AsObservable()); }
public void RegisterHost(BFULayerHost host) { if (host.Id == null) { if (rootHost != null) { throw new Exception("You must specify an Id for your host."); } rootHost = host; } else { hosts.Add(host.Id, host); if (hostSubjects.ContainsKey(host.Id)) { var subject = hostSubjects[host.Id]; subject.OnNext(host); } } }
protected override async Task OnParametersSetAsync() { if (!addedToHost) { if (HostId == null) { LayerHost = LayerHostService.GetDefaultHost(); } else { LayerHost = LayerHostService.GetHost(HostId); } if (LayerHost != null) { LayerHost.AddOrUpdateHostedContentAsync(id, ChildContent); addedToHost = true; } } await base.OnParametersSetAsync(); }