private T CreateNewItem()
        {
            var args = new NewItemNeededEventArgs <T>();

            NewItemNeeded?.Invoke(this, args);
            return(args.Item);
        }
Beispiel #2
0
        private void btnAddFile_Click(object sender, EventArgs e)
        {
            AdditionalFilesEventArgs args = new AdditionalFilesEventArgs(null);

            NewItemNeeded?.Invoke(this, args);

            if (args.NewItems != null)
            {
                m_files.AddRange(args.NewItems);
                Rebind();
                if (dgvAdditionalFiles.Rows.Count > 0)
                {
                    dgvAdditionalFiles.Rows[dgvAdditionalFiles.Rows.Count - 1].Selected = true;
                }
            }
        }