예제 #1
0
        /// <summary>
        /// Prepares for execution.
        /// </summary>
        void Prepare()
        {
            if (string.IsNullOrWhiteSpace(Exe))
            {
                throw new InvalidOperationException("Invalid VB6 executable.");
            }
            if (string.IsNullOrWhiteSpace(Vbp))
            {
                throw new InvalidOperationException("Invalid VB6 project file.");
            }
            if (string.IsNullOrWhiteSpace(Out))
            {
                throw new InvalidOperationException("Invalid output path.");
            }

            Exe = Exe.Trim().TrimEnd(new[] { '/', '\\' });
            Vbp = Vbp.Trim().TrimEnd(new[] { '/', '\\' });
            Out = Out.Trim().TrimEnd(new[] { '/', '\\' });

            if (File.Exists(Exe) == false)
            {
                throw new FileNotFoundException("Missing VB6 executable.", Exe);
            }
            if (File.Exists(Vbp) == false)
            {
                throw new FileNotFoundException("Missing VB6 project file.", Vbp);
            }

            if (Def == null)
            {
                Def = new Dictionary <string, string>();
            }
        }