Exemplo n.º 1
0
        public PBXGroup GetGroup(string name, string path = null, PBXGroup parent = null)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }

            if (parent == null)
            {
                parent = rootGroup;
            }

            foreach (KeyValuePair <string, PBXGroup> current in groups)
            {
                if (string.IsNullOrEmpty(current.Value.name))
                {
                    if (current.Value.path.CompareTo(name) == 0 && parent.HasChild(current.Key))
                    {
                        return(current.Value);
                    }
                }
                else if (current.Value.name.CompareTo(name) == 0 && parent.HasChild(current.Key))
                {
                    return(current.Value);
                }
            }

            PBXGroup result = new PBXGroup(name, path);

            groups.Add(result);
            parent.AddChild(result);

            modified = true;
            return(result);
        }
Exemplo n.º 2
0
		public PBXGroup GetGroup( string name, string path = null, PBXGroup parent = null )
		{
			if( string.IsNullOrEmpty( name ) )
				return null;
			
			if( parent == null )
				parent = rootGroup;
			
			foreach( KeyValuePair<string, PBXGroup> current in groups ) {
				
				if( string.IsNullOrEmpty( current.Value.name ) ) { 
					if( current.Value.path.CompareTo( name ) == 0 && parent.HasChild( current.Key ) ) {
						return current.Value;
					}
				}
				else if( current.Value.name.CompareTo( name ) == 0 && parent.HasChild( current.Key ) ) {
					return current.Value;
				}
			}
			
			PBXGroup result = new PBXGroup( name, path );
			groups.Add( result );
			parent.AddChild( result );
			
			modified = true;
			return result;

		}