예제 #1
0
        private void CheckConflictingItems(string[] path, int index, BindItem bindType)
        {
            string GetConflictingPath()
            {
                List <string> retL = new List <string>();

                for (int i = 0; i <= index; i++)
                {
                    retL.Add(path[index]);
                }
                return(string.Join(".", retL));
            }

            if (bindFunctions.ContainsKey(path[index]))
            {
                throw new Exception($"Cannot add {string.Join(".", path)} ({bindType.Name}), a Function  with the key ({GetConflictingPath()}) exists in the path");
            }
            else if (bindEnums.ContainsKey(path[index]))
            {
                throw new Exception($"Cannot add {string.Join(".", path)} ({bindType.Name}), an Enum  with the key ({GetConflictingPath()}) exists in the path");
            }
            else if (bindObjects.ContainsKey(path[index]))
            {
                throw new Exception($"Cannot add {string.Join(".", path)} ({bindType.Name}), a Global Object with the key ({GetConflictingPath()}) exists in the path");
            }
            else if (bindTypes.ContainsKey(path[index]))
            {
                throw new Exception($"Cannot add {string.Join(".", path)} ({bindType.Name}), a Global Type with the key ({GetConflictingPath()}) exists in the path");
            }
        }
예제 #2
0
 private static string GetItemTypeStr(BindItem item)
 {
     return(item is BindFunc ? "Function" : (item is BindEnum ? "Enum" : (item is BindUserObject ? "Global Object" : (item is BindUserType ? "Global Type" : "Table"))));
 }