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

Slink Framework - Strongly Typed URLs for ASP.NET

Rate me:
Please Sign up or sign in to vote.
5.00/5 (13 votes)
4 Sep 20078 min read 54.9K   36  
Slink is a code generating Framework that generates type safe URLs for ASP.NET. With Slink URLs, you increase code quality, increase maintainability, and get compile time checking of your URLs in all your ASPX pages (code-behind and non-codebehind).
/***************************************************************************
 *  -- Copyright Bit Armory Labs 2007
 *
 * FILE:     NamespaceTemplateFactory.cs, 45 code lines, [1.58 KB]
 * DATE:     8/26/2007 5:58 PM
 * MODIFIED: 8/26/2007 5:59 PM
 * PATH:     C:\Programming\Projects\Slinks\Slinks.Resources
 *
 * NAMESPACE: Slinks.Generator
 * CLASS:     NamespaceTemplateFactory
 *
 * AUTHOR:   Brian Chavez (Cowboy), bchavez@bitarmory.com
 *
 *                        Licence
 *
 * This library, code generator, and source code
 * is licensed under the terms and conditions defined in the GNU Public
 * License. You are free to use it for non-commercial purposes.
 * If you are going to use any part of it in a commercial 
 * application, contact me and we can work something out.
 * You may use the code generated output of Slink and Slink
 * as a development tool in both commercial and 
 * non-commercial applications.
 *
 * THE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS", WITHOUT WARRANTY
 * OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THIS
 * SOFTWARE.
 ***************************************************************************/

using System;
using TaHoGen.Generators;
using TaHoGen;
namespace Slink.Generator
{
    /// <summary>
    /// Namespace template factory
    /// </summary>
    public class NamespaceTemplateFactory
    {

        /// <summary>
        /// Class template type
        /// </summary>
        private static Type namespaceTemplateType = null;

        /// <summary>
        /// Create class template factory
        /// </summary>
        static NamespaceTemplateFactory()
        {
            NamespaceTemplateFactory.namespaceTemplateType = TemplateFactory.GetTemplateGeneratorType( System.Text.ASCIIEncoding.ASCII.GetString( Properties.Resources.NamespaceTemplate ) );
        }

        /// <summary>
        /// Create class text generator
        /// </summary>
        public static TextGenerator CreateNamespaceTextGenerator( string folderNamespace, TextGenerator classTextGeneratorsInNamespace )
        {
            PropertyTable pt = new PropertyTable();
            pt["FolderNamespace"] = folderNamespace;
            pt["ClassTextGenerators"] = classTextGeneratorsInNamespace;

            TextGenerator namespaceTextGenerator = TemplateFactory.CreateTextGenerator( NamespaceTemplateFactory.namespaceTemplateType, pt );

            return namespaceTextGenerator;
        }
    }
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I'm a .NET developer with a crazy drive to create neat computer stuff.

You can find me coding the night away in my small garage working on various fun projects for my small startup, Bit Armory, with the hopes of making it big someday, just like the YouTube and MySpace guys did. Smile | :)

You can read my blog here http://bchavez.bitarmory.com

Comments and Discussions