Builder.Common.Settings.ValidateSettings C# (CSharp) Метод

ValidateSettings() публичный Метод

public ValidateSettings ( Builder builder, string &result ) : bool
builder Builder
result string
Результат bool
        public bool ValidateSettings(Builder builder, out string result)
        {
            if (!File.Exists(builder.ExpandMacros(VSPath)))
            {
                result = "The Visual Studio executable does not exist in the specified path\r\n";
                return false;
            }

            if (!File.Exists(builder.ExpandMacros(InnoSetupPath)))
            {
                result = "The InnoSetup executable does not exist in the specified path\r\n";
                return false;
            }

            if (!Directory.Exists(builder.ExpandMacros(SourcePath)))
            {
                result = "The hMailserver source code does not exist in the specified path\r\n";
                return false;
            }

            result = "";
            return true;
        }

Usage Example

Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length != 3)
             {
            System.Console.WriteLine("Wrong number of parameters passed to Builder.Console");
            Environment.ExitCode = -1;
            return;
             }

             Settings settings = new Settings();
             settings.LoadSettings();

             BuildLoader loader = new BuildLoader();
             Builder.Common.Builder builder = loader.Load(settings.BuildInstructions);

             // Run all steps.
             builder.StepStart = -1;
             builder.StepEnd = -1;

             builder.LoadMacros(args[0], args[1], args[2]);

             string result;
             if (!settings.ValidateSettings(builder, out result))
             {
            System.Console.WriteLine(result);
            Environment.ExitCode = -1;
            return;
             }

             builder.LoadSettings(settings);

             ManualResetEvent eventStopThread= new ManualResetEvent(false);
             ManualResetEvent eventThreadStopped= new ManualResetEvent(false);

             BuildRunner runner = new BuildRunner(eventStopThread, eventThreadStopped, builder);
             runner.StepError+= runner_StepError;
             builder.MessageLog += builder_MessageLog;
             runner.Run();

             return;
        }
All Usage Examples Of Builder.Common.Settings::ValidateSettings