コード例 #1
0
        static void Main(string[] args)
        {
            RC.Theme = ConsoleColorTheme.Load((ConsoleColor)RC.ForegroundColor, (ConsoleColor)RC.BackgroundColor, ConsoleColorDefaultThemes.Colorful);

            RpxInterface.RunCommand(args);

            RC.ResetColor();
        }
コード例 #2
0
        public MainForm()
        {
            RC.Verbosity       = ConsoleVerbosity.Normal;
            RC.BackgroundColor = ConsoleColorExt.Black;
            RC.Theme           = ConsoleColorTheme.Load(ConsoleColorDefaultThemes.Colorful);

            InitializeComponent();

            title = typeof(MainForm).Assembly.GetName().Name + " v" + typeof(MainForm).Assembly.GetName().Version.Major + "." + typeof(MainForm).Assembly.GetName().Version.Minor;

            SetTitle();

            icons.Add(null);
            icons.Add(GetImage(SystemIcons.Question));
            icons.Add(GetImage(SystemIcons.Asterisk));
            icons.Add(GetImage(SystemIcons.Exclamation));
            icons.Add(GetImage(SystemIcons.Error));
            icons.Add(GetImage(SystemIcons.Information));
            icons.Add(GetImage(SystemIcons.Warning));

            List <ToolStripMenuItem> commandItems = new List <ToolStripMenuItem>();

            foreach (CommandMetaData command in Commands.GetCommands())
            {
                if (command.IsVisible == false)
                {
                    continue;
                }

                if (command.OscAddress == "/time")
                {
                    continue;
                }

                ToolStripMenuItem menuItem = new ToolStripMenuItem(command.Text)
                {
                    Tag = command,
                };

                menuItem.Click += delegate(object menuSender, EventArgs args)
                {
                    ToolStripMenuItem item = menuSender as ToolStripMenuItem;

                    this.SendCommand(connectionsRows, true, item.Tag as CommandMetaData);
                };

                commandItems.Add(menuItem);
            }

            sendCommandToolStripMenuItem.DropDownItems.AddRange(commandItems.ToArray());
        }
コード例 #3
0
        private void Terminal_Load(object sender, EventArgs e)
        {
            m_Console.Theme = ConsoleColorTheme.Load(ConsoleColor.White, ConsoleColor.Black, ConsoleColorDefaultThemes.Colorful);

            m_BackupFont = m_SendMessageBox.Font;

            m_SendMessageBox.Text            = m_HelpText;
            m_SendMessageBox.DropDown       += SendMessageBox_DropDown;
            m_SendMessageBox.DropDownClosed += SendMessageBox_DropDownClosed;

            this.AllowDrop  = true;
            this.DragEnter += new DragEventHandler(Terminal_DragEnter);
            this.DragDrop  += new DragEventHandler(Terminal_DragDrop);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            ConsoleColorState state = RC.ColorState;

            // create the argument parser
            ArgumentParser parser = new ArgumentParser("SettingsObjectModelCodeGenerator", "Generates settings object model code for the ImuApi project");

            StringArgument XmlArg           = new StringArgument("XML", "The path of the settings XML file", "The path of the settings XML file");
            StringArgument CodeArg          = new StringArgument("Code", "The destination code .cs file", "The destination code .cs file");
            StringArgument DocumentationArg = new StringArgument("Documentation", "The documentation .XML file", "The documentation .XML file");

            // add the arguments to the parser
            parser.Add("/", "XML", XmlArg);
            parser.Add("/", "Code", CodeArg);
            parser.Add("/", "Documentation", DocumentationArg);

            try
            {
                RC.IsBuildMode = true;
                RC.Verbosity   = ConsoleVerbosity.Debug;
                RC.ApplicationBuildReportPrefix = "SGEN";

                RC.Theme = ConsoleColorTheme.Load(ConsoleColorDefaultThemes.Colorful);

                RC.WriteLine(ConsoleThemeColor.TitleText, "Settings Object Model Code Generator");

                // parse arguemnts
                parser.Parse(args);

                // did the parser detect a /? arguemnt
                if (parser.HelpMode == true)
                {
                    return;
                }

                if (XmlArg.Defined == false)
                {
                    RC.WriteError(001, "No settings XML file supplied.");
                    return;
                }

                if (CodeArg.Defined == false)
                {
                    RC.WriteError(001, "No destination file supplied.");
                    return;
                }

                if (DocumentationArg.Defined == false)
                {
                    RC.WriteError(001, "No documentation file supplied.");
                    return;
                }

                string xmlFilePath = XmlArg.Value;

                if (File.Exists(xmlFilePath) == false)
                {
                    RC.WriteError(002, "Settings XML file does not exist.");
                    return;
                }

                string codeFilePath = CodeArg.Value;

                try
                {
                    FileInfo info = new FileInfo(codeFilePath);
                }
                catch
                {
                    RC.WriteError(002, "Settings destination file is not valid.");
                    return;
                }

                string documentationFilePath = DocumentationArg.Value;

                try
                {
                    FileInfo info = new FileInfo(documentationFilePath);
                }
                catch
                {
                    RC.WriteError(002, "Settings documentation file is not valid.");
                    return;
                }

                Generate(xmlFilePath, codeFilePath, documentationFilePath);
            }
            catch (Exception ex)
            {
                RC.WriteException(04, System.Reflection.Assembly.GetExecutingAssembly().Location, 0, 0, ex);
            }
            finally
            {
                //RC.PromptForKey("Press any key to exit..", true, false);

                RC.ColorState = state;
            }
        }