示例#1
0
        private void addFileToListBox(string f)
        {
            Type formatType = null;
            ListBoxFileInfoObject listFileObject;

            using (FileStream fs = File.OpenRead(f))
            {
                formatType = FormatUtil.getObjectType(fs);

                if ((formatType != null) &&
                    typeof(IGd3TagFormat).IsAssignableFrom(formatType))
                {
                    listFileObject = new ListBoxFileInfoObject(f);
                    this.lbFiles.Items.Add(listFileObject);
                }
            }
        }
示例#2
0
        private void addFileToListBox(string f)
        {
            ListBoxFileInfoObject listFileObject;
            string fileName;

            if (rbCreate.Checked)
            {
                if (!f.ToUpper().EndsWith("GENH") &&
                    !f.ToUpper().EndsWith("EXE"))
                {
                    if (!String.IsNullOrEmpty(this.tbFilenameFilter.Text))
                    {
                        fileName = Path.GetFileName(f);

                        if (fileName.ToUpper().Contains(this.tbFilenameFilter.Text.ToUpper()))
                        {
                            using (FileStream fs = File.OpenRead(f))
                            {
                                listFileObject = new ListBoxFileInfoObject(f);
                                this.lbFiles.Items.Add(listFileObject);
                            }
                        }
                    }
                    else
                    {
                        using (FileStream fs = File.OpenRead(f))
                        {
                            listFileObject = new ListBoxFileInfoObject(f);
                            this.lbFiles.Items.Add(listFileObject);
                        }
                    }
                }
            }
            else
            {
                if (f.ToUpper().EndsWith("GENH"))
                {
                    using (FileStream fs = File.OpenRead(f))
                    {
                        listFileObject = new ListBoxFileInfoObject(f);
                        this.lbFiles.Items.Add(listFileObject);
                    }
                }
            }
        }