Ejemplo n.º 1
0
 public virtual void RefreshInfo(ObjectListView olv, TidyConst.RefreshType key)
 {
     this.RefreshInfo(olv);
 }
Ejemplo n.º 2
0
        public override void RefreshInfo(ObjectListView olv, TidyConst.RefreshType key)
        {
            if (this.StoreDrive.Capacity == 0)
            {
                return;
            }

            long lSpace = this.Space;
            int  iFresh = 0;

            foreach (Anime a in olv.Objects)
            {
                if (a.Path.Length == 0)
                {
                    continue;
                }

                bool bPathUp = false;
                bool bSizeUp = false;

                if (Directory.Exists(a.Path))
                {
                    long lSize = Anime.GetSize(a.Path);
                    if (a.Size != lSize)
                    {
                        bSizeUp = true;

                        lSpace += lSize - a.Size;
                        a.Size  = lSize;
                    }
                }
                else
                {
                    string srelative = a.Path.Substring(a.Path.IndexOf('\\') + 1);
                    foreach (string drive in this.StoreDrive)
                    {
                        if (Directory.Exists(drive + srelative))
                        {
                            a.Path  = drive + srelative;
                            bPathUp = true;

                            long lSize = Anime.GetSize(a.Path);
                            if (a.Size != lSize)
                            {
                                bSizeUp = true;

                                lSpace += lSize - a.Size;
                                a.Size  = lSize;
                            }

                            break;
                        }
                    }
                }

                if (bPathUp || bSizeUp)
                {
                    olv.RefreshObject(a);
                    iFresh++;
                }
            }

            this.Space = lSpace;

            if (iFresh > 0)
            {
                base.RefreshInfo(olv, key);
            }
        }