Exemplo n.º 1
0
        public List <MetroDashSection> GetMetroDashSections()
        {
            List <MetroDashSection> sectionsRet = new List <MetroDashSection>();

            string[] sections = AppSettings.DashboardMetroSectionOrder.Split(';');

            foreach (string section in sections)
            {
                string[] vals    = section.Split(':');
                bool     enabled = bool.Parse(vals[1]);

                // skip Trakt as this has been deprecated
                DashboardMetroProcessType sectionType = (DashboardMetroProcessType)int.Parse(vals[0]);
                if (sectionType == DashboardMetroProcessType.TraktActivity)
                {
                    continue;
                }

                MetroDashSection dashSect = new MetroDashSection()
                {
                    SectionType   = sectionType,
                    Enabled       = enabled,
                    WinVisibility = enabled ? Visibility.Visible : Visibility.Collapsed
                };

                sectionsRet.Add(dashSect);
            }

            return(sectionsRet);
        }
        private void CommandBinding_DisableSectionCommand(object sender, ExecutedRoutedEventArgs e)
        {
            object obj = e.Parameter;

            if (obj == null)
            {
                return;
            }

            MetroDashSection sect = obj as MetroDashSection;

            if (sect == null)
            {
                return;
            }

            UserSettingsVM.Instance.EnableDisableDashboardMetroSection(sect.SectionType, false);
            SetSectionOrder();
        }
        private void CommandBinding_MoveDownSection(object sender, ExecutedRoutedEventArgs e)
        {
            object obj = e.Parameter;

            if (obj == null)
            {
                return;
            }

            MetroDashSection sect = obj as MetroDashSection;

            if (sect == null)
            {
                return;
            }

            VM_UserSettings.Instance.MoveDownDashboardMetroSection(sect.SectionType);
            SetSectionOrder();
        }