Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么要列出<;字符串>;闪电是否始终包含0个空项目?_C# - Fatal编程技术网

C# 为什么要列出<;字符串>;闪电是否始终包含0个空项目?

C# 为什么要列出<;字符串>;闪电是否始终包含0个空项目?,c#,C#,在表格1中,我在表格顶部有: Lightnings_Extractor.PDF pdf1; 然后在表单1的构造函数中,我有: pdf1 = new Lightnings_Extractor.PDF(); private void deleteSelectedLightningsToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you Sure you want to dele

在表格1中,我在表格顶部有:

Lightnings_Extractor.PDF pdf1;
然后在
表单1的构造函数中,我有:

pdf1 = new Lightnings_Extractor.PDF();
private void deleteSelectedLightningsToolStripMenuItem_Click(object sender, EventArgs e)
{

    if (MessageBox.Show("Are you Sure you want to delete " + Lightnings_Extractor.ListBoxControl.counter +  " files ? Click Yes to Confirm and No to continue", "WinForm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
    {

    }
    else
    {
           for (int i = 0; i < pdf1.Lightnings.Count; i++)
            {

            }
    }
}
然后在
表格1的底部,我有:

pdf1 = new Lightnings_Extractor.PDF();
private void deleteSelectedLightningsToolStripMenuItem_Click(object sender, EventArgs e)
{

    if (MessageBox.Show("Are you Sure you want to delete " + Lightnings_Extractor.ListBoxControl.counter +  " files ? Click Yes to Confirm and No to continue", "WinForm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
    {

    }
    else
    {
           for (int i = 0; i < pdf1.Lightnings.Count; i++)
            {

            }
    }
}
private void deletelectedlightningstolstripmenuitem\u单击(对象发送方,事件参数e)
{
如果(MessageBox.Show(“是否确实要删除”+Lightings\u Extractor.ListBoxControl.counter+”文件?单击“是”确认,单击“否”继续”,“WinForm”,MessageBoxButtons.YesNo,MessageBoxIcon.Question)=DialogResult.No)
{
}
其他的
{
对于(int i=0;i
我看到,
闪电
里面有物品

但是,当我单击:
deleteselectedlightningstolstripmenuitem\u单击
Form1
中的
时,我看到
Lightnings
为空计数0。我不明白为什么。

表单1中的
LightningExtractor
对象和
Lightnings\u模式中的
对象是不同的对象


您需要传递相同的对象。

好的。。。那么,有多少代码可以被删除,使您仍然有问题(我们将能够重新创建它)?这里面有很多东西,有很多代码,伙计。我的想法是只包括足以证明你的问题,而不是你的整个计划。我同意。不幸的是,你将得到大部分TL;DR从这一大堆代码中做出反应。我在Form1中尝试将pdf1变量公开:public lightings_Extractor.PDF pdf1;然后在Lightings_模式下使用它:public lightings_模式(Form1 f1){InitializeComponent();然后使用它:f1.pdf1.lightings.Add(item.ToString());但是我在pdf1变量的Form1上得到一个错误:不一致的可访问性:属性类型'Lightings_Extractor.PDF'比属性'Extracting_Frames.Form1.mypdf'@user1196715更难访问-您还需要将类
PDF
公开。