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

WSS Picture Thumbnails Web Part

Rate me:
Please Sign up or sign in to vote.
4.43/5 (14 votes)
25 May 2009CPOL6 min read 180.7K   849   35  
Displays images from a SharePoint Picture Library in a widget-like thumbnail layout
//
//	Utility.cs - � Questech Systems
//	This notice must stay intact for use. Not for resale.
//
using System;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Resources;
using System.Web;
using System.Web.UI;

namespace QuestechSystems.SharePoint
{
    public static class Utility
    {
        public const string BaseName = "QuestechSystems.SharePoint";
        public const string FilePathLitebox = "ClientScripts.litebox-1.0.js";
        public const string FilePathMooFx = "ClientScripts.moo.fx.js";
        public const string FilePathPrototypeLite = "ClientScripts.prototype.lite.js";
        public const string JSBlockKeyLitebox = "JSBlockKeyLitebox";
        public const string JSIncludeKeyLitebox = "JSIncludeKeyLitebox";
        public const string JSIncludeKeyMooFx = "JSIncludeKeyMooFx";
        public const string JSIncludeKeyPrototypeLite = "JSIncludeKeyPrototypeLite";

        public const string JSBlockLiteboxFormatString = @"fileLoadingImage = ""{0}loading.gif"";fileBottomNavCloseImage = ""{0}closelabel.gif"";_spBodyOnLoadFunctionNames.push('initLightbox');";
        public const string QueryCamlOrderByFormatString = "<FieldRef Name='{0}' Ascending='{1}' />";
        public const string QueryCamlOrderByTagFormatString = "<OrderBy>{0}</OrderBy>";

        public static ResourceManager ResourceManager = new ResourceManager(String.Format("{0}.Resources.Resources", BaseName), Assembly.GetCallingAssembly());


        public static string GetResourceString(string stringId)
        {
            return Utility.ResourceManager.GetString(stringId);
        }

        public static string GetResourceString(ResourceManager rm, string stringId)
        {
            if (rm == null)
            {
                return GetResourceString(stringId);
            }
            else
            {
                return rm.GetString(stringId);
            }
        }


        public static void AddOrderByCaml(ref string caml, string property, bool sortOrder)
        {
            if (String.IsNullOrEmpty(property))
            {
                return;
            }
            caml += String.Format(QueryCamlOrderByFormatString, property, sortOrder.ToString().ToUpper());
        }
    }
}

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)


Written By
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.

Experience and expertise in SharePoint 2016 / 2013 / 2010 / 2007.

Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.

Proven experience working effectively in a team environment and a self-managed environment.

Comments and Discussions