/// <summary> /// Add new file. /// </summary> private void NewFile_Clicked(object sender, EventArgs e) { FileItem NewFileItem = new FileItem(); ActiveFiles.Add(NewFileItem); var tmp = new FileListItem(this, NewFileItem, ((ActiveFiles.Count - 1)%2 == 0) ? Colors.White : Colors.LightGray); FileListContent.PackStart(tmp); }
/// <summary> /// Remove file item. /// </summary> public void RemoveFileItem(FileItem _item) { ActiveFiles.Remove(_item); RefreshFileList(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="_parent"></param> /// <param name="_item"></param> /// <param name="_color"></param> public FileListItem(FileList _parent, FileItem _item, Color _color) { // Set attributes and colors ParentList = _parent; ActiveFileItem = _item; BackgroundColor = DefaultColor = _color; // Expanding height MinHeight = 30; ExpandHorizontal = true; Margin = 0; // Init components _initalizeComponents(); }