Пример #1
0
        public FileInfoForm(FAT16DirEntry entry)
        {
            InitializeComponent();

            this.MaximumSize = this.MinimumSize = this.Size;

            labelNombre.Text        = entry.NombreDeDir;
            labelFechaCreacion.Text = entry.GetFechaCreacionString();
            labelFechaMod.Text      = entry.GetFechaModificacionString();
            labelTamano.Text        = entry.GetDirSizeString() + " bytes";
            labelCluster.Text       = "" + entry.GetFirstCluster();
        }
Пример #2
0
        public static ListViewFAT16Entry FactoryMethod(FAT16DirEntry entry)
        {
            String[] datos = new String[6];
            datos[0] = entry.GetDirName();
            datos[1] = entry.GetTipo();

            long FileSize = entry.GetDirSize();

            //KB
            if (FileSize >= (1024 * 1024 * 1024))
            {
                float tamano = FileSize / (1024 * 1024 * 1024);
                datos[2] = "" + tamano + " GB";
            }
            //MB
            else if (FileSize >= (1024 * 1024))
            {
                float tamano = FileSize / (1024 * 1024);
                datos[2] = "" + tamano + " MB";
            }
            //GB
            else if (FileSize >= 1024)
            {
                float tamano = FileSize / 1024;
                datos[2] = "" + tamano + " KB";
            }
            else
            {
                datos[2] = "" + FileSize + " bytes";
            }

            datos[3] = entry.GetFechaCreacionString();
            datos[4] = entry.GetFechaModificacionString();
            datos[5] = entry.GetFirstCluster().ToString();
            return(new ListViewFAT16Entry(entry, datos));
        }