示例#1
0
        internal int GetArrayElementType(ScopeInfo scopeInfo, string[] identList)
        {
            if (null == arrayTypeTable)
            {
                return((int)PrimitiveType.kInvalidType);
            }

            string arrayName = identList[0];

            foreach (KeyValuePair <ScopedArray, ArrayElementType> arrayType in arrayTypeTable)
            {
                if (arrayType.Key.ScopeInfo == scopeInfo)
                {
                    if (arrayType.Key.ArrayName == arrayName)
                    {
                        ArrayElementType arrayRoot = arrayType.Value;
                        ArrayElementType element   = arrayRoot.GetElementFromIndices(identList);
                        if (null != element)
                        {
                            return(element.Type.UID);
                        }
                    }
                }
            }

            return((int)PrimitiveType.kInvalidType);
        }
示例#2
0
        internal void AppendChild(ArrayElementType childElementType)
        {
            if (null == childNodes)
                childNodes = new List<ArrayElementType>();

            childNodes.Add(childElementType);
        }
示例#3
0
        private ArrayElementType GetElementFromIndices(string[] indices, int level)
        {
            if (null == childNodes || (childNodes.Count <= 0))
            {
                return(null);
            }

            int elementIndex = -1;

            if (int.TryParse(indices[level], out elementIndex) == false)
            {
                return(null);
            }

            if (elementIndex < 0 || (elementIndex >= childNodes.Count))
            {
                return(null); // Invalid array index specified.
            }
            ArrayElementType element = childNodes[elementIndex];

            if (level == indices.Length - 1)
            {
                return(element);
            }

            return(element.GetElementFromIndices(indices, level + 1));
        }
示例#4
0
        internal void AppendChild(ArrayElementType childElementType)
        {
            if (null == childNodes)
            {
                childNodes = new List <ArrayElementType>();
            }

            childNodes.Add(childElementType);
        }
示例#5
0
        internal ArrayElementType AppendChildType(ProtoCore.Type type)
        {
            if (null == childNodes)
                childNodes = new List<ArrayElementType>();

            ArrayElementType element = new ArrayElementType(
                type, this.elementDepth + 1);

            childNodes.Add(element);
            return element;
        }
示例#6
0
        internal void InsertRootElementType(ScopedArray scopedArray, ArrayElementType rootElement)
        {
            if (null != scopedArray)
            {
                if (null == arrayTypeTable)
                {
                    arrayTypeTable = new Dictionary <ScopedArray, ArrayElementType>();
                }

                arrayTypeTable.Add(scopedArray, rootElement);
            }
        }
示例#7
0
        internal ArrayElementType AppendChildType(ProtoCore.Type type)
        {
            if (null == childNodes)
            {
                childNodes = new List <ArrayElementType>();
            }

            ArrayElementType element = new ArrayElementType(
                type, this.elementDepth + 1);

            childNodes.Add(element);
            return(element);
        }
示例#8
0
        internal void InsertRootElementType(ScopedArray scopedArray, ArrayElementType rootElement)
        {
            if (null != scopedArray)
            {
                if (null == arrayTypeTable)
                    arrayTypeTable = new Dictionary<ScopedArray, ArrayElementType>();

                arrayTypeTable.Add(scopedArray, rootElement);
            }
        }