Esempio n. 1
0
        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 + "'");
                }
            }
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
		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;
		}