示例#1
0
        private static void SetProcess(string command, ExifArgument arg)
        {
            exiftool = new Process();
            string ExiftoolName = "";

			if (ProjectManager.RunningPlatform == Platform.Windows) { ExiftoolName = Path.Combine(Directory.GetCurrentDirectory(), "exiftool.exe"); }
            else if (ProjectManager.RunningPlatform == Platform.Unix || ProjectManager.RunningPlatform == Platform.MacOSX) { ExiftoolName = "/usr/bin/exiftool"; }
            else { throw new PlatformNotSupportedException(); }

            ProcessStartInfo exiftoolStartInfo = new ProcessStartInfo(ExiftoolName, command);
            exiftool.EnableRaisingEvents = false;
            exiftoolStartInfo.UseShellExecute = false;
            exiftoolStartInfo.CreateNoWindow = true;
            exiftoolStartInfo.RedirectStandardError = false;
            exiftoolStartInfo.WindowStyle = ProcessWindowStyle.Hidden;

            switch (arg)
            {
                case ExifArgument.Metadata:
                    exiftoolStartInfo.RedirectStandardOutput = true;
                    break;
                case ExifArgument.Thumbnails:
                    exiftoolStartInfo.RedirectStandardOutput = true;
                    exiftoolStartInfo.RedirectStandardInput = true;
                    exiftoolStartInfo.StandardOutputEncoding = Encoding.UTF8;
                    break;
            }
            exiftool.StartInfo = exiftoolStartInfo;
        }
示例#2
0
        private static void SetProcess(string command, ExifArgument arg)
        {
            exiftool = new Process();
            string ExiftoolName = "";

            if (ProjectManager.RunningPlatform == Platform.Windows) { ExiftoolName = Path.Combine(Directory.GetCurrentDirectory(), "exiftool.exe"); }
            else if (ProjectManager.RunningPlatform == Platform.Unix || ProjectManager.RunningPlatform == Platform.MacOSX) { ExiftoolName = "/usr/bin/exiftool"; }
            else { throw new PlatformNotSupportedException(); }

            ProcessStartInfo exiftoolStartInfo = new ProcessStartInfo(ExiftoolName, command);
            exiftool.EnableRaisingEvents = false;
            exiftoolStartInfo.UseShellExecute = false;
            exiftoolStartInfo.CreateNoWindow = true;
            exiftoolStartInfo.RedirectStandardError = false;
            exiftoolStartInfo.WindowStyle = ProcessWindowStyle.Hidden;

            switch (arg)
            {
                case ExifArgument.Metadata:
                    exiftoolStartInfo.RedirectStandardOutput = true;
                    break;
                case ExifArgument.Thumbnails:
                    exiftoolStartInfo.RedirectStandardOutput = true;
                    exiftoolStartInfo.RedirectStandardInput = true;
                    exiftoolStartInfo.StandardOutputEncoding = Encoding.UTF8;
                    break;
            }
            exiftool.StartInfo = exiftoolStartInfo;
        }