public GetFolderResponse(Folder f) { this.f = f; }
private Folder NodeToFolder( XmlNode parent ) { XmlAttributeCollection attrs = parent.Attributes; Folder f; if( parent.Name.ToLower().Equals("search") ) { SearchFolder sf = new SearchFolder(); sf.Query = XmlUtil.AttributeValue( attrs, MailService.A_QUERY ); sf.Types = XmlUtil.AttributeValue( attrs, MailService.A_TYPES ); sf.SortBy = XmlUtil.AttributeValue( attrs, MailService.A_SORT_BY ); f = sf; } else { f = new Folder(); } f.Id = XmlUtil.AttributeValue( attrs, MailService.A_ID ); f.Name = XmlUtil.AttributeValue( attrs, MailService.A_NAME ); f.ParentFolderId = XmlUtil.AttributeValue( attrs, MailService.A_PARENT_FOLDER_ID ); f.Color = XmlUtil.AttributeValue( attrs, MailService.A_COLOR ); f.UnreadCount = XmlUtil.AttributeValue( attrs, MailService.A_UNREAD_COUNT ); f.NumMessages = XmlUtil.AttributeValue( attrs, MailService.A_ITEM_COUNT ); f.View = XmlUtil.AttributeValue( attrs, MailService.A_VIEW ); for( int i = 0; i < parent.ChildNodes.Count; i++ ) { XmlNode child = parent.ChildNodes.Item(i); f.Children.Add( NodeToFolder( child ) ); } return f; }
public void AddChild( Folder f ) { children.Add( f ); }