예제 #1
0
        private void LoadAudioFilesData()
        {
            if (!System.IO.File.Exists(GetAudioFilesFileName()))
            {
                return;
            }
            XmlSerializer serializer = new XmlSerializer(typeof(AudioFileCollection));

            using (System.IO.TextReader reader = new System.IO.StreamReader(GetAudioFilesFileName()))
            {
                audioFiles = (AudioFileCollection)serializer.Deserialize(reader);
            }
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();
            InitializeContextMenu();
            audioFiles = new AudioFileCollection();
            tags       = new SortedObservableCollection <MusicTagger.Tag>();

            LoadAudioFilesData();
            libraryGrid.DataContext = audioFiles;
            LoadTagsFromFile();
            lbTags.DataContext = tags;
            foreach (Tag t in tags)
            {
                t.PropertyChanged += TagSelectionChanged;
            }

            SetGridColumnWidth();
            timer = new System.Timers.Timer(2000);
            timer.Start();
            timer.Elapsed += TimerElapsed;

            txtSearch.KeyUp += OnTextSearchKeyPress;
        }