protected Runtime.Object ContentWithPathComponent(Path.Component component) { if (component.isIndex) { if (component.index >= 0 && component.index < content.Count) { return(content [component.index]); } // When path is out of range, quietly return nil // (useful as we step/increment forwards through content) else { return(null); } } else if (component.isParent) { return(this.parent); } else { INamedContent foundContent = null; if (namedContent.TryGetValue(component.name, out foundContent)) { return((Runtime.Object)foundContent); } else { throw new StoryException("Content '" + component.name + "' not found at path: '" + this.path + "'"); } } }
protected Object ContentWithPathComponent(Path.Component component) { if (component.isIndex) { if (component.index >= 0 && component.index < content.Count) { return(content[component.index]); } // When path is out of range, quietly return nil // (useful as we step/increment forwards through content) else { return(null); } } else if (component.isParent) { return(this.parent); } else { INamedContent foundContent = null; if (namedContent.TryGetValue(component.name, out foundContent)) { return((Object)foundContent); } else { return(null); } } }
public void AddToNamedContentOnly(INamedContent namedContentObj) { Debug.Assert(namedContentObj is Runtime.Object, "Can only add Runtime.Objects to a Runtime.Container"); var runtimeObj = (Runtime.Object)namedContentObj; runtimeObj.parent = this; namedContent [namedContentObj.name] = namedContentObj; }
public void AddToNamedContentOnly(INamedContent namedContentObj) { Debug.Assert (namedContentObj is Runtime.Object, "Can only add Runtime.Objects to a Runtime.Container"); var runtimeObj = (Runtime.Object)namedContentObj; runtimeObj.parent = this; namedContent [namedContentObj.name] = namedContentObj; }