public void RunFind(object obj) { T key = (T)obj; while (firstSorting || secondSorting) { bool findingInitially = true; findEvent.WaitOne(); lock (changeLocker) { if (findingInitially) { Monitor.PulseAll(changeLocker); findingInitially = false; } try { T foundKey = finder.Find(key, this.m1); } catch (KeyNotFoundException e) { } Monitor.PulseAll(changeLocker); } } }
public ComboBoxBinder(string value, IEnumerable <string> hints, ComboBoxStyle style) { if (style == ComboBoxStyle.DropDownList) { Debug.Assert(Finder.Find(hints, value)); } Init(hints, style, value); }
private void Awake() { if (Finder.Find <MusicPlayer>() == null) { var gameObject = new GameObject(); gameObject.AddComponent <MusicPlayer>(); } }
private void Awake() { _audioSource = GetComponent <AudioSource>(); _audioSource.clip = Finder.Find <LevelMenuSettings>().cubeSoundPlayer.clickSound; AudioSettings.Instance.SoundEnabled += OnSoundEnabled; AudioSettings.Instance.SoundDisabled += OnSoundDisabled; }
public void FillTreeItem(string filter = "") { // Ищим объекты var selectFinderList = Finder.Find(_finderList, filter); // Заполняем дерево _treeItem.Fill(selectFinderList); }
/// <summary> /// Finds the entities in the specified document. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="entityFinder">The entity finder.</param> /// <returns>The document after it is processed.</returns> public Token[] Find(Token[] tokens, string entityFinder) { if (!Finders.TryGetValue(entityFinder, out var Finder)) { return(tokens); } return(Finder.Find(tokens)); }
public void Returns_Empty_Results() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(FinderOption.Closest); Assert.Equal(Pair.Empty, result); }
private void OnDestroy() { var figureLoader = Finder.Find <FigureLoader>(); if (figureLoader != null) { figureLoader.FigureLoaded -= OnFigureLoaded; } }
public void Returns_Closest_Two_For_Two_People() { var list = new List<Person>() { sue, greg }; var finder = new Finder(list); var result = finder.Find(FindType.ClosestInAge); Assert.Same(sue, result.OlderPerson); Assert.Same(greg, result.YoungerPerson); }
public void Returns_Null_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(FinderFlag.Closest); Assert.Null(result.Younger); Assert.Null(result.Older); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List<Person>(); var finder = new Finder(list); var result = finder.Find(By.Closest); Assert.Null(result.Younger); Assert.Null(result.Older); }
public void Returns_Closest_Two_For_Four_People() { var list = new List<Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(By.Closest); Assert.Same(sue, result.Younger); Assert.Same(greg, result.Older); }
public void Returns_Furthest_Two_For_Four_People() { var list = new List<Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FindType.MaximumDiff); Assert.Same(sue, result.Person1); Assert.Same(sarah, result.Person2); }
public void Returns_Empty_Results_When_Given_One_Person() { var list = new List<Person>() { sue }; var finder = new Finder(list); var result = finder.Find(FindType.MinimumDiff); Assert.Null(result.Person1); Assert.Null(result.Person2); }
public void Returns_Closest_Two_For_Two_People() { var list = new List<Person>() { sue, greg }; var finder = new Finder(list); var result = finder.Find(FindType.MinimumDiff); Assert.Same(sue, result.Person1); Assert.Same(greg, result.Person2); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(FindType.ClosestAge); Assert.Null(result.YongerPerson); Assert.Null(result.OlderPerson); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(); var result = finder.Find(list, Criteria.Clossest); Assert.Null(result.PersonMinor); Assert.Null(result.PersonMajor); }
public void ReturnsFurthestTwoForFourPeople() { var list = new List<Person> { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FinderType.Furthest); Assert.Same(sue, result.YoungerPerson); Assert.Same(sarah, result.OlderPerson); }
public void ReturnsClosestTwoForTwoPeople() { var list = new List<Person> { sue, greg }; var finder = new Finder(list); var result = finder.Find(FinderType.Closest); Assert.Same(sue, result.YoungerPerson); Assert.Same(greg, result.OlderPerson); }
public void Returns_Closest_Two_For_Four_People() { var list = new List<Thing>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FT.One); Assert.AreEqual(sue, result.P1); Assert.AreEqual(greg, result.P2); }
public void Returns_Furthest_Two_For_Two_People() { var list = new List<Person>() { greg, mike }; var finder = new Finder(list); var result = finder.Find(FT.Two); Assert.Same(greg, result.P1); Assert.Same(mike, result.P2); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List<Person>(); var finder = new Finder(list); var result = finder.Find(FindThe.Closest); Assert.Null(result.Person1); Assert.Null(result.Person2); }
public void ReturnsEmptyResultsWhenGivenOnePerson() { var list = new List<Person> { sue }; var finder = new Finder(list); var result = finder.Find(FinderType.Closest); Assert.Null(result.YoungerPerson); Assert.Null(result.OlderPerson); }
public void Returns_Furthest_Two_For_Four_People() { var list = new List<Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FindType.FurthestInAge); Assert.Same(sue, result.OlderPerson); Assert.Same(sarah, result.YoungerPerson); }
public void Returns_EmptyResults_WhenGivenEmptyList() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(TimeSpanFilter.Closest); Assert.Null(result.Person1); Assert.Null(result.Person2); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(SearchType.Closest); Assert.IsNull(result.Oldest); Assert.IsNull(result.Younger); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); var finder = new Finder(list); var result = finder.Find(AgeDifference.Smallest); Assert.Null(result.FirstPerson); Assert.Null(result.SecondPerson); }
public void Returns_Empty_Results_When_Given_One_Person() { var list = new List<Person>() { sue }; var finder = new Finder(list); var result = finder.Find(ResultType.Closest); Assert.Null(result.PersonOne); Assert.Null(result.PersonTwo); }
public void Returns_Furthest_Two_For_Four_People() { var list = new List<Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(ResultType.Furthest); Assert.Same(sue, result.PersonOne); Assert.Same(sarah, result.PersonTwo); }
public void Returns_Furthest_Two_For_Four_People() { var list = new List<Thing>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FT.Two); Assert.Same(sue, result.P1); Assert.Same(sarah, result.P2); }
public void Returns_Closest_Two_For_Two_People() { var list = new List<Person>() { sue, greg }; var finder = new Finder(list); var result = finder.Find(ResultType.Closest); Assert.Same(sue, result.PersonOne); Assert.Same(greg, result.PersonTwo); }
public void Returns_Empty_Results_When_Given_One_Person() { var list = new List<Thing>() { sue }; var finder = new Finder(list); var result = finder.Find(FT.One); Assert.Null(result.P1); Assert.Null(result.P2); }
public void Returns_Closest_Two_For_Two_People() { var list = new List<Thing>() { sue, greg }; var finder = new Finder(list); var result = finder.Find(FT.One); Assert.Same(sue, result.P1); Assert.Same(greg, result.P2); }
public void Returns_Empty_Results_When_Given_One_Person() { var list = new List<Person>() { sue }; var finder = new Finder(list); var result = finder.Find(FindType.ClosestInAge); Assert.Null(result.OlderPerson); Assert.Null(result.YoungerPerson); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new PersonList(); var finder = new Finder(list); var result = finder.Find(Find.Closest); Assert.IsNull(result.Person1); Assert.IsNull(result.Person2); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Thing>(); var finder = new Finder(list); var result = finder.Find(FT.One); Assert.Null(result.P1); Assert.Null(result.P2); }
public void Returns_Empty_Results_When_Given_Empty_List() { var list = new List <Person>(); IPeopleCompareFilter filter = new FurthestBirthdateCompareFilter(); var finder = new Finder(list, filter); var result = finder.Find(); Assert.Null(result.Person1); Assert.Null(result.Person2); }
static void Main(string[] args) { Generator gen = new Generator(); Finder finder = new Finder(); //---- problem space int x = 6; int y = 6; int hc = 35; int xTileSize = 2; int yTileSize = 2; int n = 2; int myX = 2; int myY = 4; /* int x = 100; * int y = 100; * int hc = 5000; * int xTileSize = 5; * int yTileSize = 5; * int n = 20; * * int myX = 40; * int myY = 25;*/ //------------------- var data = gen.Generate(x, y, xTileSize, yTileSize, hc); List <HotelTilePoint> result = finder.Find(myX, myY, n, x, y, xTileSize, yTileSize, data); Console.WriteLine($" my current x {myX} my current y {myY} "); foreach (HotelTilePoint t in result) { Console.WriteLine(t); } /* TileIdClaculator t = new TileIdClaculator(); * * List<int> nears= t.findNears(0, x, y, xTileSize, yTileSize); * nears.Sort(); * foreach (int near in nears) * { * Console.WriteLine(near); * } */ // Console.WriteLine(i); Console.ReadKey(); }
public void Find_WhenSearchTextIsLicense12345_ReturnsNoResults() { Finder finder = new Finder(); finder.Dir = _tempDir; finder.FileMask = "*.*"; finder.FindText = "license12345"; var resultItems = finder.Find().Items; Assert.AreEqual(0, resultItems.Count); }
public void Find_WhenSearchMaskIsTxt1_NoFindsText() { Finder finder = new Finder(); finder.Dir = _tempDir; finder.FileMask = "*.txt1"; finder.FindText = "a"; var resultItems = finder.Find().Items; Assert.AreEqual(0, resultItems.Count); }
private void DoFindWork() { try { _finder.Find(); } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); OnFinderFileProcessed(this, new FinderEventArgs(new Finder.FindResultItem(), new Stats(), Status.Cancelled, _finder.IsSilent)); } }
static bool CanShowNameOrLevel(CubeLevelConfigurationHolder levelHolder) { if (levelHolder == null) { return(false); } var testMode = Finder.Find <LevelMenuMetaLoader>().TestMode; var isOpened = levelHolder.LevelConfiguration.IsOpened; return(testMode || isOpened); }
public void Returns_Empty_Results_When_Given_Empty_List() { var finder = new Finder( new BirthdayDifferenceRepository(new List <Person.Person>()), AlgorithmsFactory.GetSmallestBirthdayDifference() ); var result = finder.Find(); Assert.Null(result.YoungerPerson); Assert.Null(result.OlderPerson); }
public void Find_WhenSearchTextIsNewYorkNoRegExpr_FindsNoMatches() { Finder finder = new Finder(); finder.Dir = _tempDir; finder.FileMask = "*.*"; finder.FindText = "New York"; var resultItems = finder.Find().ItemsWithMatches.ToList(); Assert.AreEqual(0, resultItems.Count); }
private void TestFinder(string testName, int numFiles, int fileSizeInChars, string regExExpression = null) { CreateSpeedDir(); WriteFiles(numFiles, fileSizeInChars); StopWatch stopWatch = new StopWatch(); stopWatch.Start(); Finder finder = new Finder(); finder.Dir = _speedDir; finder.FileMask = "*.*"; if (regExExpression == null) { finder.FindText = "it"; } else { finder.FindText = regExExpression; finder.FindTextHasRegEx = true; } var findResult = finder.Find(); Assert.AreEqual(numFiles, findResult.Stats.Files.Total); //Assert.AreEqual(5000, findResult.Stats.Matches.Found); stopWatch.Stop(); if (_addToAllTestResults) { AddToAllTestResults(testName, numFiles, fileSizeInChars); } else { Console.WriteLine("================================================="); Console.WriteLine("Num Files = " + numFiles + ", File Size=" + fileSizeInChars + " chars "); Console.WriteLine("=================================================="); StopWatch.PrintCollection(stopWatch.Milliseconds); Console.WriteLine(""); } StopWatch.Collection.Clear(); DeleteSpeedDir(); }
public void Furthest_Option_Returns_Pair_With_Highest_Age_Difference() { var list = new List <Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FinderOption.Closest); Assert.Same(sue, result.YoungerPerson); Assert.Same(greg, result.OlderPerson); }
public void Closest_Option_Returns_Pair_With_Lowest_Age_Difference() { var list = new List <Person>() { sue, greg }; var finder = new Finder(list); var result = finder.Find(FinderOption.Closest); Assert.Same(sue, result.YoungerPerson); Assert.Same(greg, result.OlderPerson); }
public void Returns_Closest_Two_For_Four_People() { var list = new List <Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FindType.ClosestAge); Assert.Same(sue, result.YongerPerson); Assert.Same(greg, result.OlderPerson); }
public void Returns_Furthest_Two_For_Two_People() { var list = new List <Person>() { greg, mike }; var finder = new Finder(list); var result = finder.Find(FindType.FurthestAge); Assert.Same(greg, result.YongerPerson); Assert.Same(mike, result.OlderPerson); }
public void Returns_Closest_Two_On_Finding_Closest_Two_In_List_Of_Four_People() { var list = new List <Person>() { greg, mike, sarah, sue }; var finder = new Finder(list); var result = finder.Find(FindTypes.ClosestTwo); Assert.Same(sue, result.YoungerPerson); Assert.Same(greg, result.OlderPerson); }
public void Returns_Furthest_Two_For_Two_People() { var list = new List<Thing>() { greg, mike }; var finder = new Finder(list); var result = finder.Find(FT.Two); Assert.AreEqual(greg, result.P1); Assert.AreEqual(mike, result.P2); }
public void Returns_Furthest_Two_For_Two_People() { var list = new List<Person>() { greg, mike }; var finder = new Finder(list); var result = finder.Find(FindType.FurthestAge); Assert.Same(greg, result.YongerPerson); Assert.Same(mike, result.OlderPerson); }