Click here to Skip to main content
15,898,222 members
Articles / Programming Languages / C#

A Tool to create N-Layer Architecture Classes

Rate me:
Please Sign up or sign in to vote.
4.87/5 (18 votes)
6 Jun 2016CPOL8 min read 68.3K   10.9K   126  
This tool is used to create N-Layer Architecture classes.
using System;
using ClassGeneratorControls;

namespace ClassGeneratorEvents
{
    /// <summary>
    /// The class that handles the event of the class generator button.
    /// </summary>
    public class ClassGeneratorButtonEvents
    {
        private ClassGeneratorButton classGeneratorButton;
        private FileCreator fileCreator;
        private UIEntryStore uiEntryStore;

        /// <summary>
        /// The constructor that initializes the class generator button event class.
        /// </summary>
        /// <param name="classGeneratorButton">The class file generator button class.</param>
        /// <param name="uiEntryStore">The class that stores all the values that are entered in the ui.</param>
        public ClassGeneratorButtonEvents(ClassGeneratorButton classGeneratorButton, UIEntryStore uiEntryStore)
        {
            this.classGeneratorButton = classGeneratorButton;
            this.uiEntryStore = uiEntryStore;
            fileCreator = new FileCreator(uiEntryStore);
        }

        /// <summary>
        /// The method that creates the class files.
        /// </summary>
        /// <returns>Returns the paths of the class files created.</returns>
        public string CreateClassFiles()
        {
            System.Text.StringBuilder resultBuilder = new System.Text.StringBuilder();
            resultBuilder.AppendLine(fileCreator.CreateVOClass());
            resultBuilder.AppendLine(fileCreator.CreateBLLClass());
            resultBuilder.AppendLine(fileCreator.CreateDALClass());
            resultBuilder.AppendLine("Files are created successfully.!");
            return resultBuilder.ToString();
        }
    }
}

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
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions