本文整理汇总了C#中Search类的典型用法代码示例。如果您正苦于以下问题:C# Search类的具体用法?C# Search怎么用?C# Search使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Search类属于命名空间,在下文中一共展示了Search类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IdenticaClient
public IdenticaClient(string username, string password)
{
Statuses = new Statuses(this);
Account = new Account(this);
DirectMessages = new DirectMessages(this);
Favourites = new Favourites(this);
Block = new Block(this);
Friendships = new Friendship(this);
Lists = new List(this);
Search = new Search(this);
Users = new Users(this);
FriendsAndFollowers = new FriendsAndFollowers(this);
Credentials = new BasicAuthCredentials
{
Username = username,
Password = password
};
Client = new RestClient
{
Authority = "http://identi.ca/api",
};
Authority = "http://identi.ca/api";
Encode = false;
}
示例2: Main
static void Main(string[] args)
{
var mySearch = new Search();
List<string> myList= new List<string>();
myList=mySearch.SplitString("din mor er en mand");
foreach (string s in myList)
{
Console.WriteLine(s);
}
var component1 = new Component();
component1._name = "myComponent";
var component2 = new Component();
component2._name = "myComponent";
var myComponentsList=new List<Component>();
myComponentsList.Add(component1);
myComponentsList.Add(component2);
var myComponents = new Components(myComponentsList);
Console.WriteLine(myComponents.GetAvaiableQuantity("myComponent"));
}
示例3: VM
/// <summary>
/// base constructor
/// </summary>
/// <param name="v"></param>
public VM(MainPage v)
{
view = v;
byPoint = true;
_searchObj = new Search();
_rad = view._changedRadius;
}
示例4: OnboardingViewModel
public OnboardingViewModel(
CommuterApplication application,
Search.SearchService search)
{
_application = application;
_search = search;
}
示例5: LoadData
/// <summary>
///
/// </summary>
/// <param name="reload">是否是重新加载</param>
/// <returns></returns>
private async Task LoadData(bool reload = false) {
this.IsBusy = true;
var method = new Search() {
Page = reload ? 1 : this.Page
};
var datas = await ApiClient.Execute(method);
if (!method.HasError && datas.Count() > 0) {
if (reload) {
this.Datas.Clear();
}
if (Device.OS == TargetPlatform.Windows) {
foreach (var d in datas) {
this.Datas.Add(new SearchedItemViewModel(d, this.NS));
}
} else
this.Datas.AddRange(datas.Select(d =>
new SearchedItemViewModel(d, this.NS)
));
//this.NotifyOfPropertyChange(() => this.Datas);
this.Page++;
}
this.IsBusy = false;
}
示例6: Index
public ActionResult Index(Search<Product> search)
{
if (!ModelState.IsValid)
return View (search);
var qry = from x in Product.Queryable
orderby x.Name
select x;
if (!string.IsNullOrEmpty (search.Pattern)) {
qry = from x in Product.Queryable
where x.Name.Contains (search.Pattern) ||
x.Code.Contains (search.Pattern) ||
x.Model.Contains (search.Pattern) ||
x.SKU.Contains (search.Pattern) ||
x.Brand.Contains (search.Pattern)
orderby x.Name
select x;
}
search.Total = qry.Count ();
search.Results = qry.Skip (search.Offset).Take (search.Limit).ToList ();
ViewBag.PriceLists = PriceList.Queryable.ToList ();
return PartialView ("_Index", search);
}
示例7: SearchAgent
public SearchAgent(Problem p, Search search)
{
actionList = search.search(p);
actionIterator = actionList.GetEnumerator();
searchMetrics = search.getMetrics();
}
示例8: InvalidCollectionReturnsError
public void InvalidCollectionReturnsError()
{
//try
//{
// ClearContainer();
// var container = Startup.Container;
// container.Register<IEndPointConfiguration>(c => new TestEndPointConfiguration());
// ServiceLocator.SetLocatorProvider(() => container);
//}
//catch (Exception)
//{
// // Ignore
//}
try
{
var s = new Search<TestDocument>(new Settings("a-collection-that-does-not-exist"));
var results = s.Execute("crownpeak");
Assert.IsTrue(results.Count == 10, "Expected 10 results, got " + results.Count);
}
catch (Exception ex)
{
throw ex;
}
finally
{
// Restore the state
SetupSearch();
}
}
示例9: Next
void Next()
{
if(myLastSearch.mySearchee)
{
myPreviousBeings.Add(myLastSearch);
}
--mySearcheesToGo;
myState = ConveyorBeltStates.Moving;
myLastSearch = myCurrentSearch;
if(mySearcheesToGo == 0)
{
if(myState != ConveyorBeltStates.Done)
{
AssessSession(false);
}
}
else
{
myCurrentSearch = new Search();
myCurrentSearch.mySearchee = Helper.GetNewBeing();
myCurrentSearch.mySearchee.transform.position = new Vector3(15, 0, 0);
myState = ConveyorBeltStates.Moving;
}
}
示例10: MapAgent
public MapAgent(Map map, EnvironmentViewNotifier notifier, Search search,
int maxGoalsToFormulate) : base ( maxGoalsToFormulate) {
this.map = map;
this.notifier = notifier;
this._search = search;
}
示例11: Start
// Use this for initialization
void Start () {
int[,] map = new int[5, 5]{
{0,1,0,0,0},
{0,1,0,0,0},
{0,1,0,0,0},
{0,1,0,0,0},
{0,0,0,0,0}
};
var graph = new Graph(map);
Search search = new Search(graph);
search.Start (graph.nodes[0], graph.nodes[8]);
while(!search.finished)
{
search.Step();
}
print ("Search done. Path length " + search.path.Count+ " iteration " + search.iterations);
ResetMapGroup (graph);
foreach (var node in search.path) {
GetImage(node.label).color = Color.red;
}
}
示例12: SetUp
public void SetUp()
{
twitterClient = Substitute.For<IBaseTwitterClient>();
searchClient = Substitute.For<IRestClient>();
search = new Search(twitterClient, s => searchClient);
}
示例13: Campaign
public void Campaign()
{
var criteria = new[]
{
new CampaignSearchCriteria
{
InternalName = CampaignSearchCriteria.DonatedToCampaign,
SearchOperator = SearchOperator.StartsWith,
Type = SearchFieldType.String,
Value = "Christmas"
}
};
var expr = new Search().CompileCampaignCriteria(criteria, null);
var reference = expr.LeftOperand as ObjectReference;
Assert.IsNotNull(reference);
Assert.AreEqual("Name", reference.GetName());
Assert.AreEqual(SimpleExpressionType.Function, expr.Type);
var function = expr.RightOperand as SimpleFunction;
Assert.IsNotNull(function);
Assert.AreEqual("like", function.Name.ToLowerInvariant());
Assert.AreEqual(1, function.Args.Count);
Assert.AreEqual("Christmas%", function.Args.First());
}
示例14: ParentMenuItemFeatureCommand
public ParentMenuItemFeatureCommand(IMainWindow mainWindow, IEnumerable<SelectedItem> selection, ParentMenuItemFeature owner, Search search)
: base(mainWindow, selection)
{
Util.ThrowIfParameterNull(owner, "owner");
_owner = owner;
_search = search;
}
示例15: OrgViewSearch
private Search OrgViewSearch(Search search)
{
ObjectTypes types;
if (search == null || search.Query == null || search.Query.QueryScope == null)
{
types = IncludeFolders ? ObjectTypes.AllIncFolders : ObjectTypes.AllExcFolders;
}
else
{
types = IncludeFolders
? search.Query.QueryScope.ObjectTypes
: (search.Query.QueryScope.ObjectTypes & ~ObjectTypes.Folder);
}
QueryScope scope = new QueryScope(types);
QueryFilter filter;
if (search == null || search.Query == null || search.Query.QueryFilter == null)
filter = Query;
else if (Query == null)
filter = search.Query.QueryFilter;
else
filter = new GroupQuery(new[] { search.Query.QueryFilter, Query }, GroupQuery.GroupQueryType.And);
return new Search(new Query(scope, filter), Grouping, false, "", null, null, new Sort[] { });
}