Пример #1
0
        /// <summary>
        /// Function: Create form elements
        /// Author  : Jerry Xu
        /// Date    : 2008-11-6
        /// </summary>
        private void CreateFormElements()
        {
            LibraryFileItem fileItem;

            foreach (LibraryFile item in _files)
            {
                fileItem                      = new LibraryFileItem(item);
                fileItem.Width                = containerFiles.Width - 2;
                fileItem.Dock                 = DockStyle.Top;
                fileItem.LibraryFileCheck    += new EventHandler <LibraryFileCheckEventArgs>(fileItem_LibraryFileCheck);
                fileItem.LibraryImportRename += new EventHandler <ImportRenameEventArgs>(fileItem_LibraryImportRename);
                containerFiles.Height         = containerFiles.Height + fileItem.Height;
                containerFiles.Controls.Add(fileItem);
            }

            LibraryMessageItem messageItem;

            foreach (MessageInfo item in _messages)
            {
                messageItem       = new LibraryMessageItem(item);
                messageItem.Width = containerMessage.Width - 2;
                messageItem.Dock  = DockStyle.Top;
                messageItem.LibraryMessageCheck += new EventHandler <LibraryMessageCheckEventArgs>(messageItem_LibraryMessageCheck);
                messageItem.LibraryImportRename += new EventHandler <ImportRenameEventArgs>(fileItem_LibraryImportRename);
                containerMessage.Height          = containerMessage.Height + messageItem.Height;
                containerMessage.Controls.Add(messageItem);
            }
        }
Пример #2
0
        private void OnLibraryFileCheck(LibraryFileItem item)
        {
            if (item == null || item.Item == null || !item.Item.IsValid)
            {
                return;
            }

            _LibraryFileCheck(this, new LibraryFileCheckEventArgs(item));
        }
Пример #3
0
 public LibraryFileCheckEventArgs(LibraryFileItem item)
 {
     Item = item;
 }