Пример #1
0
        public void AddBouttonInfo(string data)
        {
            Debug.WriteLine("AddBouttonInfo >> " + data);
            JObject obj   = JObject.Parse(data);
            JToken  tabsT = GridsList.GetValue("grids");

            ((JToken)(GridsList["grids"][tabControler.SelectedIndex]["buttons"])).Children().Last <JToken>().AddAfterSelf(obj);
        }
Пример #2
0
        private void UpdateTabInfo(int index)
        {
            Debug.WriteLine("Index Page >> " + index);
            JToken        tabsT = GridsList.GetValue("grids");
            List <JToken> tabs  = tabsT.ToList <JToken>();

            RG02_box.Text  = tabs[index]["name"].Value <string>();
            RG03_box.Text  = tabs[index]["icon"].Value <string>();
            RG04_box.Text  = tabs[index]["style"].Value <string>();
            RG05_num.Value = tabs[index]["width"].Value <int>();
            HideInfoButton();
            for (int i = 0; i < tabControler.Controls.Count; i++)
            {
                try { ((WebBrowser)tabControler.Controls[i].Controls[0]).Document.InvokeScript("UnselectAll"); } catch (Exception error) { }
            }
        }
Пример #3
0
        private void loadGrids()
        {
            string macrofile = System.IO.File.ReadAllText(Program.configDirectory + "\\macros.json");
            string gridsfile = System.IO.File.ReadAllText(Program.configDirectory + "\\grids.json");

            MacroList = JObject.Parse(macrofile);
            GridsList = JObject.Parse(gridsfile);
            tabControler.Controls.RemoveAt(tabControler.SelectedIndex);
            JToken        tabsT = GridsList.GetValue("grids");
            List <JToken> tabs  = tabsT.ToList <JToken>();
            int           index = 0;

            foreach (JToken tab in tabs)
            {
                setTabContent(tab);
                index++;
            }
            UpdateTabInfo(0);
            HideInfoButton();
        }
Пример #4
0
        private void WebObj_DocumentCompleted1(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            WebBrowser web = ((WebBrowser)sender);
            //web.Document.InvokeScript("eval", new[] { "document.onkeydown = function(e) { if (e.keyCode === 116) { return false; } else if (e.keyCode === 8) { return false; } };" });
            //try { web.Document.InvokeScript("eval", new[] { "document.oncontextmenu = function(e){e.preventDefault(); return false;};" }); } catch (Exception error) { }
            string        tag   = (string)(web.Tag);
            JToken        tabsT = GridsList.GetValue("grids");
            List <JToken> tabs  = tabsT.ToList <JToken>();
            string        end   = "";
            int           index = 0;

            foreach (JToken tab in tabs)
            {
                if (tab["id"].Value <string>() == tag)
                {
                    end = JsonConvert.SerializeObject(tab);
                }
                index++;
            }
            try { web.Document.InvokeScript("injectData", new[] { end, (Program.configDirectory + "\\Images\\").Replace("\\", "/") }); } catch (Exception error) { }
        }
Пример #5
0
        public void UpdateBouttonInfo(string id)
        {
            JToken        tabsT = GridsList.GetValue("grids");
            List <JToken> tabs  = tabsT.ToList <JToken>();
            List <JToken> btns  = tabs[tabControler.SelectedIndex]["buttons"].ToList <JToken>();

            foreach (JToken btn in btns)
            {
                if (btn["id"].Value <string>() == id)
                {
                    ShowInfoButton();
                    RG09_box.Text   = id;
                    RG10_box.Text   = btn["name"].Value <string>();
                    RG11_Num1.Value = btn["width"].Value <int>();
                    RG11_Num2.Value = btn["height"].Value <int>();
                    RG12_box.Text   = btn["icon"].Value <string>();
                    RG13_box.Text   = btn["style"].Value <string>();
                    RG14_box.Text   = btn["sound"].Value <string>();
                    RG15_box.Text   = btn["macro"].Value <string>();
                }
            }
        }