本文整理汇总了C#中Display.AttachResource方法的典型用法代码示例。如果您正苦于以下问题:C# Display.AttachResource方法的具体用法?C# Display.AttachResource怎么用?C# Display.AttachResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display.AttachResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
/// <summary>
/// Handle a request.
/// </summary>
/// <param name="pDisplay">The display which called this function.</param>
/// <param name="pSurface">The surface which this display is hosted on.</param>
/// <param name="dArguments">A dictionary of arguments which are passed to the function as parameters.</param>
/// <returns>True if the request was processed sucessfully. False if there was an error.</returns>
public bool ProcessRequest(Display pDisplay, Surface pSurface, JSObject dArguments)
{
try
{
var pResource = new LowestPointCube(pDisplay, dArguments);
pDisplay.AttachResource(pResource);
Log.Write("LowestPointCube created relative to '" + pResource.RelativeSurface.Identifier + "'.", pDisplay.ToString(), Log.Type.DisplayInfo);
return true;
}
catch (Exception e)
{
Log.Write("Error creating LowestPointCube: " + e.Message, pDisplay.ToString(), Log.Type.DisplayWarning);
return false;
}
}