本文整理汇总了C#中SearchParameters类的典型用法代码示例。如果您正苦于以下问题:C# SearchParameters类的具体用法?C# SearchParameters怎么用?C# SearchParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchParameters类属于命名空间,在下文中一共展示了SearchParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
_appTask = AppTask.GetTaskInOnCreate(bundle, Intent);
SetContentView(Resource.Layout.search);
SearchParameters sp = new SearchParameters();
PopulateCheckBox(Resource.Id.cbSearchInTitle, sp.SearchInTitles);
PopulateCheckBox(Resource.Id.cbSearchInUsername, sp.SearchInUserNames);
PopulateCheckBox(Resource.Id.cbSearchInNotes, sp.SearchInNotes);
PopulateCheckBox(Resource.Id.cbSearchInPassword, sp.SearchInPasswords);
PopulateCheckBox(Resource.Id.cbSearchInTags, sp.SearchInTags);
PopulateCheckBox(Resource.Id.cbSearchInGroupName, sp.SearchInGroupNames);
PopulateCheckBox(Resource.Id.cbSearchInUrl, sp.SearchInUrls);
PopulateCheckBox(Resource.Id.cbSearchInOtherStrings, sp.SearchInOther);
PopulateCheckBox(Resource.Id.cbRegEx, sp.RegularExpression);
StringComparison sc = sp.ComparisonMode;
bool caseSensitive = ((sc != StringComparison.CurrentCultureIgnoreCase) &&
(sc != StringComparison.InvariantCultureIgnoreCase) &&
(sc != StringComparison.OrdinalIgnoreCase));
PopulateCheckBox(Resource.Id.cbCaseSensitive, caseSensitive);
PopulateCheckBox(Resource.Id.cbExcludeExpiredEntries, sp.ExcludeExpired);
ImageButton btnSearch = (ImageButton)FindViewById(Resource.Id.search_button);
btnSearch.Click += (sender, e) => PerformSearch();
FindViewById<EditText>(Resource.Id.searchEditText).EditorAction += (sender, e) =>
{
if (e.ActionId == Android.Views.InputMethods.ImeAction.Search) {
PerformSearch();
}
};
}
示例2: Search
public Search(SearchParameters p, Player searchingPlayer, SearchResults searchResults, Game game)
{
_p = p;
_searchResults = searchResults;
_game = game;
_root = new InnerResult(_game.CalculateHash(), searchingPlayer.IsMax, 0);
}
示例3: GetTransformation
internal static string GetTransformation(SearchParameters spIn)
{
if(spIn == null) { Debug.Assert(false); return string.Empty; }
if(spIn.DataTransformationFn == null) return string.Empty;
return StrTrfDeref;
}
示例4: Constructor_Full_NullDocumentTypeTags
public void Constructor_Full_NullDocumentTypeTags()
{
SearchParameters par = new SearchParameters("query", null, SearchOptions.AllWords);
Assert.AreEqual("query", par.Query, "Wrong query");
Assert.IsNull(par.DocumentTypeTags, "DocumentTypeTags should be null");
Assert.AreEqual(SearchOptions.AllWords, par.Options);
}
示例5: BindModel
/// <summary>
/// Binds the model to a value by using the specified controller context and binding context.
/// </summary>
/// <param name="controllerContext">The controller context.</param>
/// <param name="bindingContext">The binding context.</param>
/// <returns>The bound value.</returns>
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var parameters = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
var sp = parameters != null ? parameters.RawValue as SearchParameters : null;
if (sp == null)
{
var qs = GetParams(controllerContext);
var qsDict = NvToDict(qs);
var facets = qsDict.Where(k => FacetRegex.IsMatch(k.Key)).Select(k => k.WithKey(FacetRegex.Replace(k.Key, ""))).ToDictionary(x=>x.Key, y=>y.Value.Split(','));
sp = new SearchParameters
{
FreeSearch = qs["q"].EmptyToNull(),
PageIndex = qs["p"].TryParse(1),
PageSize = qs["pageSize"].TryParse(0),
Sort = qs["sort"].EmptyToNull(),
SortOrder = qs["sortorder"].EmptyToNull(),
Facets = facets
};
if (!string.IsNullOrEmpty(sp.FreeSearch))
{
sp.FreeSearch = sp.FreeSearch.EscapeSearchTerm();
}
}
return sp;
}
示例6: InitializeMap
/// <summary>
/// Creates a clear map with a start and end point and sets up the search parameters
/// </summary>
private void InitializeMap(int[,] iMap, Point S, Point F)
{
this.map = IntToBool(iMap);
//var tmp = BoolToString(map);
//var tmp1 = ParseIntArrayToString(iMap);
this.sp = new SearchParameters(S, F, map);
}
示例7: LoadWebMap_Loaded
// Loads UI elements and an initial webmap
private async void LoadWebMap_Loaded(object sender, RoutedEventArgs e)
{
_portal = await ArcGISPortal.CreateAsync();
var searchParams = new SearchParameters("type: \"web map\" NOT \"web mapping application\"");
var result = await _portal.ArcGISPortalInfo.SearchHomePageFeaturedContentAsync(searchParams);
comboWebMap.ItemsSource = result.Results;
}
示例8: SearchRunner
public SearchRunner(SearchParameters searchParameters, Game game)
{
_game = game;
_searchParameters = searchParameters;
CurrentDepth = _searchParameters.SearchDepth;
CurrentTargetCount = _searchParameters.TargetCount;
}
示例9: PathFinder
/// <summary>
/// Create a new instance of PathFinder
/// </summary>
/// <param name="searchParameters"></param>
public PathFinder(SearchParameters searchParameters)
{
this.searchParameters = searchParameters;
InitializeNodes(searchParameters.Map);
this.startNode = this.nodes[searchParameters.StartLocation.X, searchParameters.StartLocation.Y];
this.startNode.State = NodeState.Open;
this.endNode = this.nodes[searchParameters.EndLocation.X, searchParameters.EndLocation.Y];
}
示例10: RegisterSearchChannel
public void RegisterSearchChannel(SearchContext searchContext)
{
this._searchService.GetSearchParameters(CLAIMS_SEARCH_SP_NAME, parameters =>
{
this._searchParameters = parameters;
searchContext.RegisterSearchChannel(this.GetChannel(this._searchTypeName));
});
}
示例11: Search
public SearchResults Search(SearchParameters parameters)
{
if (string.IsNullOrEmpty(parameters.Query) && string.IsNullOrEmpty(parameters.Title) && string.IsNullOrEmpty(parameters.Skills))
{
throw new ArgumentException("At least one of the Query, Title, or Skills parameters must be specified.");
}
return restTemplate.GetForObject<SearchResults>(searchBaseUri + parameters.ToString());
}
示例12: Test_Selected_Filters_To_Search_Parameter
public void Test_Selected_Filters_To_Search_Parameter()
{
var query = Conditions.From("MAYY380WWPGYY1", urlOfuscator);
var selectedFiltersContext = new QueryUrlParser(facetConfiguration.FacetHierarchy, urlOfuscator).Parse(query).GetSelectedFilters();
var searchParameter = new SearchParameters<Publication>(string.Empty, selectedFiltersContext,
facetConfiguration.FacetHierarchy.ByName(selectedFiltersContext.SelectedFilters.Last().Name),
facetConfiguration.FacetHierarchy.FacetsNotInBranchOf((selectedFiltersContext.SelectedFilters.Last().Name)));
var result = indexServiceImpl.Query(searchParameter);
}
示例13: Constructor_QueryDocumentTypeTags
public void Constructor_QueryDocumentTypeTags()
{
SearchParameters par = new SearchParameters("query", "blah", "doc");
Assert.AreEqual("query", par.Query, "Wrong query");
Assert.AreEqual(2, par.DocumentTypeTags.Length, "Wrong DocumentTypeTag count");
Assert.AreEqual("blah", par.DocumentTypeTags[0], "Wrong type tag");
Assert.AreEqual("doc", par.DocumentTypeTags[1], "Wrong type tag");
Assert.AreEqual(SearchOptions.AtLeastOneWord, par.Options);
}
示例14: Constructor_Full
public void Constructor_Full()
{
SearchParameters par = new SearchParameters("query", new string[] { "blah", "doc" }, SearchOptions.AllWords);
Assert.AreEqual("query", par.Query, "Wrong query");
Assert.AreEqual(2, par.DocumentTypeTags.Length, "Wrong DocumentTypeTag count");
Assert.AreEqual("blah", par.DocumentTypeTags[0], "Wrong type tag");
Assert.AreEqual("doc", par.DocumentTypeTags[1], "Wrong type tag");
Assert.AreEqual(SearchOptions.AllWords, par.Options);
}
示例15: SetTransformation
internal static void SetTransformation(SearchParameters spOut,
string strTrf)
{
if(spOut == null) { Debug.Assert(false); return; }
if(strTrf == null) { Debug.Assert(false); return; }
if(strTrf == StrTrfDeref)
spOut.DataTransformationFn = SprEngine.DerefFn;
else spOut.DataTransformationFn = null;
}