Beispiel #1
0
        private void UpdateDashboardList()
        {
            if (!IsContentVisible)
            {
                return;
            }
            UpdateTitleBar();

            m_dashboards.Clear();
            cbxDashboardType.Items.Clear();

            cbxDashboardType.Items.Add(VersionInfo.ProgramTitle);
            m_dashboards.Add(m_infoDashboard);

            if (m_selectedObject != null && m_selectedObject.GetAllWidgets().Count > 0)
            {
                cbxDashboardType.Items.Add(Texts.Get("s_tabs"));
                m_dashboards.Add(m_tabbedDashboard);
            }

            if (m_selectedObject != null)
            {
                var appobj = m_selectedObject.GetPrimaryAppObject();
                if (appobj != null)
                {
                    AppObject aclone;
                    if (appobj.SupportSerialize)
                    {
                        aclone          = appobj.CloneUsingXml();
                        aclone.ConnPack = ConnPack;
                    }
                    else
                    {
                        aclone = appobj;
                    }
                    foreach (var item in DashboardManager.Instance.GetDashboards(aclone))
                    {
                        m_dashboards.Add(item);
                        cbxDashboardType.Items.Add(item);
                    }
                }
            }

            DashboardBase maxdash = m_dashboards.MaxKey(d => d.Priority);

            if (m_userWantToSee.ContainsKey(maxdash))
            {
                maxdash = m_userWantToSee[maxdash];
            }

            m_machineChangeDashboard       = true;
            cbxDashboardType.SelectedIndex = m_dashboards.IndexOf(maxdash);
            m_machineChangeDashboard       = false;
        }