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-noexe.zip
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-noexe.zip
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.Collections;
using System.Text;
using System.ComponentModel;

namespace Tags.ID3.ID3v2Frames
{
    /// <summary>
    /// Provide collection for frames to use for filtering
    /// </summary>
    public class FilterCollection
    {
        private ArrayList _Frames;

        /// <summary>
        /// Create new cleared filter collection
        /// </summary>
        public FilterCollection()
        {
            _Frames = new ArrayList();
        }

        /// <summary>
        /// Add FrameID to FrameList if not exists
        /// </summary>
        /// <param name="FrameID">FrameID to add to list</param>
        public void Add(string FrameID)
        {
            if (!_Frames.Contains(FrameID))
                _Frames.Add(FrameID);
        }

        /// <summary>
        /// Remove Specific frame from list
        /// </summary>
        /// <param name="FrameID">FrameID to remove from list</param>
        public void Remove(string FrameID)
        {
            _Frames.Remove(FrameID);
        }

        /// <summary>
        /// Get list of frames
        /// </summary>
        public string[] Frames
        {
            get
            { return (string[])_Frames.ToArray(typeof(string)); }
        }

        /// <summary>
        /// Remove all frames from frame list
        /// </summary>
        public void Clear()
        {
            _Frames.Clear();
        }

        /// <summary>
        /// Indicate is specific frame in the list
        /// </summary>
        /// <param name="FrameID">FrameID to search</param>
        /// <returns>true if exists false if not</returns>
        public bool IsExists(string FrameID)
        {
            if (_Frames.Contains(FrameID))
                return true;
            else
                return false;
        }
    }

    /// <summary>
    /// A class for frames collection
    /// </summary>
    /// <typeparam name="FrameType"></typeparam>
    public class FrameCollection<FrameType> : FrameCollectionBase
    {
        /// <summary>
        /// Create a new FrameCollection class
        /// </summary>
        /// <param name="Name">Name of collection</param>
        public FrameCollection(string Name)
            : base(Name) { }

        /// <summary>
        /// Add new Item to current FrameCollection
        /// </summary>
        /// <param name="item">item to add to collection</param>
        public void Add(FrameType item)
        {
            InnerList.Remove(item);
            List.Add(item);
        }

        /// <summary>
        /// remove specific item from current FrameCollection
        /// </summary>
        /// <param name="item">item to remove from collection</param>
        public void Remove(FrameType item)
        {
            List.Remove(item);
        }

        /// <summary>
        /// Convert current collection to FrameType array
        /// </summary>
        /// <returns>FrameType array</returns>
        public FrameType[] ToArray()
        {
            return (FrameType[])InnerList.ToArray(typeof(FrameType));
        }

        /// <summary>
        /// Gets type of current frame 
        /// </summary>
        /// <returns>System.Type</returns>
        protected override Type OnGetType()
        {
            return typeof(FrameType);
        }

        /// <summary>
        /// Gets specific frame from list
        /// </summary>
        /// <param name="index">index of frame in list</param>
        /// <returns>Frame</returns>
        public FrameType this[int index]
        {
            get
            { return (FrameType)this.List[index]; }
        }
    }

    /// <summary>
    /// A base class for frame collection class
    /// </summary>
    public class FrameCollectionBase : CollectionBase
    {
        private string _Name;

        /// <summary>
        /// Create new FrameCollectionBase class
        /// </summary>
        /// <param name="Name">Name of collection</param>
        public FrameCollectionBase(string Name)
        {
            _Name = Name;
        }

        /// <summary>
        /// Sort Items
        /// </summary>
        public void Sort()
        {
            InnerList.Sort();
        }

        /// <summary>
        /// Name of current collection
        /// </summary>
        public string Name
        {
            get
            { return _Name; }
        }

        /// <summary>
        /// Get sum of lengths of items
        /// </summary>
        public int Length
        {
            get
            {
                int Len = 0;
                foreach (ILengthable IL in List)
                    Len += IL.Length;
                return Len;
            }
        }

        /// <summary>
        /// Convert current collection to Frame array
        /// </summary>
        /// <returns>Frame array</returns>
        public virtual Frame[] ToFrameArray()
        {
            return (Frame[])InnerList.ToArray(typeof(Frame));
        }

        /// <summary>
        /// Get type of items in collection
        /// </summary>
        public Type CollectionType
        {
            get
            { return OnGetType(); }
        }

        /// <summary>
        /// Gets type of current frame 
        /// </summary>
        /// <returns>System.Type</returns>
        protected virtual Type OnGetType()
        {
            return typeof(Frame);
        }

        /// <summary>
        /// Add specific frame to collection
        /// </summary>
        /// <param name="item">Frame to add to collection</param>
        public void Add(Frame item)
        {
            List.Add(item);
        }

        /// <summary>
        /// Remove specific frame from list
        /// </summary>
        /// <param name="item">Frame to remove from list</param>
        public void Remove(Frame item)
        {
            if (List.Contains(item))
                List.Remove(item);
        }

        /// <summary>
        /// Indicate if list contains specific frame
        /// </summary>
        /// <param name="item">Frame to search for</param>
        /// <returns>true if exists otherwise false</returns>
        public bool Contains(Frame item)
        { 
            foreach(Frame F in List)
                if(F.Equals(item))
                    return true;
            return false;
        }
    }
}

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
Web03 | 2.8.141030.1 | Last Updated 2 Jan 2012
Article Copyright 2012 by H. S. Masud
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid