예제 #1
0
        /// <summary>
        ///  Run the program with the specified args.
        /// </summary>
        /// <param name='args'>
        ///  The specified arguments to run the program with.
        /// </param>
        public void Run(string[] args)
        {
            options.Parse(args);
            this.Validate();

            if (this.HelpOrLists)
            {
                if (this.ShowHelp)
                {
                    Console.Error.WriteLine(ProgramManager.ProgramNameVersion);
                    Console.Error.WriteLine("Usage: idpgie [Options]+");
                    Console.Error.WriteLine("IDP-GIE is a Graphical Interactive Environment (GIE) for the IDP system.");
                    Console.Error.WriteLine();
                    Console.Error.WriteLine("Options:");
                    options.WriteOptionDescriptions(Console.Error);
                    Console.Error.WriteLine();
                    Console.Error.WriteLine("Authors:");
                    Console.Error.WriteLine(" idpgie is maintained by Willem Van Onsem <*****@*****.**>");
                    Console.Error.WriteLine(" idp is a program of the KRR Research Group of the KU Leuven <*****@*****.**>.");
                    Console.Error.WriteLine();
                    Console.Error.WriteLine("License:");
                    Console.Error.WriteLine(" Copyright (c) 2014 Willem Van Onsem\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.");
                }
                else if (this.ListDevices)
                {
                    foreach (Tuple <string, string> ss in OutputDevice.ListDevices())
                    {
                        Console.Error.WriteLine("{0}\t{1}", ss.Item1, ss.Item2);
                    }
                }
            }
            else
            {
                //Application.Init ("idpgie", ref args);
                IAlterableReloadableChangeableStream <string> strm;
                string filename;
                if (this.Interactive)
                {
                    strm     = new IdpInteractiveStream(this.IdpFile, this.Theory, this.Structure, this.Vocabulary, this.AspContent, this.HookContent);
                    filename = this.IdpFile;
                }
                else
                {
                    strm     = new AlterableContentChangeableStreamBase <FileStream, string> (new FileStream(this.IdpdFile, FileMode.Open));
                    filename = this.IdpdFile;
                }
                DrawTheory   dt  = new DrawTheory(filename, strm);
                OutputDevice dev = OutputDevice.CreateDevice(this.OutputMode, dt, this);
                dev.Run();
                Application.Quit();
            }
        }
예제 #2
0
        /// <summary>
        ///  Run the program with the specified args. 
        /// </summary>
        /// <param name='args'>
        ///  The specified arguments to run the program with. 
        /// </param>
        public void Run(string[] args)
        {
            options.Parse (args);
            this.Validate ();

            if (this.HelpOrLists) {
                if (this.ShowHelp) {
                    Console.Error.WriteLine (ProgramManager.ProgramNameVersion);
                    Console.Error.WriteLine ("Usage: idpgie [Options]+");
                    Console.Error.WriteLine ("IDP-GIE is a Graphical Interactive Environment (GIE) for the IDP system.");
                    Console.Error.WriteLine ();
                    Console.Error.WriteLine ("Options:");
                    options.WriteOptionDescriptions (Console.Error);
                    Console.Error.WriteLine ();
                    Console.Error.WriteLine ("Authors:");
                    Console.Error.WriteLine (" idpgie is maintained by Willem Van Onsem <*****@*****.**>");
                    Console.Error.WriteLine (" idp is a program of the KRR Research Group of the KU Leuven <*****@*****.**>.");
                    Console.Error.WriteLine ();
                    Console.Error.WriteLine ("License:");
                    Console.Error.WriteLine (" Copyright (c) 2014 Willem Van Onsem\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.");
                } else if (this.ListDevices) {
                    foreach (Tuple<string,string> ss in OutputDevice.ListDevices ()) {
                        Console.Error.WriteLine ("{0}\t{1}", ss.Item1, ss.Item2);
                    }
                }

            } else {
                //Application.Init ("idpgie", ref args);
                IAlterableReloadableChangeableStream<string> strm;
                string filename;
                if (this.Interactive) {
                    strm = new IdpInteractiveStream (this.IdpFile, this.Theory, this.Structure, this.Vocabulary, this.AspContent, this.HookContent);
                    filename = this.IdpFile;
                } else {
                    strm = new AlterableContentChangeableStreamBase<FileStream,string> (new FileStream (this.IdpdFile, FileMode.Open));
                    filename = this.IdpdFile;
                }
                DrawTheory dt = new DrawTheory (filename, strm);
                OutputDevice dev = OutputDevice.CreateDevice (this.OutputMode, dt, this);
                dev.Run ();
                Application.Quit ();
            }
        }