示例#1
0
        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
        {
            String           name    = value[0] as String;
            FrameworkElement element = value[1] as FrameworkElement;
            String           param   = null;

            if (value.Length > 2)
            {
                param = value[2] as string;
            }
            if (element == null)
            {
                return(false);
            }
            MediaLoader media = element.DataContext as MediaLoader;

            if (param == null)
            {
                return(!String.IsNullOrWhiteSpace(name) && !media.Sources.ContainsKey(name.TrimEnd().TrimStart()));
            }
            else
            {
                return(!String.IsNullOrWhiteSpace(name) && (name.TrimEnd().TrimStart().Equals(param) || !media.Sources.ContainsKey(name.TrimEnd().TrimStart())));
            }
        }
示例#2
0
 public ExtensionDialog(MainWindow main, object media)
 {
     this.main   = main;
     this.media  = (MediaLoader)media;
     DataContext = media;
     InitializeComponent();
 }
示例#3
0
 public PlaylistDialog(Object media)
 {
     this.media  = (MediaLoader)media;
     files       = new ObservableCollection <Media>();
     DataContext = media;
     InitializeComponent();
     FileList.ItemsSource = files;
 }
示例#4
0
 public EditPlaylist(object media, object files)
 {
     this.media       = (MediaLoader)media;
     this.files       = (KeyValuePair <String, ObservableCollection <Media> >)files;
     copy             = new ObservableCollection <Media>(this.files.Value);
     this.DataContext = media;
     InitializeComponent();
     FileList.ItemsSource = this.copy;
     Name.Content         = this.files.Key;
     PName.Text           = this.files.Key;
 }
示例#5
0
 public MainWindow()
 {
     inactivity      = new DispatcherTimer();
     animationen     = new Animationen();
     player          = new DispatcherTimer();
     player.Tick    += new EventHandler(play_time);
     player.Interval = new TimeSpan(0, 0, 0, 0, 166);
     media           = new MediaLoader();
     DataContext     = media;
     InitializeComponent();
     player.Start();
 }
示例#6
0
        private void OpenDirectoryDialog(object sender, RoutedEventArgs e)
        {
            using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
            {
                System.Windows.Forms.DialogResult result = dialog.ShowDialog();
                String path = dialog.SelectedPath;
                if (result.ToString().Equals("OK"))
                {
                    int idx = Sources.SelectedIndex;

                    media.Sources.Remove("Path");
                    media.Sources["Path"] = MediaLoader.GetMediaENum(path, media.UsedExtensions);
                    if (idx != Sources.SelectedIndex)
                    {
                        Sources.SelectedIndex = media.Sources.Count - 1;
                        media.Media           = media.Sources["Path"];
                        media.CMedia          = null;
                    }
                    File.WriteAllText(media.path, path);
                }
            }
        }