Monobjc.Tools.Xcode.PBXGroup.AddChild C# (CSharp) Method

AddChild() public method

Adds the child.
public AddChild ( PBXFileElement element ) : void
element PBXFileElement The element.
return void
        public void AddChild(PBXFileElement element)
        {
            this.children.Add(element);
        }

Usage Example

Beispiel #1
0
        /// <summary>
        ///   Removes the group.
        /// </summary>
        /// <param name = "groups">The groups.</param>
        /// <returns></returns>
        public PBXGroup RemoveGroup(String groups)
        {
            lock (this.syncRoot) {
                // Only keep the n-1 groups
                List <String> parts = groups.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                String        last  = parts.Last();
                parts.RemoveAt(parts.Count - 1);

                // Go to the parent group
                PBXGroup g, group = this.Document.Project.MainGroup;
                foreach (String part in parts)
                {
                    g = group.FindGroup(part);
                    if (g == null)
                    {
                        // For each group not found, create it
                        g = new PBXGroup(part);
                        group.AddChild(g);
                    }
                    group = g;
                }

                // If the group to delete exists, remove it
                g = group.FindGroup(last);
                if (g != null)
                {
                    group.RemoveChild(g);
                }

                return(g);
            }
        }
All Usage Examples Of Monobjc.Tools.Xcode.PBXGroup::AddChild