示例#1
0
文件: Program.cs 项目: srl295/NCLDR
        static void Main(string[] args)
        {
            Console.WriteLine("NCLDR Builder");
            Console.WriteLine("NCLDR Builder builds the NCLDR data file from CLDR data");
            Console.WriteLine(String.Empty);

            CommandArgumentsReader reader = new CommandArgumentsReader(args);
            string cldrPath = reader.GetArgumentValue("-CLDRPath");
            string ncldrPath = reader.GetArgumentValue("-NCLDRPath");
            displayMode = GetDisplayMode(reader.GetArgumentValue("-DisplayMode"));
            if (String.IsNullOrEmpty(cldrPath) || String.IsNullOrEmpty(ncldrPath))
            {
                Console.WriteLine("Syntax:");
                Console.WriteLine("NCldrBuilderCmd -CLDRPath:<CLDRPath> -NCLDRPath:<NCLDRPath> [-DisplayMode:Quiet|Verbose|Diagnostics]");
                Console.WriteLine("where:");
                Console.WriteLine(@"<CLDRPath> is the path to the CLDR root folder e.g. C:\CLDR\Release22.1");
                Console.WriteLine(@"<NCLDRPath> is the path to the NCLDR output folder e.g. C:\Projects\NCldr\Source\NCldr\NCldrData");
                Console.WriteLine(@"<DisplayMode> is either Quiet, Verbose or Diagnostics indicating the volume of progress information displayed");
            }
            else if (!Directory.Exists(cldrPath))
            {
                Console.WriteLine(String.Format("CLDRPath '{0}' does not exist", cldrPath));
            }
            else if (!Directory.Exists(ncldrPath))
            {
                Console.WriteLine(String.Format("NCLDRPath '{0}' does not exist", ncldrPath));
            }
            else
            {
                Console.WriteLine(String.Empty);
                NCldrBuilder.Build(cldrPath, ncldrPath, new NCldrBuilderProgressEventHandler(Progress));
                Console.WriteLine(String.Empty);
                Console.WriteLine("Done.");
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("NCLDR Builder");
            Console.WriteLine("NCLDR Builder builds the NCLDR data file from CLDR data");
            Console.WriteLine(String.Empty);

            CommandArgumentsReader reader = new CommandArgumentsReader(args);
            string cldrPath  = reader.GetArgumentValue("-CLDRPath");
            string ncldrPath = reader.GetArgumentValue("-NCLDRPath");

            displayMode = GetDisplayMode(reader.GetArgumentValue("-DisplayMode"));
            string dataSourceName = reader.GetArgumentValue("-DataSource");

            NCldrDataSources.Discover();
            INCldrFileDataSource dataSource = GetDataSource(dataSourceName);

            if (String.IsNullOrEmpty(cldrPath) || String.IsNullOrEmpty(ncldrPath) || dataSource == null)
            {
                Console.WriteLine("Syntax:");
                Console.WriteLine("NCldrBuilderCmd -CLDRPath:<CLDRPath> -NCLDRPath:<NCLDRPath> [-DisplayMode:Quiet|Verbose|Diagnostics] [-DataSource:Binary|Json]");
                Console.WriteLine("where:");
                Console.WriteLine(@"<CLDRPath> is the path to the CLDR root folder e.g. C:\CLDR\Release23");
                Console.WriteLine(@"<NCLDRPath> is the path to the NCLDR output folder e.g. C:\Projects\NCldr\Source\NCldr\NCldrData");
                Console.WriteLine(@"DisplayMode is either Quiet, Verbose or Diagnostics indicating the volume of progress information displayed");
                Console.WriteLine(@"DataSource is either Binary (default), Json or XML indicating the file format of the data file created");
            }
            else if (!Directory.Exists(cldrPath))
            {
                Console.WriteLine(String.Format("CLDRPath '{0}' does not exist", cldrPath));
            }
            else if (!Directory.Exists(ncldrPath))
            {
                Console.WriteLine(String.Format("NCLDRPath '{0}' does not exist", ncldrPath));
            }
            else
            {
                dataSource.NCldrDataPath = ncldrPath;

                Console.WriteLine(String.Empty);
                NCldrBuilder.Build(cldrPath, dataSource, new NCldrBuilderProgressEventHandler(Progress));
                Console.WriteLine(String.Empty);
                Console.WriteLine("Done.");
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            Console.WriteLine("NCLDR Builder");
            Console.WriteLine("NCLDR Builder builds the NCLDR data file from CLDR data");
            Console.WriteLine(String.Empty);

            CommandArgumentsReader reader = new CommandArgumentsReader(args);
            string cldrPath = reader.GetArgumentValue("-CLDRPath");
            string ncldrPath = reader.GetArgumentValue("-NCLDRPath");
            displayMode = GetDisplayMode(reader.GetArgumentValue("-DisplayMode"));
            string dataSourceName = reader.GetArgumentValue("-DataSource");
            NCldrDataSources.Discover();
            INCldrFileDataSource dataSource = GetDataSource(dataSourceName);
            if (String.IsNullOrEmpty(cldrPath) || String.IsNullOrEmpty(ncldrPath) || dataSource == null)
            {
                Console.WriteLine("Syntax:");
                Console.WriteLine("NCldrBuilderCmd -CLDRPath:<CLDRPath> -NCLDRPath:<NCLDRPath> [-DisplayMode:Quiet|Verbose|Diagnostics] [-DataSource:Binary|Json]");
                Console.WriteLine("where:");
                Console.WriteLine(@"<CLDRPath> is the path to the CLDR root folder e.g. C:\CLDR\Release23");
                Console.WriteLine(@"<NCLDRPath> is the path to the NCLDR output folder e.g. C:\Projects\NCldr\Source\NCldr\NCldrData");
                Console.WriteLine(@"DisplayMode is either Quiet, Verbose or Diagnostics indicating the volume of progress information displayed");
                Console.WriteLine(@"DataSource is either Binary (default), Json or XML indicating the file format of the data file created");
            }
            else if (!Directory.Exists(cldrPath))
            {
                Console.WriteLine(String.Format("CLDRPath '{0}' does not exist", cldrPath));
            }
            else if (!Directory.Exists(ncldrPath))
            {
                Console.WriteLine(String.Format("NCLDRPath '{0}' does not exist", ncldrPath));
            }
            else
            {
                dataSource.NCldrDataPath = ncldrPath;

                Console.WriteLine(String.Empty);
                NCldrBuilder.Build(cldrPath, dataSource, new NCldrBuilderProgressEventHandler(Progress));
                Console.WriteLine(String.Empty);
                Console.WriteLine("Done.");
            }
        }