// Token: 0x06006EB2 RID: 28338 RVA: 0x001FCC7C File Offset: 0x001FAE7C
        private static bool GetBamlTreeNodeFromText(BamlLocalizableResourceKey key, string content, BamlTreeUpdater.BamlTreeUpdateMap bamlTreeMap, IList <BamlTreeNode> newChildrenList)
        {
            BamlStringToken[] array = BamlResourceContentUtil.ParseChildPlaceholder(content);
            if (array == null)
            {
                bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.IncompleteElementPlaceholder));
                return(false);
            }
            bool result = true;

            for (int i = 0; i < array.Length; i++)
            {
                BamlStringToken.TokenType type = array[i].Type;
                if (type != BamlStringToken.TokenType.Text)
                {
                    if (type == BamlStringToken.TokenType.ChildPlaceHolder)
                    {
                        BamlTreeNode bamlTreeNode = bamlTreeMap.MapUidToBamlTreeElementNode(array[i].Value);
                        if (bamlTreeNode != null)
                        {
                            newChildrenList.Add(bamlTreeNode);
                        }
                        else
                        {
                            bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(new BamlLocalizableResourceKey(array[i].Value, string.Empty, string.Empty), BamlLocalizerError.InvalidUid));
                            result = false;
                        }
                    }
                }
                else
                {
                    BamlTreeNode item = new BamlTextNode(array[i].Value);
                    newChildrenList.Add(item);
                }
            }
            return(result);
        }
        private static bool GetBamlTreeNodeFromText(
            BamlLocalizableResourceKey key,
            string content,                                      // xml node to construct BamlTreeNode from
            BamlTreeUpdateMap bamlTreeMap,
            IList <BamlTreeNode> newChildrenList                 // list of new children
            )
        {
            BamlStringToken[] tokens = BamlResourceContentUtil.ParseChildPlaceholder(content);

            if (tokens == null)
            {
                bamlTreeMap.Resolver.RaiseErrorNotifyEvent(
                    new BamlLocalizerErrorNotifyEventArgs(
                        key,
                        BamlLocalizerError.IncompleteElementPlaceholder
                        )
                    );
                return(false);
            }

            bool succeed = true;

            for (int i = 0; i < tokens.Length; i++)
            {
                switch (tokens[i].Type)
                {
                case BamlStringToken.TokenType.Text:
                {
                    BamlTreeNode node = new BamlTextNode(tokens[i].Value);
                    newChildrenList.Add(node);
                    break;
                }

                case BamlStringToken.TokenType.ChildPlaceHolder:
                {
                    BamlTreeNode node = bamlTreeMap.MapUidToBamlTreeElementNode(tokens[i].Value);

                    // The value will be null if there is no uid-matching node in the tree.
                    if (node != null)
                    {
                        newChildrenList.Add(node);
                    }
                    else
                    {
                        bamlTreeMap.Resolver.RaiseErrorNotifyEvent(
                            new BamlLocalizerErrorNotifyEventArgs(
                                new BamlLocalizableResourceKey(
                                    tokens[i].Value,
                                    string.Empty,
                                    string.Empty
                                    ),
                                BamlLocalizerError.InvalidUid
                                )
                            );
                        succeed = false;
                    }

                    break;
                }
                }
            }

            return(succeed);
        }