本文整理汇总了C#中Story.ContentAtPath方法的典型用法代码示例。如果您正苦于以下问题:C# Story.ContentAtPath方法的具体用法?C# Story.ContentAtPath怎么用?C# Story.ContentAtPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Story
的用法示例。
在下文中一共展示了Story.ContentAtPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Thread
public Thread(Dictionary<string, object> jThreadObj, Story storyContext) : this() {
threadIndex = (int) jThreadObj ["threadIndex"];
List<object> jThreadCallstack = (List<object>) jThreadObj ["callstack"];
foreach (object jElTok in jThreadCallstack) {
var jElementObj = (Dictionary<string, object>)jElTok;
PushPopType pushPopType = (PushPopType)(int)jElementObj ["type"];
Container currentContainer = null;
int contentIndex = 0;
string currentContainerPathStr = null;
object currentContainerPathStrToken;
if (jElementObj.TryGetValue ("cPath", out currentContainerPathStrToken)) {
currentContainerPathStr = currentContainerPathStrToken.ToString ();
currentContainer = storyContext.ContentAtPath (new Path(currentContainerPathStr)) as Container;
contentIndex = (int) jElementObj ["idx"];
}
bool inExpressionEvaluation = (bool)jElementObj ["exp"];
var el = new Element (pushPopType, currentContainer, contentIndex, inExpressionEvaluation);
var jObjTemps = (Dictionary<string, object>) jElementObj ["temp"];
el.temporaryVariables = Json.JObjectToDictionaryRuntimeObjs (jObjTemps);
callstack.Add (el);
}
object prevContentObjPath;
if( jThreadObj.TryGetValue("previousContentObject", out prevContentObjPath) ) {
var prevPath = new Path((string)prevContentObjPath);
previousContentObject = storyContext.ContentAtPath(prevPath);
}
}