public PlaylistGridViewColumn Create(PlaylistColumn column)
        {
            var gridViewColumn = new PlaylistGridViewColumn(column);

            switch (column.Type)
            {
            case PlaylistColumnType.Script:
                if (!string.IsNullOrEmpty(column.Script))
                {
                    gridViewColumn.DisplayMemberBinding = new PlaylistScriptBinding()
                    {
                        ScriptingContext = this.ScriptingContext.Value,
                        Script           = column.Script
                    };
                }
                break;

            case PlaylistColumnType.Plugin:
                if (!string.IsNullOrEmpty(column.Plugin))
                {
                    var provider = PlaylistColumnProviderManager.GetProvider(column.Plugin);
                    if (provider != null)
                    {
                        gridViewColumn.CellTemplate = provider.CellTemplate;
                    }
                }
                break;

            case PlaylistColumnType.Tag:
                if (!string.IsNullOrEmpty(column.Tag))
                {
                    gridViewColumn.DisplayMemberBinding = new PlaylistMetaDataBinding()
                    {
                        Name   = column.Tag,
                        Format = column.Format
                    };
                }
                break;
            }
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumn.WidthProperty,
                typeof(GridViewColumn),
                column,
                "Width",
                ColumnWidthConverter.Instance,
                (sender, e) => this.OnWidthChanged(column)
                );
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumnExtensions.PositionProperty,
                typeof(GridViewColumn),
                column,
                "Sequence",
                (sender, e) => this.OnPositionChanged(column)
                );
            return(gridViewColumn);
        }
        public GridViewColumn Create(PlaylistColumn column)
        {
            this.EnsureScriptingContext();
            var gridViewColumn = default(GridViewColumn);

            if (column.IsDynamic)
            {
                gridViewColumn = new RefreshableGridViewColumn();
            }
            else
            {
                gridViewColumn = new GridViewColumn();
            }
            gridViewColumn.Header = column.Name;
            switch (column.Type)
            {
            case PlaylistColumnType.Script:
                gridViewColumn.DisplayMemberBinding = new PlaylistScriptBinding()
                {
                    PlaybackManager  = this.PlaybackManager,
                    ScriptingContext = this.ScriptingContext,
                    Script           = column.Script
                };
                break;

            case PlaylistColumnType.Plugin:
                var provider = PlaylistColumnManager.GetProvider(column.Plugin);
                if (provider != null)
                {
                    gridViewColumn.CellTemplate = provider.CellTemplate;
                }
                break;
            }
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumn.WidthProperty,
                typeof(GridViewColumn),
                column,
                "Width",
                ColumnWidthConverter.Instance,
                (sender, e) => this.OnWidthChanged(column)
                );
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumnExtensions.PositionProperty,
                typeof(GridViewColumn),
                column,
                "Sequence",
                (sender, e) => this.OnPositionChanged(column)
                );
            return(gridViewColumn);
        }
        public PlaylistGridViewColumn Create(PlaylistColumn column)
        {
            var gridViewColumn = new PlaylistGridViewColumn(column);

            switch (column.Type)
            {
            case PlaylistColumnType.Script:
                if (!string.IsNullOrEmpty(column.Script))
                {
                    gridViewColumn.DisplayMemberBinding = new PlaylistScriptBinding()
                    {
                        ScriptingContext = this.ScriptingContext.Value,
                        Script           = column.Script
                    };
                }
                break;

            case PlaylistColumnType.Plugin:
                if (!string.IsNullOrEmpty(column.Plugin))
                {
                    var provider = PlaylistColumnProviderManager.GetProvider(column.Plugin) as IUIPlaylistColumnProvider;
                    if (provider == null)
                    {
                        Logger.Write(this, LogLevel.Warn, "Playlist column plugin \"{0}\" was not found, has it been uninstalled?", column.Plugin);
                    }
                    else
                    {
                        gridViewColumn.CellTemplate = provider.CellTemplate;
                    }
                }
                break;

            case PlaylistColumnType.Tag:
                if (!string.IsNullOrEmpty(column.Tag))
                {
                    gridViewColumn.DisplayMemberBinding = new PlaylistMetaDataBinding()
                    {
                        Name   = column.Tag,
                        Format = column.Format
                    };
                }
                break;
            }
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumn.WidthProperty,
                typeof(GridViewColumn),
                column,
                "Width",
                ColumnWidthConverter.Instance,
                (sender, e) =>
            {
                if (IsAutoSizing(gridViewColumn))
                {
                    //Don't raise events while auto sizing is in progress.
                    return;
                }
                this.OnWidthChanged(column);
            }
                );
            BindingHelper.Create(
                gridViewColumn,
                GridViewColumnExtensions.PositionProperty,
                typeof(GridViewColumn),
                column,
                "Sequence",
                (sender, e) => this.OnPositionChanged(column)
                );
            return(gridViewColumn);
        }