Click here to Skip to main content
15,895,084 members
Articles / Web Development / ASP.NET

WebSlideProjector - Using supersized! jQuery and IZWebFileManager

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
21 Feb 2012GPL35 min read 30.8K   1.3K   10  
WebSlideProjector is a ASP.NET 3.5 Web Application that manages a fullscreen background slideshow (presented by supersized! jQuery library) with handling of anonymous user Projector Setup and login-administered Slide Carousel loading (using IZWebFileManager ASP.NET File Manager library).
/// Author: Petr Pechovic
/// Contact: http://www.pechovic.eu
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetSources.Web.UI.Buttons.CssModel {

    /// <summary>
    /// CssModel is used to get information about CSS from resource according to control type.
    /// </summary>
    public class CssModel {

        /// <summary>
        /// Sync object.
        /// </summary>
        private static object sync = new object();

        /// <summary>
        /// Static collection.
        /// </summary>
        private static Dictionary<Type, CssAttribute> data = new Dictionary<Type, CssAttribute>();

        /// <summary>
        /// Use to retrieve CssAttribute from control.
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public static CssAttribute GetCss(Type type) {

            lock (sync) {
                if (!data.ContainsKey(type)) {
                    CssAttribute[] atts = type.GetCustomAttributes(typeof(CssAttribute), true) as CssAttribute[];
                    if (atts == null || atts.Length == 0) {
                        return null;
                    }
                    data.Add(type, atts[0]);
                }
                return data[type];
            }
        }

    }

}

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 GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
United States United States
I enjoy and take seriously the craft of programming, and I improve upon my skills daily. Start day: coffee is always a good idea!

Comments and Discussions