Exemplo n.º 1
0
        private void SetupFilter()
        {
            foreach (FilterMode mode in Enum.GetValues(typeof(FilterMode)))
            {
                switch (mode)
                {
                case FilterMode.None:
                    FilterModes.Add(mode, Resources.MainWindow_CurrentWorkspace_FilterMode_None);
                    break;

                case FilterMode.Downloaded:
                    FilterModes.Add(mode, Resources.MainWindow_CurrentWorkspace_FilterMode_Downloaded);
                    break;

                case FilterMode.NotDownloaded:
                    FilterModes.Add(mode, Resources.MainWindow_CurrentWorkspace_FilterMode_NotDownloaded);
                    break;

                case FilterMode.Downloading:
                    FilterModes.Add(mode, Resources.MainWindow_CurrentWorkspace_FilterMode_Downloading);
                    break;

                case FilterMode.Queued:
                    FilterModes.Add(mode, Resources.MainWindow_CurrentWorkspace_FilterMode_Queued);
                    break;
                }
            }

            SelectedFilterMode = FilterMode.None;
        }
        private void SetupFilter()
        {
            foreach (var mode in Enum.GetNames(typeof(FilterMode)))
            {
                var attributes = typeof(FilterMode).GetMember(mode)[0].GetCustomAttributes(
                    typeof(DescriptionAttribute), false);
                FilterModes.Add((FilterMode)Enum.Parse(typeof(FilterMode), mode),
                                ((DescriptionAttribute)attributes[0]).Description);
            }

            SelectedFilterMode = FilterMode.None;
        }