Пример #1
0
        // delegate for thread call
        public void CallChangeText()
        {
            FileSystem.ProcessParams p = new FileSystem.ProcessParams();
            p.RootFolder = this.RootPath;
            p.Parameter1 = this.ChangeFrom;
            p.Parameter2 = this.ChangeTo;

            FileSystem.RunRecursive(p, FileSystem.ReplaceFileName);
        }
Пример #2
0
        /// <summary>
        /// Helper method to be called by thread.
        /// </summary>
        public void RunMusicPropChange()
        {
            FileSystem.ProcessParams p = new FileSystem.ProcessParams();
            p.RootFolder = m_rootPath;

            FileSystem.RunRecursive(p, MusicProcessor.SetAlbumCover);
        }
Пример #3
0
        /// <summary>
        /// Helper method to be called by thread.
        /// Everything in this function is executed by the thread.
        /// </summary>
        public void RunImagePropChange()
        {
            FileSystem.ProcessParams p = new FileSystem.ProcessParams();
            p.RootFolder = m_rootPath;

            FileSystem.RunRecursive(p, ImageProcessor.SetImageKeyword);
        }
Пример #4
0
        public void SaveFileCurrent()
        {
            string savePath = null;

            this.ImageOrig.Dispose();

            // substitute old image with new one

            if (this.ImageNew != null)
            {
                File.Delete(this.FilePathOrig);

                // save to original name because name-change comes next

                savePath = this.FilePathOrig;
                savePath = Utility.StringFormat.ChangeFilePathExt(savePath, ".jpg");

                /* Save Test Results
                 *
                 * the original file was 307kb
                 * with code 1, the saved file was 264kb
                 * with code 2, the saved file was 304kb; on a subsequent save, it remained at 304kb

                 // code 1
                 this.ImageNew.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);      */

                // code 2

                ImageProcessor.SaveHighDef(this.ImageNew, savePath);
            }

            // change file name in place

            if (this.FilePathNew != null)
            {
                savePath = this.FilePathNew;
                savePath = FileSystem.GetUniquePath(savePath);

                File.Move(this.FilePathOrig, savePath);
            }

            // create new image keyword

            if (savePath != null)
            {
                FileSystem.ProcessParams p = new FileSystem.ProcessParams();
                p.FilePath = savePath;

                ImageProcessor.SetImageKeyword(p);
            }
        }