Ejemplo n.º 1
0
        private void UpdateListObj(ListViewItem lvi)
        {
            if (lvi.Tag == null)
            {
                return;
            }
            ImportFilesObj obj = lvi.Tag as ImportFilesObj;

            if (obj == null)
            {
                return;
            }
            obj.ProName = lvi.SubItems[_proIndex].Text;
            if (_products != null && _products.ContainsKey(obj.ProName))
            {
                obj.ProIdentify = _products[obj.ProName];
            }
            else
            {
                obj.ProIdentify = string.Empty;
            }
            obj.SubProName = lvi.SubItems[_subProIndex].Text;
            if (_subProducts != null && _subProducts.ContainsKey(obj.SubProName))
            {
                obj.SubProIdentify = _subProducts[obj.SubProName];
            }
            else
            {
                obj.SubProIdentify = string.Empty;
            }
        }
Ejemplo n.º 2
0
        private ListViewItem CreateLvFileItem(string file)
        {
            if (_eliminateKnownExt.Contains(Path.GetExtension(file).ToUpper()))
            {
                return(null);
            }
            RasterIdentify rs  = new RasterIdentify(file);
            ImportFilesObj obj = null;

            if (rs == null || string.IsNullOrEmpty(rs.ProductIdentify))
            {
                obj = new ImportFilesObj(null, null, null, null, Path.GetFileName(file), Path.GetDirectoryName(file));
            }
            else
            {
                if (string.IsNullOrEmpty(rs.SubProductIdentify))
                {
                    obj = new ImportFilesObj(rs.ProductName, null, rs.ProductIdentify, null, Path.GetFileName(file), Path.GetDirectoryName(file));
                }
                else
                {
                    obj = new ImportFilesObj(rs.ProductName, rs.SubProductName, rs.ProductIdentify, rs.SubProductIdentify, Path.GetFileName(file), Path.GetDirectoryName(file));
                }
            }
            return(CreateLvFileItem(obj));
        }
Ejemplo n.º 3
0
        private ListViewItem CreateLvFileItem(ImportFilesObj obj)
        {
            if (obj == null)
            {
                return(null);
            }
            ListViewItem lvi = new ListViewItem();

            lvi.SubItems.Add(obj.ProName);
            lvi.SubItems.Add(obj.SubProName);
            lvi.SubItems.Add(obj.FileName);
            lvi.SubItems.Add(obj.Dir);
            lvi.Checked = true;
            lvi.Tag     = obj;
            return(lvi);
        }