Ejemplo n.º 1
0
        /// <summary>
        /// Load profile information from app storage
        /// </summary>
        private async Task OpenSiteProfile(bool forceRelad = false, bool createIfNotExist = false)
        {
            string             newSiteProfileId = App.SiteProfileId;
            SiteProfileManager curSiteProfile   = SiteProfileManager.DefaultSiteProfileManager;

            if (curSiteProfile != null && (forceRelad || newSiteProfileId != curSiteProfile.SiteProfileId))
            {
                SiteProfileManager.SetDefault(null);
                curSiteProfile = null;
            }
            if (curSiteProfile == null)
            {
                curSiteProfile = await SiteProfileManager.Open(newSiteProfileId, createIfNotExist);

                SiteProfileManager.SetDefault(curSiteProfile);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// On page loaded
        /// <summary>
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SiteProfileManager siteManager = SiteProfileManager.DefaultSiteProfileManager;

            if (siteManager == null)
            {
                siteManager = await SiteProfileManager.Open(App.SiteProfileId);

                SiteProfileManager.SetDefault(siteManager);
            }
            else
            {
                var action = e.Parameter as string;
                if (!String.IsNullOrEmpty(action) && action == "RELOAD")
                {
                    await siteManager.LoadSessionConfig();
                }
            }

            listviewSessionStatus.Items.Clear();

            if (siteManager?.sessionConfig?.sessions != null)
            {
                sessionConfig = siteManager.sessionConfig;
                foreach (var session in sessionConfig.sessions)
                {
                    SessionStatusInfo sessionInfoItem = new SessionStatusInfo()
                    {
                        Name        = session.sessionName,
                        SourceUrl   = String.Format("{0}", session.sourceType.ToString()),
                        Description = String.Empty,
                        Status      = 0,
                        IsActive    = false,
                        Session     = session,
                    };

                    listSessionStatus.Add(sessionInfoItem);
                    listviewSessionStatus.Items.Add(sessionInfoItem);
                }
            }
        }