ProgramOptions.cs :  » 2.6.4-mono-.net-core » System.Data » System » Data » Linq » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » 2.6.4 mono .net core » System.Data 
System.Data » System » Data » Linq » ProgramOptions.cs
using Mono.GetOptions;

namespace System.Data.Linq{
    public sealed class ProgramOptions : Options
    {
        private string inputType;
        private string outputType;
        private string inputFile;
        private string outputFile;
        private string nspace;
        private string mapOutputFile;
        private string language;

        private string dbName;
        private string server;
        private string userId;
        private string password;
        private string dbType;

        [Option("The ID used for connecting to the database.", "user")]
        public string UserId
        {
            get { return userId; }
            set { userId = value; }
        }

        [Option("The password used to connect to the database.", "pass", AlternateForm="password")]
        public string Password
        {
            get { return password; }
            set { password = value; }
        }

        [Option("The type of source database (eg. MySQL, SQL, Oracle, etc.).", "type")]
        public string DbType
        {
            get { return dbType; }
            set { dbType = value; }
        }

        public string DbName
        {
            get { return dbName; }
            set { dbName = value; }
        }

        [Option("The source server of the mapping.", "server")]
        public string Server
        {
            get { return server; }
            set { 
                server = value;
                inputType = "sql";
            }
        }

        [Option("The type of input for the mapping (either XML or SQL).", "inputType")]
        public string InputType
        {
            get { return inputType; }
            set { inputType = value; }
        }

        [Option("Sets the XML output file for the mapping.", "xml")]
        public string XmlOutput
        {
            get { return inputFile; }
            set
            {
                outputType = "xml";
                outputFile = value;
            }
        }

        [Option("Sets the output code file for the mapping", "code")]
        public string CodeOutput
        {
            get { return outputFile; }
            set
            {
                outputType = "code";
                outputFile = value;
            }
        }

        [Option("The language used to export the mapping.", "language")]
        public string Language
        {
            get { return language; }
            set {
                switch (value.ToLower())
                {
                    case "c#":
                    case "csharp":
                    case "vcs":
                        language = "csharp";
                        break;
                    case "visualbasic":
                    case "vb":
                    case "vbasic":
                        language = "vbasic";
                        break;
                    default:
                        throw new ArgumentException("Language '" + value + "' not supported.");
                }

                outputType = "code";
            }
        }

        public bool IsXmlInput
        {
            get { return String.Compare(inputType, "xml", StringComparison.OrdinalIgnoreCase) == 0; }
        }

        public bool IsSqlInput
        {
            get { return String.Compare(inputType, "sql", StringComparison.OrdinalIgnoreCase) == 0; }
        }

        public string OutputType
        {
            get { return outputType; }
            set { outputType = value; }
        }

        public string InputFile
        {
            get { return inputFile; }
            set { inputFile = value; }
        }

        public string OutputFile
        {
            get { return outputFile; }
            set { outputFile = value; }
        }

        public string Namespace
        {
            get { return nspace; }
            set { nspace = value; }
        }

        public string MapOutputFile
        {
            get { return mapOutputFile; }
            set { mapOutputFile = value; }
        }

        [KillOption]
        public override WhatToDoNext DoHelp2()
        {
            return base.DoHelp2();
        }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.