Exemple #1
0
        public bool add_page()
        {
            try
            {
                Target_Path target = new Target_Path();
                //InternetExplorer explorer = get_browser();
                //if (explorer == null)
                //    return false;

                target.path = (string)Automation.execute("standard.grab_text");

                Generic_Form form = new Generic_Form(target, "new web page");

                if (form.ShowDialog() == DialogResult.OK)
                {
                    pages.Add(target.command, target);
                    save_dictionary(pages, Global.configuration.settings_path("web_pages.xml"));
                    Automation.reload();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                Feedback.print(ex);
            }
            return(false);
        }
Exemple #2
0
        public bool add_folder()
        {
            try
            {
                Target_Path target = new Target_Path();

                Automation.sendkeys("%d^a");
                target.path = (string)Automation.execute("standard.grab_text");

                Generic_Form form = new Generic_Form(target, "new folder");

                if (form.ShowDialog() == DialogResult.OK)
                {
                    folders.Add(target.command, target);
                    save_dictionary(folders, Global.configuration.settings_path("folders.xml"));
                    Automation.reload();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                Feedback.print(ex);
            }
            return(false);
        }
Exemple #3
0
        public void replace_regular_expression()
        {
            Regular_Expression_Dialog result = new Regular_Expression_Dialog();
            Generic_Form form = new Generic_Form(result, "new folder");

            if (form.ShowDialog() == DialogResult.OK)
            {
                TextDocument document = get_document();
            }
        }
        public static void add_word_dialog(string grammar, string old_word)
        {
            string[]          split     = grammar.Split('#');
            Familiar_Document document  = Familiar_Document.find_document(split[0]);
            string            rule_name = "";

            if (split.Length > 1)
            {
                rule_name = split[1];
            }
            else
            {
                rule_name = "rule_name";
            }

            Element_Word word = null;

            if (old_word != null && old_word != "")
            {
                word = document.get_word(old_word, rule_name);
            }
            else
            {
                word = new Element_Word();
            }

            Generic_Form dialog = new Generic_Form(word, "Add New Word");

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                if (old_word == null || old_word == "")
                {
                    document.add_word(word, rule_name);
                }
                document.save();
                reload();
            }
            catch (Exception ex)
            {
                Feedback.print(ex);
            }
        }