예제 #1
0
        public BFULayerHost GetHost(string id)
        {
            BFULayerHost host = null;

            if (hosts.ContainsKey(id))
            {
                host = hosts[id];
            }

            return(host);
        }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
        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());
        }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
        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();
        }