public AlbumControl(frmPrincipal form, dAlbum album)
 {
     _parent = form;
     thisAlbum = album;
     InitializeComponent();
     treeView.Nodes.Add(thisAlbum.Root) ;
     treeView.SelectedNode = treeView.Nodes[0] ;
 }
        public AlbumControl(frmPrincipal form, dAlbum album)
        {
            _parent = form;
            thisAlbum = album;
            InitializeComponent();
            treeView.Nodes.Add(thisAlbum.Root);
            treeView.SelectedNode = treeView.Nodes[0];

            _comparador = new Comparador(listView);
            listView.ListViewItemSorter = _comparador;
            listView.Sorting = SortOrder.None;
        }
 public xmlImagen(dAlbum parent)
 {
     if (parent == null)
         throw new Exception();
     _parent = parent;
 }
        public xmlImagen(dAlbum parent, string path)
            : this(parent)
        {
            _fullpath = path;
            _sname = System.IO.Path.GetFileName(path);
            innerXML = new XmlDocument();

            root = innerXML.CreateElement(Atributos.Folder);

            DirectoryInfo dirInfo = new DirectoryInfo(path);
            root.SetAttribute(Atributos.Name, dirInfo.Name);//agrego el nombre
            root.SetAttribute(Atributos.FullPath, path);    //agrego el camino

            long size = Rcsvo(root, dirInfo);
            if (_errores.Length != 0) {
                MessageBox.Show("Ocurrieron los siguientes errores.\nInformación: " + _errores, "Error.");
            }
            root.SetAttribute(Atributos.Size, size.ToString());//agrego el tamaño
            root.SetAttribute(Atributos.FolderNum, _inum_folder.ToString());
            root.SetAttribute(Atributos.FilesNum, _inum_files.ToString());
            innerXML.AppendChild(root);
            parent.InsertImagen(this);
        }
Exemple #5
0
 public Container(dAlbum SelectedAlbum, string fullpath)
 {
     full_path = fullpath;
     this.SelectedAlbum = SelectedAlbum;
 }
Exemple #6
0
        /// <summary>
        /// Inserta un dAlbum en un nuevo TabPage y actualiza SelectedAlbum y album_ctrl_list.
        /// </summary>
        /// <param name="new_album">Album a insertar.</param>
        /// <returns></returns>
        bool InsertarNewAlbum(dAlbum new_album)
        {
            int index = TabCtrl.TabPages.Count - 1;
            TabCtrl.TabPages.Insert(index,
                new_album.Name, new_album.Name);

            AlbumControl alControl = new AlbumControl(this, new_album);
            alControl.treeView.ImageList = this.imgList;
            //alControl.listView.LargeImageList = this.imgList;
            alControl.listView.SmallImageList = this.imgList;
            alControl.Parent = TabCtrl.TabPages[index];
            alControl.Dock = DockStyle.Fill;
            album_ctrl_list.Add(alControl);
            TabCtrl.SelectedIndex = index;

            ShowStatus();

            btnMake.Enabled = true;
            mnuImage.Enabled = true;
            mnuCloseFolder.Enabled = true;
            return true;
        }
Exemple #7
0
        public static dAlbum LoadAlbumFromTzip(string path)
        {
            //FileStream filereader;
            StreamReader reader;
            dAlbum thisAlbum = new dAlbum();

            if (File.Exists(path)){
                reader = IO.Descompact(path);
            }
            //reader = new StreamReader(path);
            else//TODO:: Si no existe q hago.
                return null;
            thisAlbum._sversion = reader.ReadLine();
            thisAlbum._snombre = reader.ReadLine();
            int totalImages = int.Parse(reader.ReadLine());

            for (int k = 0; k < totalImages; k++)
            {
                xmlImagen img = new xmlImagen(thisAlbum);
                img.LoadLine(reader);
                thisAlbum.InsertImagen(img);
            }
            reader.Close();
            File.Delete(Application.ExecutablePath + "tmp");
            thisAlbum.need_change = false;          //el album recie creado no necesita guardarse
            thisAlbum._full_path = path;                      //esta es la direccion del album ahora
            return thisAlbum;
        }
Exemple #8
0
        public static dAlbum LoadAlbumFromTxml(string path)
        {
            StreamReader reader;
            dAlbum thisAlbum = new dAlbum();

            if (File.Exists(path)){
                reader = new StreamReader(path);
            }
            else//TODO:: Si no existe q hago.
                return null;
            thisAlbum._sversion = reader.ReadLine();
            thisAlbum._snombre = reader.ReadLine();
            int totalImages = int.Parse(reader.ReadLine());

            for (int k = 0; k < totalImages; k++)
            {
                xmlImagen img = new xmlImagen(thisAlbum);
                img.LoadLine(reader);
                thisAlbum.InsertImagen(img);
            }
            reader.Close();
            thisAlbum.need_change = false;          //el album no necesita guardarse
            return thisAlbum;
            thisAlbum._full_path = path;
        }