Beispiel #1
0
        public bool Load()
        {
            if (!this.ConfirmExists)
            {
                return(false);
            }
            if (this.FileDate != File.GetLastWriteTime(this.FilePath))
            {
                this.toStringDirty     = true;
                this.searchStringDirty = true;

                TrackWriter.GetTags(this);

                FileInfo fi = new FileInfo(this.FilePath);
                this.FileSize = fi.Length;
                this.FileDate = fi.LastWriteTime;

                if (Setting.MoveNewFilesIntoMain)
                {
                    this.ChangeType  |= (ChangeType.Rename | ChangeType.Move | ChangeType.IgnoreContainment);
                    this.RenameFormat = Setting.DefaultRenameFormat;
                    TrackWriter.AddToUnsavedTracks(this);
                }
                else if (Setting.KeepOrganized)
                {
                    this.ChangeType  |= (ChangeType.Rename | ChangeType.Move);
                    this.RenameFormat = Setting.DefaultRenameFormat;
                    TrackWriter.AddToUnsavedTracks(this);
                }

                if (this.Type == FileType.None)
                {
                    return(false);
                }

                UpdateMainGroup();

                Database.IncrementDatabaseVersion(false);

                System.Threading.Thread.Sleep(0);
            }
            return(true);
        }