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); }
internal void AppendChild(ArrayElementType childElementType) { if (null == childNodes) childNodes = new List<ArrayElementType>(); childNodes.Add(childElementType); }
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)); }
internal void AppendChild(ArrayElementType childElementType) { if (null == childNodes) { childNodes = new List <ArrayElementType>(); } childNodes.Add(childElementType); }
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; }
internal void InsertRootElementType(ScopedArray scopedArray, ArrayElementType rootElement) { if (null != scopedArray) { if (null == arrayTypeTable) { arrayTypeTable = new Dictionary <ScopedArray, ArrayElementType>(); } arrayTypeTable.Add(scopedArray, rootElement); } }
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); }
internal void InsertRootElementType(ScopedArray scopedArray, ArrayElementType rootElement) { if (null != scopedArray) { if (null == arrayTypeTable) arrayTypeTable = new Dictionary<ScopedArray, ArrayElementType>(); arrayTypeTable.Add(scopedArray, rootElement); } }