Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Wrap Panel Virtualization

, 2 Jan 2012 CPOL
WrapPanel doesn't support virtualization. But we can improve the performance by simulating virtualization.
MediaAssistant_bin.zip
MediaAssistant_src
DokanNet.dll
Id3Lib.dll
Media Assistant.exe
Media Assistant.exe.manifest
MediaAssistant.DAL.dll
MediaFS.dll
MefBasic.dll
Microsoft.Practices.Composite.dll
Microsoft.Practices.Composite.MefExtensions.dll
Microsoft.Practices.Composite.Presentation.dll
Microsoft.Practices.ServiceLocation.dll
Mp3Lib.dll
Newtonsoft.Json.Net35.dll
SharpZipLib.dll
Tags.dll
MediaAssistant_src.zip
DokanNet
Properties
Lib
CommonServiceLocation
Desktop
Microsoft.Practices.ServiceLocation.dll
CompositeApplicationLibrary
Desktop
Microsoft.Practices.Composite.dll
Microsoft.Practices.Composite.MefExtensions.dll
Microsoft.Practices.Composite.Presentation.dll
Dokan
dokan.lib
Moq
Desktop
Moq.dll
Mp3Lib
Id3Lib.dll
Mp3Lib.dll
SharpZipLib.dll
Newtonsoft
Newtonsoft.Json.Net35.dll
NUnit
nunit.framework.dll
MediaAssistant
MediaAssistant.csproj.user
MediaAssistant.ico
MusicAssistant_TemporaryKey.pfx
Constants
Controls
About
AddMovie
AlternativeLocation
BottomPanel
Dialog
LeftPanel
Library
MessageBox
MovieDetail
MovieList
MovieMiddlePanel
MovieResult
MovieSearchControl
MovieThumbnails
MusicList
MusicMiddlePanel
MusicSearchControl
PlayerControl
PlayingMusicInfo
PlaylistSelector
ProfileSelector
SendFeedback
SmartDJPreferance
SplashScreen
SplashPage.png
StatusMessageBar
TagEditor
TopPanel
WaitScreen
Converters
Data
EventArguments
HeaderImages
Close_act.png
Close_inact.png
Close_pr.png
Maximize_act.png
Maximize_inact.png
Maximize_pr.png
Minimize_act.png
Minimize_inact.png
Minimize_pr.png
Helper
Images
AcceptFolder.png
Actor.png
ActorLibrary.png
AddFolder.png
Album.png
Artist.png
Close.png
Composer.png
Default.png
DeleteFolder.png
Director.png
DrivesMovies.png
eye16.png
FailedToPlayMusic.png
Genre.png
IMDB.png
Library.png
ListView.png
Logo.png
Maximize.png
Menu.png
Mount.png
MovieBackground.jpg
MovieBackground.png
MovieFolder.png
MovieGenre.png
MovieLibrary.png
MoviePoster.png
Music.png
MusicAssistant.png
MusicLibrary.png
Mute.png
New.png
NewMovies.png
NoDJ.png
NonPlayingMusic.png
NormalShuffle.png
NoShuffle.png
NowPlayingMusic.png
PlayingMusic.png
playlist.png
PlayMovie.png
ProcessDone.png
ProcessFailed.png
Processing.png
Rated.png
Recent.png
RecommendedMovie.png
Restore.png
Runtime.png
SmartShuffle.png
Song.png
Star.png
Swap.png
ThumbnailView.png
Tools.png
TreeCollapse.png
TreeExpand.png
Unread.png
Volume.png
WatchList.png
WishList.png
Writer.png
Year.png
Management
MusicDJ
Properties
Settings.settings
Resources
MediaAssistant.DAL
MediaAssistant.sdf
MediaAssistantModels.edmx
Constants
DBUpdateScript
Helper
Properties
Settings.settings
DataSources
MusicAssistantEntities.datasource
TasteKidEntities.datasource
Virtualization
MediaAssistant.Setup
MusicAssistant.Setup.vdproj
MediaFS
DokanInstall_0.6.0.exe
Properties
MefBasic
Behaviors
Commans
Controls
Converters
Data
Extensions
Helper
Properties
Settings.settings
Themes
Threading
UserControls
Properties
TagClass
ASF Classes
Frames Classes
ID3
Properties
Text Files
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Tags.ID3
{
    /// <summary>
    /// Provide ID3 Information for a file
    /// </summary>
    public class ID3Info : ITagInfo
    {
        private ID3v1 _ID3v1;
        private ID3v2 _ID3v2;

        /// <summary>
        /// Create new ID3 Info class
        /// </summary>
        /// <param name="FilePath">Path to read file</param>
        /// <param name="LoadData">Indicate load data in constructor or not</param>
        public ID3Info(string FilePath, bool LoadData)
        {
            _ID3v1 = new ID3v1(FilePath, LoadData);
            _ID3v2 = new ID3v2(FilePath, LoadData);
        }

        /// <summary>
        /// Get ID3 version 2 Tags
        /// </summary>
        public ID3v2 ID3v2Info
        {
            get
            { return _ID3v2; }
        }

        /// <summary>
        /// Gets ID3 version Tag
        /// </summary>
        public ID3v1 ID3v1Info
        {
            get
            { return _ID3v1; }
        }

        /// <summary>
        /// Load both ID3v1 and ID3v2 information from file
        /// </summary>
        public bool Load()
        {
            ID3v2Info.Load();
            ID3v1Info.Load();
            return true;
        }

        /// <summary>
        /// Save both ID3v2 and ID3v1
        /// </summary>
        public bool Save()
        {
            ID3v2Info.Save();
            ID3v1Info.Save();
            return true;
        }

        /// <summary>
        /// Return true if file had error while reading
        /// </summary>
        public bool HaveException
        {
            get { return ID3v2Info.HaveError; }
        }

        /// <summary>
        /// Save both ID3v2 and ID3v1
        /// </summary>
        /// <param name="Formula">Formula to rename file while saving</param>
        public bool Save(string Formula)
        {
            ID3v1Info.Save();
            ID3v2Info.Save(Formula);
            ID3v1Info.FilePath = ID3v2Info.FilePath;
            return true;
        }

        /// <summary>
        /// Save current ID3Info in specific location
        /// </summary>
        /// <param name="path">Path to save</param>
        /// <returns>True if save successfull</returns>
        public bool SaveAs(string path)
        {
            ID3v2Info.SaveAs(path);
            ID3v1Info.FilePath = ID3v2Info.FilePath;
            ID3v1Info.Save();
            return true;
        }

        /// <summary>
        /// Get filename according to specific formula
        /// </summary>
        /// <param name="Formula">Formula to make filename</param>
        /// <returns>System.String Contains filename</returns>
        public string MakeFileName(string Formula)
        {
            return ID3v2Info.MakeFileName(Formula);
        }

        /// <summary>
        /// Get FilePath current ID3Info
        /// </summary>
        public string FilePath
        {
            get
            { return ID3v2Info.FilePath; }
        }

        /// <summary>
        /// Get FileName of current ID3Info file
        /// </summary>
        public string FileName
        {
            get
            { return ID3v1Info.FileName; }
        }

        /// <summary>
        /// Indicate if current ID3Info is ezual to specific one
        /// </summary>
        /// <param name="obj">Object to check equality</param>
        /// <returns>True if equal otherwise false</returns>
        public override bool Equals(object obj)
        {
            if (obj.GetType() != this.GetType())
                return false;

            if (this.FilePath == ((ID3Info)obj).FilePath)
                return true;
            else
                return false;
        }

        /// <summary>
        /// Get hash code for current ID3Info
        /// </summary>
        /// <returns>int contains hashcode</returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        /// <summary>
        /// Indicate if current ID3Info is template
        /// </summary>
        public bool IsTemplate
        {
            get
            { return _ID3v1.IsTemplate; }
            set
            {
                _ID3v1.IsTemplate = value;
                _ID3v2.IsTemplate = value;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

H. S. Masud
Software Developer (Senior) KAZ Software Limited
Bangladesh Bangladesh
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.1411023.1 | Last Updated 2 Jan 2012
Article Copyright 2012 by H. S. Masud
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid