コード例 #1
0
ファイル: Generation.cs プロジェクト: brainlara/wf2owfn
        /// <summary>
        /// Writes the compiled petri net to a file in a given format
        /// </summary>
        /// <param name="format">The format of the file (currently 'owfn', 'png', 'dot')</param>
        /// <param name="filename">The output filename</param>
        /// <exception cref="System.IO.IOException">Thrown when an error occurs during writing to the output file</exception>
        /// <exception cref="System.Security.SecurityException">Thrown if the user has no rights to access temporary path</exception>
        /// <exception cref="System.ComponentModel.Win32Exception">Thrown when an error occurs calling external APIs</exception>
        /// <exception cref="System.ArgumentException">Thrown when an unsupported <c>format</c> was supplied</exception>
        public void WriteOutput(String filename, String format)
        {
            switch (format)
            {
            case "owfn":
                net.OutputOwfn(filename);
                break;

            case "png":
                net.outputPng(filename);
                break;

            case "dot":
                net.outputDot(filename);
                break;

            default:
                throw new ArgumentException("Unknown or unsupported output format");
            }
        }