コード例 #1
0
        public override XmlItem OnCommand(XmlItem xml, bool ignoreIfNotExists)
        {
            string action = xml.GetAttribute("action").ToLowerInvariant();

            if(action == "ui.show.preferences")
            {
                Forms.Settings Dlg = new Forms.Settings();
                Dlg.ShowDialog();

                FormMain.EnabledUi();
            }            
            else if (action == "ui.show.about")
            {
                Forms.About dlg = new Forms.About();
                dlg.ShowDialog();
            }
            else if (action == "ui.show.menu")
            {
                FormMain.ShowMenu();
            }
            else
                return base.OnCommand(xml, ignoreIfNotExists);

            return null;
        }
コード例 #2
0
        public override XmlItem OnCommand(XmlItem xml, bool ignoreIfNotExists)
        {
            string action = xml.GetAttribute("action").ToLowerInvariant();

            if (action == "ui.show.preferences")
            {
                if (FormMain != null)
                {
                    FormMain.OnShowPreferences();
                }
            }
            else if (action == "ui.show.about")
            {
                if (FormMain != null)
                {
                    FormMain.OnShowAbout();
                }
            }
            else if (action == "ui.show.menu")
            {
                if (FormMain != null)
                {
                    FormMain.OnShowMenu();
                }
            }
            else
            {
                return(base.OnCommand(xml, ignoreIfNotExists));
            }

            return(null);
        }
コード例 #3
0
        public static void HtmlToCli(string data)
        {
            XmlItem xml = new XmlItem(data);

            string action = xml.GetAttribute("action");

            // Look WebView.cs comment about the Mono bug
            // Core.Send (data);
            // Alternative workaround, send to JS for direct delivery via /api/command/
            // Maybe totally TOCLEAN if i always use a TCP method.
            Gtk.Application.Invoke(delegate {
                string jsStr = CommonUtils.JsonEncode(data);
                string js    = "Eddie.command(\"" + jsStr + "\")";
                m_webBrowser.ExecuteScript(js);
            });
        }