コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = 13;
         hashCode = (hashCode * 17) ^ TypeOfFileSearch.GetHashCode();
         hashCode = (hashCode * 17) ^ FilePattern?.GetHashCode() ?? 5;
         hashCode = (hashCode * 17) ^ IgnoreFilePattern?.GetHashCode() ?? 5;
         hashCode = (hashCode * 17) ^ TypeOfSearch.GetHashCode();
         hashCode = (hashCode * 17) ^ SearchFor?.GetHashCode() ?? 5;
         hashCode = (hashCode * 17) ^ ReplaceWith?.GetHashCode() ?? 5;
         hashCode = (hashCode * 17) ^ CaseSensitive.GetHashCode();
         hashCode = (hashCode * 17) ^ WholeWord.GetHashCode();
         hashCode = (hashCode * 17) ^ Multiline.GetHashCode();
         hashCode = (hashCode * 17) ^ Singleline.GetHashCode();
         hashCode = (hashCode * 17) ^ BooleanOperators.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeSubfolders.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeHidden.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeBinary.GetHashCode();
         hashCode = (hashCode * 17) ^ MaxSubfolderDepth.GetHashCode();
         hashCode = (hashCode * 17) ^ UseGitignore.GetHashCode();
         hashCode = (hashCode * 17) ^ SkipRemoteCloudStorageFiles.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeArchive.GetHashCode();
         hashCode = (hashCode * 17) ^ FollowSymlinks.GetHashCode();
         hashCode = (hashCode * 17) ^ CodePage.GetHashCode();
         hashCode = (hashCode * 17) ^ ApplyFileSourceFilters.GetHashCode();
         hashCode = (hashCode * 17) ^ ApplyFilePropertyFilters.GetHashCode();
         hashCode = (hashCode * 17) ^ ApplyContentSearchFilters.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = 13;
         hashCode = (hashCode * 17) ^ TypeOfFileSearch.GetHashCode();
         hashCode = (hashCode * 17) ^ FilePattern.GetHashCode();
         hashCode = (hashCode * 17) ^ IgnoreFilePattern.GetHashCode();
         hashCode = (hashCode * 17) ^ TypeOfSearch.GetHashCode();
         hashCode = (hashCode * 17) ^ SearchFor.GetHashCode();
         hashCode = (hashCode * 17) ^ ReplaceWith.GetHashCode();
         hashCode = (hashCode * 17) ^ CaseSensitive.GetHashCode();
         hashCode = (hashCode * 17) ^ WholeWord.GetHashCode();
         hashCode = (hashCode * 17) ^ Multiline.GetHashCode();
         hashCode = (hashCode * 17) ^ Singleline.GetHashCode();
         hashCode = (hashCode * 17) ^ BooleanOperators.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeSubfolders.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeHidden.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeBinary.GetHashCode();
         hashCode = (hashCode * 17) ^ MaxSubfolderDepth.GetHashCode();
         hashCode = (hashCode * 17) ^ UseGitignore.GetHashCode();
         hashCode = (hashCode * 17) ^ IncludeArchive.GetHashCode();
         hashCode = (hashCode * 17) ^ FollowSymlinks.GetHashCode();
         hashCode = (hashCode * 17) ^ CodePage.GetHashCode();
         return(hashCode);
     }
 }
コード例 #3
0
        private Window CreateNewWindow(SearchFor searchFor)
        {
            window = null;

            if (searchFor == SearchFor.Relacionamento)
            {
                _eventAggregator.GetEvent <DadosItemSelecionadoFav>().Subscribe(PreencheDadosItemSelecionadoFav);

                window         = new Window();
                window.Height  = 650;
                window.Width   = 750;
                window.Content = new BuscaDeFavorecidos(SearchFor, window);
                //window.DataContext = _vm;
            }
            else if (searchFor == SearchFor.Materiais)
            {
                _eventAggregator.GetEvent <DadosItemSelecionadoMat>().Subscribe(PreencheDadosItemSelecionadoMat);

                window         = new Window();
                window.Height  = 650;
                window.Width   = 750;
                window.Content = new BuscaDeMateriais(SearchFor, window);
            }


            return(window);
        }
コード例 #4
0
        protected override void ExecuteCrmWorkFlowActivity(CodeActivityContext context, LocalWorkflowContext localContext)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (localContext == null)
            {
                throw new ArgumentNullException(nameof(localContext));
            }

            string stringToSearch = StringToSearch.Get(context);
            string searchFor      = SearchFor.Get(context);
            bool   caseSensitive  = CaseSensitive.Get(context);

            if (!caseSensitive)
            {
                stringToSearch = stringToSearch.ToUpper();
                searchFor      = searchFor.ToUpper();
            }

            bool containsString = stringToSearch.Contains(searchFor);

            ContainsString.Set(context, containsString);
        }
コード例 #5
0
        async public void OnSearch(object sender, EventArgs e)
        {
            IsIndicator.IsEnabled = true;
            IsIndicator.IsVisible = true;
            IsIndicator.IsRunning = true;

            var result = await ViewModel.OnButtonSearched(customMap, SearchFor.Text);


            if (result == "Not found")
            {
                SearchFor.Focus();

                await DisplayAlert(TextResources.SearchNotFound_Title,
                                   TextResources.SearchNotFound_Message,
                                   TextResources.TryAgain);
            }

            else if (result == "No space nearby")
            {
                SearchFor.Focus();

                await DisplayAlert(TextResources.SearchSpaceNearby_Title,
                                   TextResources.SearchSpaceNearby_Message,
                                   TextResources.TryAgain);
            }

            IsIndicator.IsEnabled = false;
            IsIndicator.IsVisible = false;
            IsIndicator.IsRunning = false;
        }
コード例 #6
0
        /// <summary>
        /// Return a list of address records matching the supplied search term.
        /// </summary>
        /// <param name="searchTerm">A search term representing part of an address (e.g. "WR5", "Postcode Anywhere", "Basin Road").</param>
        /// <param name="lastId">An ID from a previous Find operation.</param>
        /// <param name="searchFor">A <see cref="SearchFor"/> value specifying which properties of address records to search against.</param>
        /// <param name="country">The ISO code for the country to search (e.g. "GB").</param>
        /// <param name="languagePreference">The language identifier code for the search result language (e.g. "EN").</param>
        /// <param name="maxSuggestions">The maximum number of autocomplete suggestions to return.</param>
        /// <param name="maxResults">The maximum number of retrievable address results to return.</param>
        /// <returns>A <see cref="CapturePlusFindResult"/> containing a list of results or error information.</returns>
        public CapturePlusFindResult Find(string searchTerm, string lastId, SearchFor searchFor, string country, string languagePreference, int?maxSuggestions, int?maxResults)
        {
            var url = string.Format(_FIND_URL, _apiVersion);

            var req = new RestRequest(url, Method.GET);

            req.AddParameter("Key", _key);
            req.AddParameter("SearchTerm", searchTerm);
            // TODO: I don't yet understand how the LastId parameter is used...
            // The docs say 'If the LastId is provided, the SearchTerm searches within the results from the LastId',
            // but the IDs are unique, so you would only ever be searching within a single result?
            req.AddParameter("LastId", lastId ?? "");
            req.AddParameter("SearchFor", searchFor.ToString());
            req.AddParameter("Country", country);
            req.AddParameter("LanguagePreference", languagePreference);
            req.AddParameter("MaxSuggestions", maxSuggestions.HasValue ? maxSuggestions.Value.ToString() : "");
            req.AddParameter("MaxResults", maxResults.HasValue ? maxResults.Value.ToString() : "");

            var resp   = _client.Execute <CapturePlusFindResultList>(req);
            var result = resp.Data.Items;

            if (result.IsError())
            {
                return(new CapturePlusFindResult(result.MapError()));
            }
            else
            {
                return(new CapturePlusFindResult(result.MapResults()));
            }
        }
コード例 #7
0
        public void SearchBooks_PicksUpProperMenuCase(SearchFor menuItem)
        {
            _menuHelper.Setup(m => m.DoSearchMenuSelection()).Returns(menuItem);

            _search.SearchBooks();
            _screenHelper.Verify(s => s.ReadInputString(menuItem.ToString()), Times.Once);
        }
コード例 #8
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                if (!caseSensitive)
                {
                    stringToSearch = stringToSearch.ToUpper();
                    searchFor      = searchFor.ToUpper();
                }

                bool containsString = stringToSearch.Contains(searchFor);

                ContainsString.Set(executionContext, containsString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
コード例 #9
0
        private T CreateSearchRequest <T>() where T : SearchRequest, new()
        {
            string[] searchForValues;
            if (MultipleValues)
            {
                searchForValues = SearchFor.Replace(Environment.NewLine, "\r").Split('\r', StringSplitOptions.RemoveEmptyEntries);
            }
            else
            {
                searchForValues = new[] { SearchFor };
            }

            var request = new T()
            {
                SearchFor            = searchForValues,
                Encoding             = SelectedEncoding.EncodingInfo?.GetEncoding(),
                Path                 = path,
                Recursive            = recursive,
                FileTypeFilter       = string.IsNullOrWhiteSpace(searchPattern) ? new string[] { "*" } : searchPattern.Split(','),
                MatchCase            = matchCase,
                UseRegularExpression = UseRegularExpressions
            };

            return(request);
        }
コード例 #10
0
 public SearchFavored(SearchFor s)
 {
     InitializeComponent();
     Texto.Focus();
     vm = new SearchFavoredVM(s);
     this.DataContext = vm;
 }
コード例 #11
0
 public override TaskStatus OnUpdate()
 {
     if (SearchFor.ItemInStorageStructures(itemType.Value, originGameObject.Value.transform.position, out Item item, out Storage storage, originGameObject.Value.GetComponent <StorageStructure>()))
     {
         outItem.Value    = item.gameObject;
         outStorage.Value = storage.gameObject;
         return(TaskStatus.Success);
     }
コード例 #12
0
 public SearchFavoredVM(SearchFor s)
 {
     _searchFor = s;
     PreencheCombo();
     this._cmdPesquisar = new DelegateCommand(this.OnPesquisar, this.CanPesquisar);
     this._cmdOK        = new DelegateCommand(this.OnOk, this.CanOk);
     this.CmdCancelar   = new DelegateCommand(this.OnCancelar);
 }
コード例 #13
0
        public CustomNavBar()
        {
            viewModel = new Navbar_Search_ViewModel(new PageService(Navigation));
            InitializeComponent();
            NavigationPage.SetBackButtonTitle(this, "");
            SearchFor.SetBinding(SearchBar.SearchCommandProperty, "SearchTxtCommand");

            SearchFor.Text = Navbar_Search_ViewModel.tempo;
        }
コード例 #14
0
        public BuySellNavBar()
        {
            viewModel = new Navbar_Search_ViewModel(new PageService(Navigation));
            InitializeComponent();

            SearchFor.SetBinding(SearchBar.SearchCommandProperty, "SearchTxtCommand");

            SearchFor.Text = Navbar_Search_ViewModel.tempo;
        }
コード例 #15
0
 public SearchForTestScript(IWebDriver driver)
 {
     this._driver          = driver;
     this._results         = new Result();
     this._searchFor       = new SearchFor(_driver);
     this._pageValidation  = new PageValidation(_driver);
     this._utilsValidation = new DriverUtilitiesValidation(_driver);
     this._userData        = new UserData();
     this._recData         = new RecommenderData();
     this._schoolData      = new SchoolData();
 }
コード例 #16
0
 public bool IsValidInput()
 {
     if (!SearchFor.Contains(" ") && !string.IsNullOrWhiteSpace(SearchFor) && !string.IsNullOrEmpty(SearchFor))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #17
0
        public override TaskStatus OnUpdate()
        {
            outStorageStructure.Value = null;

            if (SearchFor.NearestStorageStructure(originStructure.Value.GetComponent <Structure>().plot, originStructure.Value.transform.position, out StorageStructure targetStorage))
            {
                outStorageStructure.Value = targetStorage.gameObject;
            }

            return(outStorageStructure.Value ? TaskStatus.Success : TaskStatus.Failure);
        }
コード例 #18
0
ファイル: BookmarksViewModel.cs プロジェクト: xyztai/dnGrep
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = 13;
         hashCode = (hashCode * 397) ^ FilePattern.GetHashCode();
         hashCode = (hashCode * 397) ^ SearchFor.GetHashCode();
         hashCode = (hashCode * 397) ^ ReplaceWith.GetHashCode();
         return(hashCode);
     }
 }
コード例 #19
0
        public BuscaDeMateriaisVM(SearchFor s, Window w)
        {
            _searchFor     = s;
            this.JanelaPai = w;
            PreencheCombo();
            this._cmdPesquisar = new DelegateCommand(this.OnPesquisar);
            this._cmdOK        = new DelegateCommand(this.OnOk, this.CanOk);
            this.CmdCancelar   = new DelegateCommand(this.OnCancelar);

            _eventAggregator.GetEvent <KeyDownEvento>().Subscribe(RecebePressedKey);
            _eventAggregator.GetEvent <EnterPressed>().Subscribe(Pesquisar);
        }
コード例 #20
0
    private void _Update()
    {
        if (worker && worker.WorkTime() && worker.fsm.ActiveStateName == "Idle")
        {        //Resupply Items for sale
            if (!supply)
            {
                supplyOrder = orders.Find(o => storage.Count(o.type) < o.min);
                if (supplyOrder != null)
                {
                    supply = true;
                }
            }
            else
            {
                if (storage.Count(supplyOrder.type) >= supplyOrder.max)
                {
                    supply = false;
                }
            }

            if (supply)
            {
                int missingCount = supplyOrder.max - storage.Count(supplyOrder.type);

                Item    item          = null;
                Storage sourceStorage = null;

                if (supplyStorage && SearchFor.ItemInStorage(supplyOrder.type, supplyStorage, out item))
                {
                    sourceStorage = supplyStorage;
                }
                if (!item)
                {
                    SearchFor.ItemInStorageStructures(supplyOrder.type, transform.position, out item, out sourceStorage);
                }
                if (!item)
                {
                    SearchFor.ItemInCraftStructures(supplyOrder.type, transform.position, out item);
                }
                //if (!item)
                //SearchFor.ItemInShopStructures(supplyOrder.type, transform.position, out item, out sourceStorage);

                //Store Item
                if (item)
                {
                    worker.fsm.Store(item, sourceStorage, storage);
                }
            }
        }
    }
コード例 #21
0
        private Window CreateNewWindow(SearchFor searchFor)
        {
            window        = null;
            window        = new Window();
            window.Height = 650;
            window.Width  = 750;

            _telaFavored   = new SearchFavored(SearchFor);
            window.Content = _telaFavored;

            _telaFavored.GetVM().RecebeWindow(window);

            return(window);
        }
コード例 #22
0
        public void SingleSchema_WithRelations()
        {
            var indexName          = _fixture.Create <string>();
            var object1Data        = _fixture.Create <Person>();
            var object1Id          = _fixture.Create <string>();
            var object2Data        = _fixture.Create <Person>();
            var object2Id          = _fixture.Create <string>();
            var schemaDefinition   = JsonSchema.FromType(typeof(Person)).ToJson();
            var schemaId           = _schemaRegistryService.AddSchema("test_schema1", schemaDefinition, SchemaType.Types.Type.DocumentStorage).Result;
            var relationId         = _edgeRegistryService.AddRelation(schemaId.Id_, schemaId.Id_).Result;
            var materializerFields = new Dictionary <string, object>();

            materializerFields.Add("firstName", new SimpleFiled
            {
                simple = new SimpleItem
                {
                    field_name = "firstName",
                    field_type = "string"
                }
            });
            materializerFields.Add("otherPersonFirstName", new ComputedFiled
            {
                computed = new Computed
                {
                    field_type  = "string",
                    computation = new Computation
                    {
                        field_value = new FieldValueComputation
                        {
                            schema_id  = 1,
                            field_path = "firstName"
                        }
                    }
                }
            });

            _schemaRegistryService.AddViewToSchema(schemaId.Id_, "test_view", materializerFields, new List <Relation>
            {
                new()
                {
                    GlobalId  = relationId.RelationId_,
                    LocalId   = 1,
                    SearchFor = new SearchFor
                    {
                        SearchFor_ = SearchFor.Types.Direction.Children
                    }
                }
            }, $"{{ \"index_name\": \"{indexName}\" }}", MaterializerBackend.ElasticSearch);
コード例 #23
0
            public int CompareTo(object obj)
            {
                Substitution b = (Substitution)obj;
                int          x = SearchFor.CompareTo(b.SearchFor);

                if (x != 0)
                {
                    return(x);
                }
                x = ReplaceWith.CompareTo(b.ReplaceWith);
                if (x != 0)
                {
                    return(x);
                }
                return(Scope.CompareTo(b.Scope));
            }
コード例 #24
0
        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = "";
            string studentworklogid = "5693dcababc42ff7503d8271";
            var    board            = new Board(studentworklogid);

            var query = SearchFor.TextInName(textBox1.Text);

            var results = new Search(query, 100, SearchModelType.Cards);
            var card    = results.Cards.ToList();

            foreach (var s in card[0].Comments)
            {
                richTextBox1.Text += string.Format("{0} \n {1} \n {2}", s, s.Date, "=============================\n");
            }
        }
コード例 #25
0
        public void Issue60_BoardPreferencesFromSearch()
        {
            var serializer = new ManateeSerializer();

            TrelloConfiguration.Serializer         = serializer;
            TrelloConfiguration.Deserializer       = serializer;
            TrelloConfiguration.JsonFactory        = new ManateeFactory();
            TrelloConfiguration.RestClientProvider = new WebApiClientProvider();
            TrelloAuthorization.Default.AppKey     = TrelloIds.AppKey;
            TrelloAuthorization.Default.UserToken  = TrelloIds.UserToken;
            TrelloConfiguration.ExpiryTime         = TimeSpan.FromSeconds(1);

            var search = new Search(SearchFor.TextInName("Sandbox"), 1, SearchModelType.Boards);
            var board  = search.Boards.FirstOrDefault();

            Assert.IsNotNull(board.Preferences.Background.Color);
        }
コード例 #26
0
 private int GetSearchHash()
 {
     unchecked
     {
         int hashCode = 13;
         hashCode = (hashCode * 397) ^ SampleText?.GetHashCode() ?? 5;
         hashCode = (hashCode * 397) ^ SearchFor?.GetHashCode() ?? 5;
         hashCode = (hashCode * 397) ^ TypeOfSearch.GetHashCode();
         hashCode = (hashCode * 397) ^ CaseSensitive.GetHashCode();
         hashCode = (hashCode * 397) ^ WholeWord.GetHashCode();
         hashCode = (hashCode * 397) ^ Multiline.GetHashCode();
         hashCode = (hashCode * 397) ^ Singleline.GetHashCode();
         hashCode = (hashCode * 397) ^ BooleanOperators.GetHashCode();
         hashCode = (hashCode * 397) ^ HighlightCaptureGroups.GetHashCode();
         return(hashCode);
     }
 }
コード例 #27
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                bool startsWithString = stringToSearch.StartsWith(searchFor,
                                                                  (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

                StartsWithString.Set(executionContext, startsWithString);
            }
            catch (Exception e)
            {
                throw new InvalidPluginExecutionException(e.Message);
            }
        }
コード例 #28
0
ファイル: MainForm.cs プロジェクト: ravel57/PCsearchMultitool
        private void ChangeSearchObjects_button_Click(object sender, EventArgs e)
        {
            switch (selectedSearchType)
            {
            case SearchFor.users:
                selectedSearchType            = SearchFor.computers;
                this.ChangeSearchObjects.Text = "Имя компьютера:";
                break;

            case SearchFor.computers:
                selectedSearchType            = SearchFor.users;
                this.ChangeSearchObjects.Text = "Имя пользователя:";
                break;
            }
            userName_comboBox.Text = String.Empty;
            LogsFoldersSearchResalts.updateSearchResalts();
            parsedEntitiesNames_listBox.DataSource = null;
            userName_comboBox.Focus();
        }
コード例 #29
0
        public void Issue30_PartialSearch_False()
        {
            var serializer = new ManateeSerializer();

            TrelloConfiguration.Serializer         = serializer;
            TrelloConfiguration.Deserializer       = serializer;
            TrelloConfiguration.JsonFactory        = new ManateeFactory();
            TrelloConfiguration.RestClientProvider = new WebApiClientProvider();

            TrelloAuthorization.Default.AppKey    = TrelloIds.AppKey;
            TrelloAuthorization.Default.UserToken = TrelloIds.UserToken;

            var board      = new Board(TrelloIds.BoardId);
            var searchText = "car";
            var search     = new Search(SearchFor.Text(searchText), modelTypes: SearchModelType.Cards, context: new[] { board });

            Assert.AreEqual(0, search.Cards.Count());

            TrelloProcessor.Flush();
        }
コード例 #30
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracer = executionContext.GetExtension <ITracingService>();

            try
            {
                string stringToSearch = StringToSearch.Get(executionContext);
                string searchFor      = SearchFor.Get(executionContext);
                bool   caseSensitive  = CaseSensitive.Get(executionContext);

                bool endsWithString = stringToSearch.EndsWith(searchFor,
                                                              (caseSensitive) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);

                EndsWithString.Set(executionContext, endsWithString);
            }
            catch (Exception ex)
            {
                tracer.Trace("Exception: {0}", ex.ToString());
            }
        }
コード例 #31
0
ファイル: Parser.cs プロジェクト: mahdiz/mpclib
        private int FindCorrectIndex(string line, SearchFor searchFor)
        {
            int index = searchFor == SearchFor.AddMin ?
                GetIndexOfMinusOrPlus(line, 1) :
                searchFor == SearchFor.DivMul ?
                    getIndexOfDivOrMul(line, 1) :
                        searchFor == SearchFor.Equal ?
                            line.IndexOf("==") : line.IndexOf("?");

            int parIndex = line.IndexOf("(");
            if (index == -1 || parIndex == -1 || index < parIndex)
                return index;

            int parEndIndex = parIndex + FindEndingParantheses(line.Substring(parIndex));
            int correctIndex = FindCorrectIndex(line.Substring(parEndIndex), searchFor);
            return correctIndex != -1 ? parEndIndex + correctIndex : -1;
        }