示例#1
0
        private void PopulateControls()
        {
            lstPlayerType.ItemsSource = PlayableItemFactory.Instance.GetAllPlayableExternalConfigurators().Select(t => t.ExternalPlayerName);

            SetListDataSource(lstMediaTypes, EnumWrapperList <MediaType> .Create());
            SetListDataSource(lstVideoFormats, EnumWrapperList <VideoFormat> .Create());
        }
示例#2
0
        void lnkSelectAllMediaTypes_Click(object sender, RoutedEventArgs e)
        {
            EnumWrapperList <MediaType> source = lstMediaTypes.ItemsSource as EnumWrapperList <MediaType>;

            bool selectAll = (sender as Hyperlink) == lnkSelectAllMediaTypes;

            source.SelectAll(selectAll);
            SetListDataSource(lstMediaTypes, source);
        }
示例#3
0
        void lnkSelectAllVideoFormats_Click(object sender, RoutedEventArgs e)
        {
            EnumWrapperList <VideoFormat> source = lstVideoFormats.ItemsSource as EnumWrapperList <VideoFormat>;

            bool selectAll = (sender as Hyperlink) == lnkSelectAllVideoFormats;

            source.SelectAll(selectAll);
            SetListDataSource(lstVideoFormats, source);
        }
示例#4
0
            public static EnumWrapperList <TEnumType> Create()
            {
                EnumWrapperList <TEnumType> list = new EnumWrapperList <TEnumType>();

                foreach (TEnumType val in Enum.GetValues(typeof(TEnumType)))
                {
                    list.Add(new EnumWrapper <TEnumType>()
                    {
                        Value = val, IsChecked = false
                    });
                }

                return(list);
            }
示例#5
0
        public void FillControlsFromObject(CommonConfigData.ExternalPlayer externalPlayer, PlayableExternalConfigurator uiConfigurator, bool refreshMediaTypes, bool refreshVideoFormats)
        {
            lstPlayerType.SelectedItem = externalPlayer.ExternalPlayerName;

            txtArguments.Text = externalPlayer.Args;

            chkMinimizeMce.IsChecked      = externalPlayer.MinimizeMCE;
            chkShowSplashScreen.IsChecked = externalPlayer.ShowSplashScreen;
            //chkHideTaskbar.IsChecked = externalPlayer.HideTaskbar;
            chkSupportsMultiFileCommand.IsChecked = externalPlayer.SupportsMultiFileCommandArguments;
            chkSupportsPLS.IsChecked = externalPlayer.SupportsPlaylists;

            if (refreshMediaTypes)
            {
                EnumWrapperList <MediaType> mediaTypes = lstMediaTypes.ItemsSource as EnumWrapperList <MediaType>;
                mediaTypes.SetValues(externalPlayer.MediaTypes);
                SetListDataSource(lstMediaTypes, mediaTypes);
            }

            if (refreshVideoFormats)
            {
                EnumWrapperList <VideoFormat> videoFormats = lstVideoFormats.ItemsSource as EnumWrapperList <VideoFormat>;
                videoFormats.SetValues(externalPlayer.VideoFormats);
                SetListDataSource(lstVideoFormats, videoFormats);
            }

            SetControlVisibility(uiConfigurator);
            SetTips(uiConfigurator);

            if (string.IsNullOrEmpty(externalPlayer.Command))
            {
                AutoFillPaths(uiConfigurator);
            }
            else
            {
                txtCommand.Text = externalPlayer.Command;
            }
        }
示例#6
0
 private void SetListDataSource <T>(ListBox listbox, EnumWrapperList <T> source)
 {
     listbox.ItemsSource = null;
     listbox.ItemsSource = source;
 }
示例#7
0
 public NewCategoryViewModel()
 {
     CategoryTypes = new EnumWrapperList <CategoryType>();
 }