Пример #1
0
 private void ConfigView_FirmwareVersionChanged(object sender, StringEventArg e)
 {
     SettingsView.FirmwareVersion = e.Value;
 }
Пример #2
0
 void RcpLogEventReceived(object sender, StringEventArg e)
 {
     DisplayMsgString(e.Data);
 }
Пример #3
0
 void RcpLogEventReceived(object sender, StringEventArg e)
 {
     //DisplayMsgString(e.Data);
     //MessageBox.Show(e.Data);
 }
Пример #4
0
        private void Dataload_FileLoaded(object sender, StringEventArg e)
        {
            try
            {
                htmltree = new List <HtmlTag>();

                List <HtmlTag>         current_root = htmltree;
                List <List <HtmlTag> > prev_root    = new List <List <HtmlTag> >();
                List <string>          tags         = new List <string>();
                string temp  = "";
                bool   inTag = false;
                foreach (char c in e.Str)
                {
                    if (c == '<')
                    {
                        temp  = "";
                        inTag = true;
                    }
                    if (inTag)
                    {
                        temp += c;
                    }
                    if (c == '>')
                    {
                        tags.Add(temp);
                        inTag = false;
                    }
                }
                int index = 0;
                foreach (string s in tags)
                {
                    if (!s.StartsWith("</") && s.StartsWith('<') && s.EndsWith('>') && !s.EndsWith("/>"))
                    {
                        int    idclass = s.IndexOf("class=");
                        string c       = "";
                        if (idclass != -1)
                        {
                            c = s.Substring(idclass + 7, s.IndexOf('"', idclass + 7) - idclass - 7);
                        }
                        int    len = (s.IndexOf(' ') != -1) ? (s.IndexOf(' ') - 1) : (s.Length - 2);
                        string t   = s.Substring(1, len);
                        current_root.Add(new HtmlTag(t, c)
                        {
                            Index = index
                        });
                        prev_root.Add(current_root);
                        current_root = current_root[current_root.Count - 1].Inner;
                        index++;
                    }
                    else if (s.StartsWith("</") && s.EndsWith(">"))
                    {
                        current_root = prev_root[prev_root.Count - 1];
                        prev_root.RemoveAt(prev_root.Count - 1);
                    }
                    else if (s.StartsWith("<") && s.EndsWith("/>"))
                    {
                        int    idclass = s.IndexOf("class=");
                        string c       = "";
                        if (idclass != -1)
                        {
                            c = s.Substring(idclass + 7, s.IndexOf('"', idclass + 7) - idclass - 7);
                        }
                        int len = (s.IndexOf(' ') != -1) ? (s.IndexOf(' ') - 1) : (s.Length - 3);
                        current_root.Add(new HtmlTag(s.Substring(1, len), c)
                        {
                            Index = index
                        });
                        index++;
                    }
                }
                if (prev_root.Count != 0)
                {
                    throw new Exception("Wrong HTML file");
                }
                _loadedhtml = e.Str;
                OnTreeViewCreated(htmltree);
            }
            catch (Exception exp)
            {
                OnHtmlDecodeError(exp.Message);
            }
        }
Пример #5
0
 /// <summary>
 /// Fired when a authentication code is recived from the web server
 /// </summary>
 void _httpServer_OAuthCodeRecived(object sender, StringEventArg args)
 {
     StopOAuthRedirectServer();
     OAuthCodeRecived?.Invoke(sender, args);
 }