本文整理匯總了C#中All.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# All.ToString方法的具體用法?C# All.ToString怎麽用?C# All.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類All
的用法示例。
在下文中一共展示了All.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Analyze
public Analyze Analyze(string host, Publish publish, StartNew startNew, FromCache fromCache, int? maxHours, All all, IgnoreMismatch ignoreMismatch)
{
var analyzeModel = new Analyze();
// Checking host is valid before continuing
if (!_urlValidation.IsValid(host))
{
analyzeModel.HasErrorOccurred = true;
analyzeModel.Errors.Add(new Error { message = "Host does not pass preflight validation. No Api call has been made." });
return analyzeModel;
}
// Building request model
var requestModel = _requestModelFactory.NewAnalyzeRequestModel(ApiUrl, "analyze", host, publish.ToString().ToLower(), startNew.ToString().ToLower(),
fromCache.ToString().ToLower(), maxHours, all.ToString().ToLower(), ignoreMismatch.ToString().ToLower());
try
{
var webResponse = _apiProvider.MakeGetRequest(requestModel);
analyzeModel = _responsePopulation.AnalyzeModel(webResponse, analyzeModel);
}
catch (Exception ex)
{
analyzeModel.HasErrorOccurred = true;
analyzeModel.Errors.Add(new Error { message = ex.ToString() });
}
// Checking if errors have occoured either from ethier api or wrapper
if (analyzeModel.Errors.Count != 0 && !analyzeModel.HasErrorOccurred) { analyzeModel.HasErrorOccurred = true; }
return analyzeModel;
}
示例2: LoadShader
int LoadShader(All type, string source)
{
int shader = GL.CreateShader (type);
if (shader == 0)
throw new InvalidOperationException ("Unable to create shader");
int length = 0;
GL.ShaderSource (shader, 1, new string [] {source}, (int[])null);
GL.CompileShader (shader);
int compiled = 0;
GL.GetShader (shader, All.CompileStatus, ref compiled);
if (compiled == 0) {
length = 0;
GL.GetShader (shader, All.InfoLogLength, ref length);
if (length > 0) {
var log = new StringBuilder (length);
GL.GetShaderInfoLog (shader, length, ref length, log);
Log.Debug ("GL2", "Couldn't compile shader: " + log.ToString ());
}
GL.DeleteShader (shader);
throw new InvalidOperationException ("Unable to compile shader of type : " + type.ToString ());
}
return shader;
}