本文整理汇总了C#中ResultType类的典型用法代码示例。如果您正苦于以下问题:C# ResultType类的具体用法?C# ResultType怎么用?C# ResultType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResultType类属于命名空间,在下文中一共展示了ResultType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetHtml
/// <summary>
/// The get html.
/// </summary>
/// <param name="id">
/// The id.
/// </param>
/// <param name="type">
/// The type.
/// </param>
public static void GetHtml(int id, ResultType type)
{
var wc = new WebClient();
var url1 = Utils.GetWebSiteUrl;
var url2 = url1;
switch (type)
{
case ResultType.Product:
url1 += "/Product/item/" + id;
url2 += "/Product/item-id-" + id + ".htm";
break;
case ResultType.Team:
url1 += "/Home/TuanItem/" + id;
url2 += "/Home/TuanItem/" + id + ".htm";
break;
case ResultType.LP:
url1 += "/LandingPage/" + id;
url2 += "/LandingPage/" + id + ".htm";
break;
case ResultType.Acticle:
url1 += "/Acticle/" + id;
url2 += "/Acticle/" + id + ".htm";
break;
case ResultType.Help:
url1 += "/Help/" + id;
url2 += "/Help/" + id + ".htm";
break;
}
wc.DownloadString(url1);
wc.DownloadString(url2);
}
开发者ID:jxzly229190,项目名称:OnlineStore,代码行数:41,代码来源:HttpRequest.cs
示例2: CommandResult
public CommandResult(string cmd, string[] args)
{
_results = new List<string>();
_command = cmd;
_args = args;
_type = ResultType.Success;
}
开发者ID:gavioto,项目名称:evimsync,代码行数:7,代码来源:CommandResult.cs
示例3: Statement
public Statement(string text, StatementType type, ResultType result, IDictionary<string, object> parameters)
{
Type = type;
Text = text;
Result = result;
Parameters = parameters ?? new Dictionary<string, object>();
}
开发者ID:mikeobrien,项目名称:Gribble,代码行数:7,代码来源:Statement.cs
示例4: Result
internal Result(long resultID, ResultType resultType, string message, long reference)
{
ResultID = resultID;
ResultType = resultType;
Message = message;
Reference = reference;
}
开发者ID:cmoussalli,项目名称:DynThings,代码行数:7,代码来源:ResultInfo.cs
示例5: TestResult
public TestResult(ResultType res, byte[] actualBytes, byte[] expectedBytes, string failureDetails = null)
{
Result = res;
ActualBytes = actualBytes;
ExpectedBytes = expectedBytes;
FailureDetails = failureDetails;
}
开发者ID:Orvid,项目名称:Orvid.Assembler,代码行数:7,代码来源:TesterBase.cs
示例6: GetResultByID
public static Result GetResultByID(long resultID, long referenceID)
{
ResultMessage msg = db.ResultMessages.Find(resultID);
string msgTxt = "";
ResultType rt = new ResultType();
if (msg.IsError == false)
{ rt = ResultType.Ok; }
else
{
if (Config.DevelopmentMode == true)
{
rt = ResultType.Failed_DevelopmentMode;
msgTxt = msg.Message;
}
else
{
rt = ResultType.Failed_ProductionMode;
}
}
Result res = new Result(resultID, rt, msgTxt, referenceID);
res = new Result(msg.ID, rt, msg.Message, 0);
return res;
}
开发者ID:cmoussalli,项目名称:DynThings,代码行数:25,代码来源:ResultInfo.cs
示例7: ExecuteResult
public ExecuteResult(object rlt, Exception err = null)
{
Exception = err;
if (rlt is IDataReader)
{
ReaderRlt = rlt as IDataReader;
Type = ResultType.DataReader;
}
else if (rlt is int)
{
IntRlt = (int)rlt;
Type = ResultType.Integer;
}
else
{
if (err == null)
{
ObjRlt = rlt;
Type = ResultType.Object;
}
else
{
Exception = err;
Type = ResultType.Error;
}
}
}
开发者ID:mind0n,项目名称:hive,代码行数:27,代码来源:ExecuteResult.cs
示例8: MemberResult
internal MemberResult(string name, ResultType type)
{
_name = name;
_type = type;
_completion = _name;
_vars = Empty;
}
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:MemberResult.cs
示例9: SearchAsync
public async Task<IEnumerable<Message>> SearchAsync(
IEnumerable<string> values,
ResultType resultType,
int count)
{
return await SearchAsync(values, resultType, count, null);
}
开发者ID:dustinmoris,项目名称:JuniorDoctorsStrike,代码行数:7,代码来源:TwitterClient.cs
示例10: Reset
public void Reset ()
{
resultType = ResultType.NotRun;
duration = 0f;
messages = "";
stacktrace = "";
isRunning = false;
}
开发者ID:eyalzur,项目名称:CodeSamplesPublic,代码行数:8,代码来源:TestResult.cs
示例11: TestResult
public TestResult ( GameObject gameObject )
{
id = Guid.NewGuid().ToString("N");
resultType = ResultType.NotRun;
this.go = gameObject;
if(gameObject!=null)
name = gameObject.name;
}
开发者ID:eyalzur,项目名称:CodeSamplesPublic,代码行数:8,代码来源:TestResult.cs
示例12: RawResult
public RawResult(RawResult[] arr)
{
if (arr == null) throw new ArgumentNullException("arr");
this.resultType = ResultType.MultiBulk;
this.offset = 0;
this.count = arr.Length;
this.arr = arr;
}
开发者ID:ninjaferret,项目名称:StackExchange.Redis,代码行数:8,代码来源:RawResult.cs
示例13: PassAction
IEnumerator PassAction (ResultType result)
{
yield return null; // No init
Debug.Log (result);
yield return result;
}
开发者ID:alfiesyukur,项目名称:PracticalAIinUnity,代码行数:8,代码来源:Example1.cs
示例14: SearchEntry
public SearchEntry(int id, string name, ResultType restype, UserType usetype)
{
ID = id;
Name = name;
ResultType = restype;
UserType = usetype;
Hit = 1;
}
开发者ID:khtutz,项目名称:anet4jkhz,代码行数:8,代码来源:SearchEntry.cs
示例15: Search
public void Search(GlobPattern pattern, GlobPath curPath, List<GlobPath> result, ResultType resultType)
{
/*
if (resultType == ResultType.Directory && pattern.IsOnLastPart)
{
//If the current directory matches the pattern, add this path to the result list
if (pattern.MatchesCompletely(curPath))
result.Add(curPath.ToString());
}*/
if (resultType == ResultType.File && pattern.IsOnLastPart)
{
//Add all matching files to the result list
foreach (var file in GetFiles(curPath))
{
if (pattern.MatchesCurrentPart(file))
result.Add(curPath.AppendPart(file));
}
}
if (pattern.Parts[pattern.CurrentIndex] == ".." || pattern.Parts[pattern.CurrentIndex] == ".")
{
Search(pattern.SwitchToNextPart(), curPath.AppendPart(pattern.Parts[pattern.CurrentIndex]), result, resultType);
return;
}
//If the next pattern part is recursive wildcard
//we get list of all sub folders and continue the normal search there.
if (pattern.Parts[pattern.CurrentIndex] == "**")
{
foreach (var subDir in GetRecursiveSubDirectories(curPath))
Search(pattern.SwitchToNextPart(), subDir, result, resultType);
return;
}
//Traverse all sub directories which should be traversed
foreach (var directory in GetDirectories(curPath))
{
if (pattern.MatchesCurrentPart(directory))
if (pattern.IsOnLastPart && resultType == ResultType.Directory)
{
var newPath = curPath.AppendPart(directory);
//Only add this path to result list if there is no longer version of this path
result.RemoveAll(x =>
{
if (x.Parts.Length <= newPath.Parts.Length)
if (x.Parts.SequenceEqual(newPath.Parts.Take(x.Parts.Length)))
return true;
return false;
});
result.Add(newPath);
}
else
if (!pattern.IsOnLastPart)
Search(pattern.SwitchToNextPart(), curPath.AppendPart(directory), result, resultType);
}
}
开发者ID:vetterd,项目名称:CSBuild,代码行数:58,代码来源:SearchEngine.cs
示例16: GetDistrictCode
/// <summary>通过两位地区码得到对应的地区名称
/// </summary>
/// <param name="code">两位地区码</param>
/// <param name="resType">返回类型:Simple(简称)、Full(全称)</param>
/// <returns>对应的地区名称</returns>
public static string GetDistrictCode(string code, ResultType resType)
{
if (code.Length != 2) throw new ArgumentException("地区代码的长度应该等于2。");
Hashtable districtTB = getNewDistrictTable(resType);
if (!districtTB.ContainsKey(code)) throw new Exception("地区代码不存在!");
return districtTB[code].ToString();
}
开发者ID:ExDevilLee,项目名称:LSLib,代码行数:14,代码来源:DistrictCodeTable.cs
示例17: AggregateProperty
private AggregateProperty( string d, string n, string v, ResultType type )
{
if ( All == null ) All = new HashSet<AggregateProperty>( );
Description = d;
Name = n;
Value = v;
Type = type;
All.Add( this );
}
开发者ID:kamalm87,项目名称:KNMFin,代码行数:9,代码来源:Aggregates.cs
示例18: AssertOperationResultValidationResultsMessageCodeOnWindowsPhoneCallbackRegistrationResponse
private static void AssertOperationResultValidationResultsMessageCodeOnWindowsPhoneCallbackRegistrationResponse(WindowsPhoneCallbackRegistrationResponse response, ResultType resultType, bool completelyValid, bool validWithWarnings, string code = null)
{
Assert.AreEqual(response.OperationResult, resultType);
Assert.AreEqual(response.ValidationResults.IsCompletelyValid, completelyValid);
Assert.AreEqual(response.ValidationResults.IsValidWithWarnings, validWithWarnings);
if (!String.IsNullOrWhiteSpace(code))
{
Assert.IsTrue(response.ValidationResults.Any(vr => vr.MessageCode == code));
}
}
开发者ID:rajanadar,项目名称:EasyNotification,代码行数:11,代码来源:WindowsPhonePushNotificationMessageUnitTest.cs
示例19: JsonMessage
public JsonMessage(
ResultType messageStatus, string msg, object dataObject, string specialCode)
{
statusEnum = messageStatus;
message = msg;
data = dataObject;
code = specialCode;
}
开发者ID:asifashraf,项目名称:Radmade-Portable-Framework,代码行数:11,代码来源:JsonMessage.cs
示例20: LoadTweets
public static async Task<IEnumerable<TwitterModel>> LoadTweets(string searchKey, ResultType resultType) {
//Prepare the url
string query = string.Format("http://search.twitter.com/search.json?q=%23{0}&result_type={1}", searchKey, resultType.ToString());
var client = new HttpClient();
//Make the request
var httpResponse = await client.GetAsync(new Uri(query));
//Read the response
var responseContent = await httpResponse.Content.ReadAsStringAsync();
// Parse the response (JSON)
return ParseResponse(responseContent);
}
开发者ID:djsolid,项目名称:win8-ws-samples,代码行数:11,代码来源:TwitterDataSource.cs
注:本文中的ResultType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论