Beispiel #1
0
        public ExecutableContainer(CommandLineOptions options)
        {
            this.PrintHeader(options);

            XElement xe = XElement.Load(PBEContext.CurrentContext.ConfigFile);

            var xeFSVersions = xe.Element("FSVersions");

            if (xeFSVersions != null)
            {
                foreach (var xeFSVersion in xeFSVersions.Elements("FSVersion"))
                {
                    string ver = (string)xeFSVersion.Attribute("FS");
                    string dir = (string)xeFSVersion.Attribute("Dir");
                    if (File.Exists(Path.Combine(dir, "FSConsole.exe")))
                    {
                        this.FsVerdict.TryAdd(ver, dir);
                    }
                }
            }

            var xeParams = xe.Element("Params");

            foreach (var xeParam in xeParams.Elements("Param"))
            {
                SetParam(xeParam.Attribute("Name").Value, xeParam.Attribute("Value").Value);
            }

            // parse Logflie
            this.Logfile = this.ParseParameters(xe.Attribute("Logfile").Value);
            if (!Path.IsPathRooted(this.Logfile))
            {
                this.Logfile = Path.Combine(PBEContext.CurrentContext.LogFileDirectory, this.Logfile);
            }
            System.IO.FileInfo fiLog = new System.IO.FileInfo(this.Logfile);
            fiLog.Directory.Create();
            this.Logfile = fiLog.FullName;

            // parse LogfileArchive
            this.Logarchive = this.ParseParameters(xe.Attribute("Logarchive").Value);
            System.IO.FileInfo fiLoga = new System.IO.FileInfo(this.Logarchive);
            fiLoga.Directory.Create();
            this.Logarchive = fiLoga.FullName;

            // XML-Datei für das Protkoll vorbereiten.
            this.XmlFilecontetForLog = System.Net.WebUtility.HtmlEncode(xe.ToString())
                                       .Replace("\r\n", "<br/>\r\n")
                                       .Replace("  ", "&nbsp;&nbsp;");

            var xeRootSequence = xe.Element("Sequence");

            rootAction = Executable.Create(xeRootSequence, this, 0);
        }
Beispiel #2
0
        public ExecutableParallel(XElement xe, ExecutableContainer container, int indent)
            : base(xe, container, indent)
        {
            var attrMaxTasks = xe.Attribute("MaxTasks");

            if (attrMaxTasks != null)
            {
                int maxTasks;
                if (Int32.TryParse(attrMaxTasks.Value, out maxTasks))
                {
                    this.MaxTasks = maxTasks;
                }
            }

            this.ActionList = xe.Elements().Select(xeSub => Executable.Create(xeSub, container, indent + 1)).ToList();
        }
Beispiel #3
0
 public ExecutableSequence(XElement xe, ExecutableContainer container, int indent)
     : base(xe, container, indent)
 {
     this.ActionList = xe.Elements().Select(xeSub => Executable.Create(xeSub, container, indent + 1)).ToList();
 }