本文整理汇总了C#中ResultType类的典型用法代码示例。如果您正苦于以下问题:C# ResultType类的具体用法?C# ResultType怎么用?C# ResultType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResultType类属于命名空间,在下文中一共展示了ResultType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: CommandResult
public CommandResult(string cmd, string[] args)
{
_results = new List<string>();
_command = cmd;
_args = args;
_type = ResultType.Success;
}
示例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>();
}
示例4: Result
internal Result(long resultID, ResultType resultType, string message, long reference)
{
ResultID = resultID;
ResultType = resultType;
Message = message;
Reference = reference;
}
示例5: TestResult
public TestResult(ResultType res, byte[] actualBytes, byte[] expectedBytes, string failureDetails = null)
{
Result = res;
ActualBytes = actualBytes;
ExpectedBytes = expectedBytes;
FailureDetails = failureDetails;
}
示例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;
}
示例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;
}
}
}
示例8: MemberResult
internal MemberResult(string name, ResultType type)
{
_name = name;
_type = type;
_completion = _name;
_vars = Empty;
}
示例9: SearchAsync
public async Task<IEnumerable<Message>> SearchAsync(
IEnumerable<string> values,
ResultType resultType,
int count)
{
return await SearchAsync(values, resultType, count, null);
}
示例10: Reset
public void Reset ()
{
resultType = ResultType.NotRun;
duration = 0f;
messages = "";
stacktrace = "";
isRunning = false;
}
示例11: TestResult
public TestResult ( GameObject gameObject )
{
id = Guid.NewGuid().ToString("N");
resultType = ResultType.NotRun;
this.go = gameObject;
if(gameObject!=null)
name = gameObject.name;
}
示例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;
}
示例13: PassAction
IEnumerator PassAction (ResultType result)
{
yield return null; // No init
Debug.Log (result);
yield return result;
}
示例14: SearchEntry
public SearchEntry(int id, string name, ResultType restype, UserType usetype)
{
ID = id;
Name = name;
ResultType = restype;
UserType = usetype;
Hit = 1;
}
示例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);
}
}