private AutoDetection(IConfiguration configuration)
        {
            TestSuite     = configuration.TestSuite;
            Configuration = configuration;

            InitializeDetector();

            detectSteps = ValueDetector.GetDetectionSteps();

            Prerequisites p = GetPrerequisitsInValueDetectorAssembly();

            prerequisiteView = new PrerequisiteView()
            {
                Summary    = p.Summary,
                Title      = p.Title,
                Properties = new List <Property>()
            };
            foreach (var i in p.Properties)
            {
                prerequisiteView.Properties.Add(new Property()
                {
                    Name    = i.Key,
                    Value   = ((i.Value != null) && (i.Value.Count > 0)) ? i.Value[0] : null,
                    Choices = i.Value
                });
            }
        }
Ejemplo n.º 2
0
        public void SetPrerequisites(IEnumerable <Feat> feats)
        {
            string[] delimiters     = new string[] { "," };
            var      splitPrereqs   = PrerequisitesString.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            var      trimmedPrereqs = new List <string>();

            foreach (var str in splitPrereqs)
            {
                trimmedPrereqs.Add(str.Trim());
            }

            var List = feats.ToList();

            foreach (var prereq in trimmedPrereqs)
            {
                //if (List.Exists(f => f.Name == prereq))
                //{
                //    Prerequisites.Add(List.Where(f => f.Name == prereq).FirstOrDefault());
                //    continue;
                //}
                Prerequisites.Add(prereq);
            }

            if (int.TryParse(Regex.Match(PrerequisitesString, @"(?<=base attack bonus )(\+\d*)").Value, out int number))
            {
                BabRequirement = number;
            }
        }
Ejemplo n.º 3
0
        public Prerequisites GetPrerequisites()
        {
            Prerequisites pre = new Prerequisites()
            {
                Summary    = "Summary",
                Title      = "Test",
                Properties = new Dictionary <string, List <string> >()
                {
                    { "Property1", new List <string>()
                      {
                          "Value1"
                      } },
                    { "Property2", new List <string>()
                      {
                          "Value2", "Value3"
                      } },
                    { "Property3", new List <string>()
                      {
                          "Value4", "Value5", "Value6"
                      } }
                }
            };

            return(pre);
        }
        public Prerequisites GetPrerequisites()
        {
            config = new Configs();
            config.LoadDefaultValues();
            Prerequisites prereq = new Prerequisites()
            {
                Title      = "Check Environment",
                Summary    = "Please configure the environment",
                Properties = new Dictionary <string, List <string> >()
            };

            prereq.AddProperty("Full Qualified Domain Name", config.FullDomainName);
            prereq.AddProperty("Domain Administrator Username", config.DomainAdminUsername);
            prereq.AddProperty("Domain Administrator Password", config.DomainAdminPwd);

            prereq.AddProperty("Primary DC Operating System", config.PDCOperatingSystem);
            prereq.AddProperty("Primary DC Computer Name", config.PDCComputerName);
            prereq.AddProperty("Primary DC IP Address", config.PDCIP);

            prereq.AddProperty("Client Computer Operating System", config.ClientOperatingSystem);
            prereq.AddProperty("Client Operating System Version", config.ClientOSVersion);
            prereq.AddProperty("Client Computer Name", config.ClientComputerName);
            prereq.AddProperty("Client IP Address", config.ClientIP);
            prereq.AddProperty("Client Administrator Username", config.ClientAdminUsername);
            prereq.AddProperty("Client Administrator Password", config.ClientAdminPwd);

            prereq.AddProperty("Enable Offline Capture Testing", bool.Parse(config.TriggerDisabled).ToString(), (!bool.Parse(config.TriggerDisabled)).ToString());
            prereq.AddProperty("Capture File Path", config.LocalCapFilePath);

            return(prereq);
        }
Ejemplo n.º 5
0
 //**************************************
 //练习2修改,增加if判断语句,只有c的课程与当前课程课程号不同才会执行增加先修课程
 public void AddPrerequisite(Course c)
 {
     if (c.CourseNumber != this.CourseNumber)
     {
         Prerequisites.Add(c);
     }
 }
Ejemplo n.º 6
0
 public static void AddProperty(this Prerequisites prerequisite, string name, string value)
 {
     prerequisite.Properties.Add(name, new List <string>()
     {
         value
     });
 }
Ejemplo n.º 7
0
            public bool Equals(Prerequisites p)
            {
                if ((object)p == null)
                {
                    return(false);
                }

                return((this.paused == p.paused) &&
                       (this.inAtmosphere == p.inAtmosphere) &&
                       (this.timeOfDay == p.timeOfDay) &&
                       (this.maxVelocitySurface == p.maxVelocitySurface) &&
                       (this.minVelocitySurface == p.minVelocitySurface) &&
                       (this.maxVelocityOrbital == p.maxVelocityOrbital) &&
                       (this.minVelocityOrbital == p.minVelocityOrbital) &&
                       (this.maxAltitude == p.maxAltitude) &&
                       (this.minAltitude == p.minAltitude) &&
                       (this.maxVesselDistance == p.maxVesselDistance) &&
                       (this.minVesselDistance == p.minVesselDistance) &&
                       (this.vesselState == p.vesselState) &&
                       (this.scene == p.scene) &&
                       (this.situation == p.situation) &&
                       (this.cameraMode == p.cameraMode) &&
                       (this.bodyName.Equals(p.bodyName)) &&
                       (this.vesselType == p.vesselType));
                //Playlist playAfter = null;
                //Playlist playNext = null;
            }
Ejemplo n.º 8
0
        /// <summary>
        /// Start this service
        /// </summary>
        /// <param name="taskScheduler"></param>
        /// <param name="cancellationToken"></param>
        /// <returns>Task</returns>
        public async Task Startup(TaskScheduler taskScheduler, CancellationToken cancellationToken = default)
        {
            var prerequisiteTasks = Prerequisites.Select(node => node._startupTaskCompletionSource.Task).ToArray();

            if (prerequisiteTasks.Length == 1)
            {
                await prerequisiteTasks[0].ConfigureAwait(false);
            }
            else if (prerequisiteTasks.Length > 1)
            {
                await Task.WhenAll(prerequisiteTasks).ConfigureAwait(false);
            }

            switch (Service)
            {
            case IStartupAsync startupAsync:
                await Run(startupAsync.StartupAsync, taskScheduler, _startupTaskCompletionSource, cancellationToken).ConfigureAwait(false);

                break;

            case IStartup startup:
                await Run(startup.Startup, taskScheduler, _startupTaskCompletionSource, cancellationToken).ConfigureAwait(false);

                break;
            }
        }
Ejemplo n.º 9
0
        private static async Task <int> RunPrerequisitesInstaller()
        {
            Initialize(out Config config, out GoogleOAuthFlow.ApplicationOAuthConfiguration applicationOAuthConfiguration);
            int result = await Prerequisites.RunPrerequisitesInstaller(config.UE4Folder);

            return(result);
        }
Ejemplo n.º 10
0
            public override bool Equals(System.Object obj)
            {
                if (obj == null)
                {
                    return(false);
                }

                Prerequisites p = obj as Prerequisites;

                if ((System.Object)p == null)
                {
                    return(false);
                }

                return((this.paused == p.paused) &&
                       (this.inAtmosphere == p.inAtmosphere) &&
                       (this.timeOfDay == p.timeOfDay) &&
                       (this.maxVelocitySurface == p.maxVelocitySurface) &&
                       (this.minVelocitySurface == p.minVelocitySurface) &&
                       (this.maxVelocityOrbital == p.maxVelocityOrbital) &&
                       (this.minVelocityOrbital == p.minVelocityOrbital) &&
                       (this.maxAltitude == p.maxAltitude) &&
                       (this.minAltitude == p.minAltitude) &&
                       (this.maxVesselDistance == p.maxVesselDistance) &&
                       (this.minVesselDistance == p.minVesselDistance) &&
                       (this.scene == p.scene) &&
                       (this.situation == p.situation) &&
                       (this.cameraMode == p.cameraMode) &&
                       (this.bodyName.Equals(p.bodyName)));
                //Playlist playAfter = null;
                //Playlist playNext = null;
            }
Ejemplo n.º 11
0
        public ActionResult DeleteConfirmed(int id)
        {
            Prerequisites prerequisites = db.Prerequisites.Find(id);

            db.Prerequisites.Remove(prerequisites);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 private void AddPrerequisiteAssumptions(IOrganizationService service)
 {
     foreach (var assumption in Prerequisites.Select(prereq => (EntityDataAssumptionBaseAttribute)Activator.CreateInstance(prereq))
              .Where(a => !_assumedEntities.Contains(a)))
     {
         assumption.AddAssumedEntitiesWithPreReqInfiniteLoopPrevention(service, _assumedEntities, _currentlyProcessingPreReqs);
     }
 }
Ejemplo n.º 13
0
 //**************************************
 //
 public void AddPrerequisite(Course c)
 {
     //确保一门课程不能把增加设为先修课程
     if (c.CourseNumber != this.CourseNumber)
     {
         Prerequisites.Add(c);
     }
 }
        /// <summary>
        /// Insert all of the prerequisites for the given module.
        /// </summary>
        /// <param name="moduleID">The module to add the prerequisites for.</param>
        public void insertAll(int moduleID, bool removePrevious)
        {
            if (removePrevious)
            {
                Prerequisites.removeAll(moduleID);
            }

            Prerequisites.addAll(moduleID, PrereqsEditor.DataList);
        }
Ejemplo n.º 15
0
 /// <inheritdoc/>
 public override bool DoesModelPassFilter(string filter) =>
 Number.ToString().Contains(filter) ||
 Title.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 QuestGiver.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Location.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 DateAvailable.Contains(filter) ||
 Prerequisites.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Reward.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Instructions.Contains(filter, StringComparison.OrdinalIgnoreCase);
Ejemplo n.º 16
0
        /// <summary>
        /// Completes the initialization by updating the prequisites and checking trainability on trial account.
        /// </summary>
        internal void CompleteInitialization(IEnumerable <SerializableSkillPrerequisite> prereqs)
        {
            if (prereqs == null)
            {
                return;
            }

            // Create the prerequisites list
            Prerequisites.AddRange(prereqs.Select(x => new StaticSkillLevel(x.GetSkill(), x.Level)));
        }
Ejemplo n.º 17
0
        public void ParseSomeYaml()
        {
            var yamlNode = PrerequisitesYaml.ParseYaml();
            var prereq   = yamlNode.GetNode("prerequisites");

            var prereqs = new Prerequisites(prereq);

            Assert.AreEqual(4, prereqs.Count);
            Assert.IsInstanceOf <Prerequisites.AbilityPrerequisite> (prereqs.First());
        }
Ejemplo n.º 18
0
 public TechProject(
     fbGame game,
     int owner,
     Station station,
     int length,
     TechID tech
     ) : base(game, owner, station, Tech.Techs[tech].Cost, length)
 {
     this.tech = tech;
     Prerequisites.AddRange(Tech.Techs[tech].Prerequisites);
 }
Ejemplo n.º 19
0
 public ActionResult Edit([Bind(Include = "PrerequisiteID,CourseID,RequiredCourseID")] Prerequisites prerequisites)
 {
     if (ModelState.IsValid)
     {
         db.Entry(prerequisites).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseID         = new SelectList(db.Courses, "CourseID", "CourseName", prerequisites.CourseID);
     ViewBag.RequiredCourseID = new SelectList(db.Courses, "CourseID", "CourseName", prerequisites.RequiredCourseID);
     return(View(prerequisites));
 }
Ejemplo n.º 20
0
    public virtual void Initialize(Actor a, string d, List <Goal> p, List <Goal> o)
    {
        m_Actor     = a;
        Description = d;

        Prerequisites.AddRange(p);
        Options.AddRange(o);

        foreach (var prereq in Prerequisites)
        {
            prereq.Initialize(a);
        }
    }
Ejemplo n.º 21
0
    //练习2  
    public void AddPrerequisite(Course c)
    {
        if (this == c)
        {
            Console.WriteLine("不能将自己设为先修课");

        }
        else
        {
            Prerequisites.Add(c);
        }

    }
Ejemplo n.º 22
0
        public async Task <IActionResult> OnGetRemovePrerequisiteOfAsync(int puzzleId, int prerequisiteOf)
        {
            Prerequisites toRemove = await _context.Prerequisites.Where(m => m.PuzzleID == prerequisiteOf && m.PrerequisiteID == puzzleId).FirstOrDefaultAsync();

            if (toRemove != null)
            {
                _context.Prerequisites.Remove(toRemove);
                await _context.SaveChangesAsync();
            }

            // redirect without the prerequisite info to keep the URL clean
            return(RedirectToPage(new { puzzleId }));
        }
Ejemplo n.º 23
0
 private bool meetsPrerequisites(AgricolaPlayer player)
 {
     if (Prerequisites.Count() > 0)
     {
         foreach (var prereq in Prerequisites)
         {
             if (!prereq.IsMet(player))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Ejemplo n.º 24
0
 internal override GeneMemento GetMemento()
 {
     return(new GeneMemento(
                nameof(DropColumnGene),
                new Dictionary <string, string>
     {
     },
                Sha256Hash,
                new Dictionary <string, IEnumerable <BigInteger> >
     {
         ["Prerequisites"] = Prerequisites.Select(x => x.Sha256Hash),
         ["Parent"] = new[] { _parent.Sha256Hash }
     }));
 }
Ejemplo n.º 25
0
        // GET: Prerequisites/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Prerequisites prerequisites = db.Prerequisites.Find(id);

            if (prerequisites == null)
            {
                return(HttpNotFound());
            }
            return(View(prerequisites));
        }
Ejemplo n.º 26
0
        private async Task LoadPrereqsAsync()
        {
            Prerequisites.Clear();
            var prereqs = await Task.Run(() => _Repository.Prerequisite.GetRange(c => c.CourseId == Model.CourseId));
            foreach (var prerequisite in prereqs)
            {
                //for displaying in list. Gets qualification
                var prereq = await Task.Run(() => _Repository.Qualification.Get(c => c.QualificationId == prerequisite.QualificationId));
                prerequisite.Qualification = prereq;
                //end

                Prerequisites.Add(new PrereqModel(prerequisite, _Repository));
            }
        }
Ejemplo n.º 27
0
 internal override MigrationMemento GetMemento()
 {
     return(new MigrationMemento(
                nameof(CreatePrimaryKeyMigration),
                new Dictionary <string, string>
     {
     },
                Sha256Hash,
                new Dictionary <string, IEnumerable <BigInteger> >
     {
         ["Prerequisites"] = Prerequisites.Select(x => x.Sha256Hash),
         ["Parent"] = new[] { _parent.Sha256Hash },
         ["Columns"] = _columns.Select(c => c.Sha256Hash).ToArray()
     }));
 }
Ejemplo n.º 28
0
 internal override MigrationMemento GetMemento()
 {
     return(new MigrationMemento(
                nameof(CreateTableMigration),
                new Dictionary <string, string>
     {
         [nameof(TableName)] = TableName
     },
                Sha256Hash,
                new Dictionary <string, IEnumerable <BigInteger> >
     {
         ["Prerequisites"] = Prerequisites.Select(x => x.Sha256Hash),
         ["Parent"] = new[] { _parent.Sha256Hash }
     }));
 }
 internal override MigrationMemento GetMemento()
 {
     return(new MigrationMemento(
                nameof(UseSchemaMigration),
                new Dictionary <string, string>
     {
         [nameof(DatabaseName)] = DatabaseName,
         [nameof(SchemaName)] = SchemaName
     },
                Sha256Hash,
                new Dictionary <string, IEnumerable <BigInteger> >
     {
         ["Prerequisites"] = Prerequisites.Select(x => x.Sha256Hash)
     }));
 }
Ejemplo n.º 30
0
        // GET: Prerequisites/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Prerequisites prerequisites = db.Prerequisites.Find(id);

            if (prerequisites == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CourseID         = new SelectList(db.Courses, "CourseID", "CourseName", prerequisites.CourseID);
            ViewBag.RequiredCourseID = new SelectList(db.Courses, "CourseID", "CourseName", prerequisites.RequiredCourseID);
            return(View(prerequisites));
        }
Ejemplo n.º 31
0
 public Playlist(Playlist p)
 {
     name = p.name;
     enabled = p.enabled;
     playWhen = new Prerequisites(p.playWhen);
     loop = p.loop;
     shuffle = p.shuffle;
     pauseOnGamePause = p.pauseOnGamePause;
     disableAfterPlay = p.disableAfterPlay;
     playNext = p.playNext;
     playBefore = p.playBefore;
     playAfter = p.playAfter;
     tracks = new List<string>(p.tracks);
     channel = p.channel;
     fade = new Fade(p.fade);
     trackFade = new Fade(p.trackFade);
     preloadTime = p.preloadTime;
 }
Ejemplo n.º 32
0
 public Prerequisites(Prerequisites p)
 {
     bodyName = p.bodyName;
     paused = p.paused;
     scene = p.scene;
     situation = p.situation;
     cameraMode = p.cameraMode;
     inAtmosphere = p.inAtmosphere;
     timeOfDay = p.timeOfDay;
     maxVelocitySurface = p.maxVelocitySurface;
     minVelocitySurface = p.minVelocitySurface;
     maxVelocityOrbital = p.maxVelocityOrbital;
     minVelocityOrbital = p.minVelocityOrbital;
     maxAltitude = p.maxAltitude;
     minAltitude = p.minAltitude;
 }
Ejemplo n.º 33
0
 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 // TODO: Make sure any new fields are added to Equals, the CTOR and the persistor.
 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 // public bool noInteruptions = false; // Play this playlist until it ends, no switching.
 // public bool noMerging = false; // Disallow other playlists from being mixed with this one
 // public bool warpMusic = false;
 // public string preloadThisPlaylistOnCompletion;
 // Resume from last playback position?
 // Has docking target?
 // KSC building levels?
 public Playlist()
 {
     name = GetNewPlaylistName();
     playWhen = new Prerequisites();
 }
Ejemplo n.º 34
0
            public bool Equals(Prerequisites p)
            {
                if ((object)p == null)
                {
                    return false;
                }

                return (this.paused == p.paused) &&
                        (this.inAtmosphere == p.inAtmosphere) &&
                        (this.timeOfDay == p.timeOfDay) &&
                        (this.maxVelocitySurface == p.maxVelocitySurface) &&
                        (this.minVelocitySurface == p.minVelocitySurface) &&
                        (this.maxVelocityOrbital == p.maxVelocityOrbital) &&
                        (this.minVelocityOrbital == p.minVelocityOrbital) &&
                        (this.maxAltitude == p.maxAltitude) &&
                        (this.minAltitude == p.minAltitude) &&
                        (this.maxVesselDistance == p.maxVesselDistance) &&
                        (this.minVesselDistance == p.minVesselDistance) &&
                        (this.scene == p.scene) &&
                        (this.situation == p.situation) &&
                        (this.cameraMode == p.cameraMode) &&
                        (this.bodyName.Equals(p.bodyName));
                //Playlist playAfter = null;
                //Playlist playNext = null;
            }