Exemplo n.º 1
0
 private void LoadNode(FileSystemNodePlus<MyAddittionalData> Node)
 {
     if (Node != null)
     {
         CurrentNode = Node;
         Controls.Clear();
         if (Node.Parent != null)
         {
             AddComponent(Node.Parent, false, "..");
         }
         foreach (FileSystemNodePlus<MyAddittionalData> nd in Node.GetAllNode(FileSystemNodePlusType.Directory).OrderBy(x => x.Name))
         {
             AddComponent(nd);
         }
         foreach (FileSystemNodePlus<MyAddittionalData> nf in Node.GetAllNode(FileSystemNodePlusType.File).OrderBy(x => x.Name))
         {
             AddComponent(nf);
         }
         this.Focus();
     }
 }
 private void IncorporaMetadataRicorsivo(FileSystemNodePlus<MyAddittionalData> nodo, MyFileSystemPlus mfsp)
 {
     foreach (FileSystemNodePlus<MyAddittionalData> n in nodo.GetAllNode())
     {
         while (_Pause)
             Thread.Sleep(100);
         
         if (n.Type == FileSystemNodePlusType.Directory)
             IncorporaMetadataRicorsivo(n, mfsp);
         else if (n.Type == FileSystemNodePlusType.File)
         {
             IncorporaMetadataNodo(n, mfsp.GetFullPath(n));                    
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// DEPRECATA! NON FUNZIONANTE
        /// </summary>
        /// <param name="nodo"></param>
        /// <param name="mfsp"></param>
        /// <param name="EndFormat"></param>
        /// <returns></returns>
        private long CalcoloSpazio(FileSystemNodePlus<MyAddittionalData> nodo, MyFileSystemPlus mfsp, FFMpegMediaMetadata EndFormat)
        {
            if (EndFormat is FFMpegMediaMetadataMp3 )
            {
                long t = 0;
                foreach (FileSystemNodePlus<MyAddittionalData> n in nodo.GetAllNode())
                {
                    while (Pause)
                        Thread.Sleep(100);

                    if (n.Type == FileSystemNodePlusType.Directory)
                        t += CalcoloSpazio(n, mfsp, EndFormat);
                    else if (n.Type == FileSystemNodePlusType.File)
                    {
                        String p = mfsp.GetFullPath(n);
                        if (SystemService.FileExist(p))
                        {
                            textBox_source.SetTextInvoke(p);
                            if(FFmpeg.GetMetadata(p).MediaMetadata!=null)
                            {
                                String temp = FFmpeg.GetMetadata(p).MediaMetadata.Duration;
                                string[] st = temp.Split(':');
                                long tt = 0;
                                if (st.Length == 3)
                                {
                                    try
                                    {
                                        tt = st[0].ParseInt() * 144000; //trovo i secondi e moltiplico x 320/8 -> 3600*40
                                        tt += st[1].ParseInt() * 2400; //trovo i secondi e moltiplico x 320/8 -> 60*40
                                        tt += st[2].Split('.')[0].ParseInt() * 40; //trovo i secondi e moltiplico x 320/8 -> 60*40
                                    }
                                    catch (Exception e) { }
                                    t += tt;
                                }
                            }
                        }
                        progressBar_total.SetValueInvoke(progressBar_total.Value + 1);
                    }
                }
                return t;
            }
            return 0;
        }
Exemplo n.º 4
0
 private void SetSelectChildNodeRecursive(FileSystemNodePlus<MyAddittionalData> Node, bool Value)
 {
     Node.AddittionalData.Selezionato = Value;
     foreach(FileSystemNodePlus<MyAddittionalData> n in Node.GetAllNode())
         SetSelectChildNodeRecursive(n, Value);
     
 }
Exemplo n.º 5
0
        private void SetSelectParentNodeRecursive(FileSystemNodePlus<MyAddittionalData> Nodo, bool Value)
        {
            if (Value)
            {
                Nodo.AddittionalData.Selezionato = true;
            }
            else
            {
                foreach (FileSystemNodePlus<MyAddittionalData> n in Nodo.GetAllNode())
                    if (n.AddittionalData.Selezionato)
                        return;
                Nodo.AddittionalData.Selezionato = false;

            }
            if (Nodo.Parent != null)
                SetSelectParentNodeRecursive(Nodo.Parent, Value);
        }