示例#1
0
 private void Button_Right_Click(object sender, RoutedEventArgs e)
 {
     foreach (FileExtensionClass obj in AvaliableExtensions)
     {
         UsedExtensions.Add(obj);
     }
     AvaliableExtensions.Clear();
 }
示例#2
0
        public MediaLoader()
        {
            //GetMedia("");
            // Media = GetMediaENum("C:/Users/Granit/Desktop/KONFIG", new List<string> { ".mp3",".mp4"});

            /*FreeExtensions = new ObservableCollection<Extension>();
             * UsedExtensions = new ObservableCollection<Extension>();
             * UsedExtensions.Add(new Extension(".mp3"));
             * UsedExtensions.Add(new Extension(".mp4"));*/
            usedextensions = new ObservableCollection <Extension>()
            {
            };
            extensions = new ObservableCollection <Extension>()
            {
            };
            UsedExtensions.Add(new Extension(".mp3"));
            UsedExtensions.Add(new Extension(".mp4"));
            UsedExtensions.Add(new Extension(".asf"));
            UsedExtensions.Add(new Extension(".wma"));
            UsedExtensions.Add(new Extension(".wmv"));
            UsedExtensions.Add(new Extension(".aac"));
            UsedExtensions.Add(new Extension(".3gp"));
            UsedExtensions.Add(new Extension(".3g2"));
            UsedExtensions.Add(new Extension(".m4a"));
            UsedExtensions.Add(new Extension(".m4b"));
            UsedExtensions.Add(new Extension(".mpg"));
            UsedExtensions.Add(new Extension(".mpeg"));
            UsedExtensions.Add(new Extension(".divx"));
            UsedExtensions.Add(new Extension(".xvid"));
            UsedExtensions.Add(new Extension(".h264"));
            String se = "";
            String fe = "All Media Files (";
            String te = "";

            foreach (Extension ext in UsedExtensions)
            {
                te += "*" + ext.Name + ";";
                se += (ext.Name.Remove(0, 1)) + " (*" + ext.Name + ")|" + "*" + ext.Name + "|";
            }
            int c = te.Count();

            te        = te.Remove(c - 1, 1);
            fe       += te + ")|";
            c         = se.Count();
            extString = fe + te + "|" + se.Remove(c - 1, 1);
            sources   = new ObservableDictionary <string, ObservableCollection <Media> >();
            path      = "../../Settings/Settings.config";
            String[] settings = File.ReadAllLines(path);
            String   df       = settings.Length > 0 ? settings[0]:null;
            ObservableCollection <Media> o = null;

            if (df != null)
            {
                o = GetMediaENum(df, usedextensions);
            }
            sources.Add("Path", o ?? new ObservableCollection <Media>());
        }
示例#3
0
 private void Avaliable_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (LBAvaliable.SelectedItem != null)
     {
         foreach (var ext in AvaliableExtensions)
         {
             if (ext.ToString().Equals(LBAvaliable.SelectedItem.ToString()))
             {
                 UsedExtensions.Add(ext);
                 AvaliableExtensions.Remove(ext);
                 break;
             }
         }
     }
 }