本文整理汇总了C#中SearchType类的典型用法代码示例。如果您正苦于以下问题:C# SearchType类的具体用法?C# SearchType怎么用?C# SearchType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchType类属于命名空间,在下文中一共展示了SearchType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Search
public List<GrepSearchResult> Search(string file, string searchPattern, SearchType searchType, GrepSearchOption searchOptions, Encoding encoding)
{
using (FileStream fileStream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
return Search(fileStream, file, searchPattern, searchType, searchOptions, encoding);
}
}
开发者ID:shu2333,项目名称:dnGrep,代码行数:7,代码来源:GrepEnginePlainText.cs
示例2: Click
//Attempts to click the element on the page, with specific and default exception handling
public void Click(SearchType type, string text){
try{
if (type == SearchType.Id){
WebDriver.FindElement(By.Id(text)).Click();
}
else if (type == SearchType.LinkText){
WebDriver.FindElement(By.LinkText(text)).Click();
}
else if (type == SearchType.Name){
WebDriver.FindElement(By.Name(text)).Click();
}
else if (type == SearchType.Xpath){
WebDriver.FindElement(By.XPath(text)).Click();
}
else{
System.Console.WriteLine(type.ToString() + " is an unsupported SearchType for this method.");
}
}
catch (NoSuchElementException ex){
System.Console.WriteLine("Error, could not find webElement of type " + type.ToString() + " with id {0}", text);
System.Console.WriteLine(ex.ToString());
return;
}
catch (Exception ex){
System.Console.WriteLine("Unspecified exception in Click().");
System.Console.WriteLine(ex.ToString());
return;
}
}
开发者ID:michaelmccracken,项目名称:c_sharp_bluesource,代码行数:30,代码来源:BaseWebPage.cs
示例3: TextEntry
//Attempts to enter the given text string in a specific element on the page, with specific and default exception handling
public void TextEntry(SearchType type, string searchText, string input)
{
try{
IWebElement textField;
if (type == SearchType.Id){
textField = WebDriver.FindElement(By.Id(searchText));
}
else if (type == SearchType.LinkText){
textField = WebDriver.FindElement(By.LinkText(searchText));
}
else if (type == SearchType.Name){
textField = WebDriver.FindElement(By.Name(searchText));
}
else if (type == SearchType.Xpath){
textField = WebDriver.FindElement(By.XPath(searchText));
}
else{
textField = null;
System.Console.WriteLine(type.ToString() + " is an unsupported SearchType for this method.");
}
textField.Clear();
textField.SendKeys(input);
System.Console.WriteLine("Text '{0}' entered successfully in '{1}'", input, searchText);
}
catch (NoSuchElementException ex){
System.Console.WriteLine("Could not successfully enter text '{0}' in '{1}'", input, searchText);
System.Console.WriteLine(ex.ToString());
return;
}
catch (Exception ex){
System.Console.WriteLine("Unspecified exception in TextEntry().");
System.Console.WriteLine(ex.ToString());
return;
}
}
开发者ID:michaelmccracken,项目名称:c_sharp_bluesource,代码行数:36,代码来源:BaseWebPage.cs
示例4: OpenSearchStreams
/// <summary>動画を検索するストリームを取得する</summary>
/// <param name="Keyword">検索キーワード</param>
/// <param name="SearchPage">検索ページの指定、1~nの間の数値を指定する</param>
/// <param name="SearchType">検索方法を指定する</param>
/// <param name="SearchOption">検索オプションを指定する</param>
public Streams<Video.VideoInfoResponse> OpenSearchStreams(
string Keyword,
int SearchPage,
SearchType SearchType,
SearchOption SearchOption)
{
var serialize = new DataContractJsonSerializer(typeof(Serial.Search.Contract));
var streamDataList = new List<StreamData>();
Video.VideoInfoResponse lastData = null;
streamDataList.Add(
new StreamData()
{
StreamType = StreamType.Read,
GetStream = () =>
{
return context.Client.OpenDownloadStream(
String.Format(
ApiUrls.VideoSearch,
SearchType.ToKey(),
Keyword,
SearchPage,
SearchOption.ToKey()));
},
SetReadData = (data) =>
{
lastData = converter.ConvertVideoInfoResponse(
(Serial.Search.Contract)serialize.ReadObject(new MemoryStream(data)));
}
});
return new Streams<Video.VideoInfoResponse>(
streamDataList.ToArray(),
() => lastData);
}
开发者ID:cocop,项目名称:NicoServiceAPI,代码行数:40,代码来源:VideoService.cs
示例5: SearchForm
/// <summary>
/// Creates a new form used to get input for a search
/// </summary>
/// <param name="type">The type of search</param>
public SearchForm( SearchType type )
{
InitializeComponent();
Pandora.Localization.LocalizeControl( this );
if ( type != SearchType.Deco )
{
rID.Visible = false;
rName.Visible = false;
}
switch ( type )
{
case SearchType.Deco:
case SearchType.Item:
Text = "Find Item";
break;
case SearchType.Location:
Text = Pandora.Localization.TextProvider[ "Misc.FindLoc" ];
break;
case SearchType.Mobile:
Text = Pandora.Localization.TextProvider[ "Misc.FindMob" ];
break;
}
}
开发者ID:aj9251,项目名称:pandorasbox3,代码行数:35,代码来源:SearchForm.cs
示例6: SelectPersonBySearchText
/// <summary>
/// Selects the person by search text.
/// </summary>
/// <param name="personsParty">The persons party.</param>
/// <param name="searchText">The search text.</param>
/// <param name="searchType">Type of the search.</param>
/// <param name="visitorSearchType">Type of the visitor search.</param>
/// <returns>Instance of PersonsParty</returns>
internal static PersonsParty SelectPersonBySearchText(PersonsParty personsParty, string searchText, SearchType searchType, VisitorSearchType visitorSearchType)
{
if (visitorSearchType != VisitorSearchType.None)
{
AssignSelectedPerson(personsParty, personsParty.RetrievePersons().FirstOrDefault(), null);
}
else if (searchType == SearchType.LastName)
{
AssignSelectedPerson(personsParty, RetrievePersonByName(personsParty.RetrievePersons(), searchText).FirstOrDefault(), null);
}
else if (searchType == SearchType.Stateroom)
{
AssignSelectedPerson(personsParty, personsParty.RetrievePersons().FirstOrDefault(), null);
}
else if (searchType == SearchType.Reservation)
{
AssignSelectedPerson(personsParty, RetrievePersonByReservationNumber(personsParty.RetrievePersons(), searchText).FirstOrDefault(), null);
}
else if (searchType == SearchType.PassportNumber)
{
AssignSelectedPerson(personsParty, personsParty.RetrievePersons().FirstOrDefault(), null);
}
else if (searchType == SearchType.EmployeeNumber)
{
AssignSelectedPerson(personsParty, personsParty.RetrievePersons().FirstOrDefault(), null);
}
else if (searchType == SearchType.BarcodeScanning || searchType == SearchType.MagneticStripe || searchType == SearchType.RFID)
{
AssignSelectedPerson(personsParty, personsParty.RetrievePersons().FirstOrDefault(), null);
}
return personsParty;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:41,代码来源:PersonSelectionService.cs
示例7: Search
/// <summary>
/// Performs a breadth-first-search on the TreeView's nodes in search of the passed value. The matching conditions are based on the passed search type parameter.
/// </summary>
/// <param name="value">Value to search for in the TreeView. Matching on this value is based on the search type.</param>
/// <param name="searchType">Determines the matching of the value. For example, full/partial text search or full path search.</param>
/// <returns>A collection of nodes who match the conditions based on the search type.</returns>
public IReadOnlyCollection<TreeNode> Search(string value, bool isCaseSensitive, SearchType searchType)
{
IReadOnlyCollection<TreeNode> results = new List<TreeNode>().AsReadOnly();
// if the user is not choosing case sensitive, then lower everything so we clear out any case
if(!isCaseSensitive) { value = value.ToLower(); }
if(searchType == SearchType.FileNameExactMatch)
{
results = this.Nodes.Find(value, true).ToList();
}
else if(searchType == SearchType.FileNamePartialMatch)
{
Func<TreeNode, string, bool> matchFunction = (node, searchText) =>
{
return node.Text.ToLower().Contains(searchText);
};
results = Search(value, matchFunction);
}
else if(searchType == SearchType.FullPath)
{
Func<TreeNode, string, bool> matchFunction = (node, searchText) =>
{
return node.FullPath.ToLower().Contains(searchText);
};
results = Search(value, matchFunction);
}
return results;
}
开发者ID:githubron726,项目名称:ValveResourceFormat,代码行数:36,代码来源:BetterTreeView.cs
示例8: addCriteria
public FormitizeCMSWhere addCriteria(string key, object value, SearchType searchType = SearchType.Equals)
{
string search = "equal";
switch(searchType)
{
case SearchType.Equals:
search = "equal";
break;
case SearchType.Contains:
search = "contain";
break;
case SearchType.NotEquals:
search = "notequal";
break;
}
Dictionary<string, object> newVal = new Dictionary<string, object>();
newVal["value"] = value;
newVal["search"] = search;
values[key] = newVal;
return this;
}
开发者ID:MITechnologies,项目名称:Formitize-NET-API,代码行数:25,代码来源:CMSWhere.cs
示例9: Replace
public bool Replace(Stream readStream, Stream writeStream, string searchPattern, string replacePattern, SearchType searchType, GrepSearchOption searchOptions, Encoding encoding)
{
SearchDelegates.DoReplace replaceMethod = doTextReplaceCaseSensitive;
switch (searchType)
{
case SearchType.PlainText:
if ((searchOptions & GrepSearchOption.CaseSensitive) == GrepSearchOption.CaseSensitive)
{
replaceMethod = doTextReplaceCaseSensitive;
}
else
{
replaceMethod = doTextReplaceCaseInsensitive;
}
break;
case SearchType.Regex:
replaceMethod = doRegexReplace;
break;
case SearchType.XPath:
replaceMethod = doXPathReplace;
break;
case SearchType.Soundex:
replaceMethod = doFuzzyReplace;
break;
}
if ((searchOptions & GrepSearchOption.Multiline) == GrepSearchOption.Multiline)
return replaceMultiline(readStream, writeStream, searchPattern, replacePattern, searchOptions, replaceMethod, encoding);
else
return replace(readStream, writeStream, searchPattern, replacePattern, searchOptions, replaceMethod, encoding);
}
开发者ID:shu2333,项目名称:dnGrep,代码行数:31,代码来源:GrepEnginePlainText.cs
示例10: Search
/// <summary>動画を検索する</summary>
/// <param name="Keyword">検索キーワード</param>
/// <param name="SearchPage">検索ページの指定、1~nの間の数値を指定する</param>
/// <param name="SearchType">検索方法を指定する</param>
/// <param name="SearchOption">検索オプションを指定する、Filterメンバは無効</param>
public Session<Response<VideoInfo[]>> Search(
string Keyword,
int SearchPage,
SearchType SearchType,
SearchOption SearchOption)
{
var session = new Session<Response<VideoInfo[]>>();
session.SetAccessers(new Func<byte[], APIs.IAccesser>[]
{
(data) =>
{
var accesser = new APIs.search.Accesser();
accesser.Setting(
context.CookieContainer,
SearchType.ToKey(),
Keyword,
SearchPage.ToString(),
SearchOption.SortOrder.ToKey(),
SearchOption.SortTarget.ToKey());
return accesser;
}
},
(data) =>
Converter.VideoInfoResponse(context, new APIs.search.Parser().Parse(data)));
return session;
}
开发者ID:cocop,项目名称:UNicoAPI2,代码行数:34,代码来源:VideoServicePage.cs
示例11: LaunchSearch
public static void LaunchSearch(string searchTerm, SearchType searchType)
{
if (!string.IsNullOrEmpty(searchTerm))
{
searchTerm = searchTerm.Replace(' ', '+');
string str = string.Empty;
switch (searchType)
{
case SearchType.GOOGLE:
str = "http://www.google.com/search?q={0}";
break;
case SearchType.LINKEDIN:
str = "http://www.linkedin.com/search?pplSearchOrigin=GLHD&keywords={0}&search=";
break;
case SearchType.FACEBOOK:
str = "http://www.facebook.com/srch.php?nm={0}";
break;
case SearchType.TWITTER:
str = "http://twitter.com/search/users?q={0}&category=people&source=users";
break;
}
if (!string.IsNullOrEmpty(str))
{
LaunchUrl(Uri.EscapeUriString(string.Format(CultureInfo.InvariantCulture, str, new object[] { searchTerm })));
}
}
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:30,代码来源:WebUtilities.cs
示例12: Search
internal Search(SearchType searchMethod)
{
IsDone = false;
NextKey = null;
Matches = new List<Document>();
SearchMethod = searchMethod;
}
开发者ID:skilitics,项目名称:aws-sdk-net,代码行数:7,代码来源:Search.cs
示例13: Explore
private static void Explore(CASCFolder folder, string findFile, SearchType type, List<CASCFile> found)
{
foreach (KeyValuePair<string, ICASCEntry> node in folder.Entries)
{
ICASCEntry entry = node.Value;
if (entry is CASCFolder)
{
Explore((CASCFolder)entry, findFile, type, found);
}
else if (entry is CASCFile)
{
CASCFile file = (CASCFile)entry;
string fileName = file.FullName.ToLower();
if (type == SearchType.COMPLETE && fileName.Equals(fileName))
{
found.Add(file);
break;
}
if (type == SearchType.STARTS_WITH && fileName.StartsWith(findFile))
{
found.Add(file);
continue;
}
if (type == SearchType.ENDS_WITH && fileName.EndsWith(findFile))
{
found.Add(file);
continue;
}
}
}
}
开发者ID:Kruithne,项目名称:W3DT,代码行数:35,代码来源:CASCSearch.cs
示例14: SearchTypeVM
public SearchTypeVM(SearchType searchType, string name, string toolTip, ImageReference imageReference, VisibleMembersFlags flags) {
SearchType = searchType;
Name = name;
ToolTip = toolTip;
Image = imageReference;
Flags = flags;
}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:SearchTypeVM.cs
示例15: SearchCriteria
public SearchCriteria(string search)
{
if (string.IsNullOrEmpty(search))
{
throw new ArgumentNullException("search");
}
SearchType = SearchType.Unknown;
if (StringHelper.IndexOfIgnoreCase(search, "upnp:class") != -1 &&
StringHelper.IndexOfIgnoreCase(search, "derivedfrom") != -1)
{
if (StringHelper.IndexOfIgnoreCase(search, "object.item.audioItem") != -1)
{
SearchType = SearchType.Audio;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.item.imageItem") != -1)
{
SearchType = SearchType.Image;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.item.videoItem") != -1)
{
SearchType = SearchType.Video;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.container.playlistContainer") != -1)
{
SearchType = SearchType.Playlist;
}
}
}
开发者ID:jmarsh0507,项目名称:MediaBrowser,代码行数:30,代码来源:SearchCriteria.cs
示例16: SearchCriteria
public SearchCriteria(string search)
{
if (string.IsNullOrEmpty(search))
{
throw new ArgumentNullException("search");
}
SearchType = SearchType.Unknown;
if (search.IndexOf("upnp:class", StringComparison.OrdinalIgnoreCase) != -1 &&
search.IndexOf("derivedfrom", StringComparison.OrdinalIgnoreCase) != -1)
{
if (search.IndexOf("object.item.audioItem", StringComparison.OrdinalIgnoreCase) != -1)
{
SearchType = SearchType.Audio;
}
else if (search.IndexOf("object.item.imageItem", StringComparison.OrdinalIgnoreCase) != -1)
{
SearchType = SearchType.Image;
}
else if (search.IndexOf("object.item.videoItem", StringComparison.OrdinalIgnoreCase) != -1)
{
SearchType = SearchType.Video;
}
else if (search.IndexOf("object.container.playlistContainer", StringComparison.OrdinalIgnoreCase) != -1)
{
SearchType = SearchType.Playlist;
}
}
}
开发者ID:Nickolin,项目名称:MediaBrowser,代码行数:30,代码来源:SearchCriteria.cs
示例17: drawMainLeftElem
//--------------------------------------------------------------------------------------------------
// メインウィンドウ左側描画領域.
// 検索条件などを指定する領域.
private void drawMainLeftElem()
{
EditorGUILayout.BeginVertical( GUI.skin.box, GUILayout.Width( MAIN_LEFT_ELEM_WIDTH ) );
this.searchType = ( SearchType )EditorGUILayout.EnumPopup( "検索タイプ", this.searchType );
this.searchScope = ( SearchScope )EditorGUILayout.EnumPopup( "検索範囲", this.searchScope );
this.wholeWord = EditorGUILayout.Toggle( "完全一致か否か.", this.wholeWord );
if ( !this.wholeWord )
this.caseSencitive = EditorGUILayout.Toggle( "大小文字一致比較.", this.caseSencitive );
switch ( this.searchType ){
case SearchType.Name: EditorGUILayout.LabelField( "Input ObjectName" ); break;
case SearchType.Component: EditorGUILayout.LabelField( "Input ComponentName" ); break;
default: break;
}
this.searchText = EditorGUILayout.TextField( this.searchText, GUI.skin.textField );
if ( GUILayout.Button( "Search" ) ){
Debug.Log( "捜索します." );
this.search();
}
MyEditorLayout.space( 3 );
MyEditorLayout.separatorLine( MAIN_LEFT_ELEM_WIDTH );
this.dumpFoldout = EditorGUILayout.Foldout( this.dumpFoldout, "Show Dump Palameter" );
if ( this.dumpFoldout )
this.drawDumpPalameter();
EditorGUILayout.EndVertical();
}
开发者ID:RyuusukeMatsumoto,项目名称:Unity_ObjectFinder,代码行数:33,代码来源:ObjectFinder.cs
示例18: NativeSearch
public NativeSearch(
ISession session,
string query,
int trackOffset,
int trackCount,
int albumOffset,
int albumCount,
int artistOffset,
int artistCount,
int playlistOffset,
int playlistCount,
SearchType searchType,
object userData)
: base(session, IntPtr.Zero)
{
_query = query;
_trackOffset = trackOffset;
_trackCount = trackCount;
_albumOffset = albumOffset;
_albumCount = albumCount;
_artistOffset = artistOffset;
_artistCount = artistCount;
_playlistOffset = playlistOffset;
_playlistCount = playlistCount;
_searchType = searchType;
_userData = userData;
}
开发者ID:Dkrinker,项目名称:torshify,代码行数:27,代码来源:NativeSearch.cs
示例19: SearchOptions
public SearchOptions(SearchType type, string query, bool newTab, bool caseSensitive, bool useRegex)
{
this.Type = type;
this.Query = query;
this.NewTab = newTab;
this.CaseSensitive = caseSensitive;
this.UseRegex = useRegex;
}
开发者ID:egcube,项目名称:OpenTween,代码行数:8,代码来源:SearchWordDialog.cs
示例20: prepareSimilarity
public void prepareSimilarity (string query, string options, float min, float max)
{
int res = BingoCore.lib.mangoSetupMatch("SIM", query, options);
if (res < 0)
throw new Exception(BingoCore.lib.bingoGetError());
BingoCore.lib.mangoSimilaritySetMinMaxBounds(min, max);
search_type = SearchType.SIM;
}
开发者ID:harcharansidhu,项目名称:indigo,代码行数:8,代码来源:MangoFastIndexFetch.cs
注:本文中的SearchType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论