示例#1
0
        public string OnAnchorSelect()
        {
            string value = "";
            String id    = this.reference(0);

            if (Regex.IsMatch(id, "^https?://"))
            {
                value = @"\C\![open,browser," + AYATemplate.EscapeText(id) + @"]\e";
            }
            else
            {
                OnAnchorSelect oo = new OnAnchorSelect(this.s, this.header);
                Type           t  = oo.GetType();
                MethodInfo     mi = t.GetMethod(this.reference(0));
                try
                {
                    object o = mi.Invoke(oo, null);
                    value = (string)o;
                }
                catch (NullReferenceException)
                {
                }
            }
            return(value);
        }
示例#2
0
        public string OnMinuteChange()
        {
            string   value = "";
            DateTime now   = DateTime.Now;

            if (now.Hour % 2 == 0)
            {
                switch (now.Minute)
                {
                case 0:
                    this.s.AiTalkCount = 0;
                    value = @"\1\s[100]\0\s[0]" + now.Hour + @"時だ。\_w[500]巡回にいってくるね。\_w[500]\s[999]\_w[500]\1\s[105]いってらっしゃい。\e";
                    break;

                case 3:
                    string headlinename = "偽SiReFaSo";
                    if (this.s.installedheadlinelist.Contains(headlinename))
                    {
                        value = @"\1\s[100]\0\s[0]更新状況だよ。\_w[500]\![execute,headline," + headlinename + @"]\e";
                    }
                    else
                    {
                        value = @"\1\s[100]\0\s[0]%username、\_w[500]\s[5]ボクのフィードを購読してみない?\n\n[half]\_w[500]\_q"
                                + AYATemplate.MenuItem("購読する", "InstallRSS", "http://nikolat.starfree.jp/sirefaso/rss2.xml") + @"\n"
                                + AYATemplate.MenuItem("遠慮しとく", "Menu_CANCEL") + @"\e";
                    }
                    break;

                default:
                    break;
                }
            }
            return(value);
        }
示例#3
0
        public string OnSNTPCompare()
        {
            string value = @"\1\s[100]\0\s[0]\_q"
                           + "before " + AYATemplate.SNTPCompare_StrForm(this.reference(2)) + @"\n"
                           + "after  " + AYATemplate.SNTPCompare_StrForm(this.reference(1)) + @"\n\n"
                           + @"\6Complete.\e";

            return(value);
        }
示例#4
0
        public static string MakeJustText(string text, int size)
        {
            string _text = AYATemplate.MakeLongText(text, size);

            if (_text.CompareTo(text) != 0)
            {
                return(_text);
            }
            return(AYATemplate.MakeShortText(text, size));
        }
示例#5
0
        public string OnInstallRefuse()
        {
            string sakuraname = this.reference(0);
            string value      = "Refused. " + SHIORI3FW.EscapeAllTags(sakuraname) + "'s archive.";

            if (!this.s.ghostexlist.Contains(sakuraname))               // 同時起動していない時
            {
                value += @"\n\n";
                value += AYATemplate.MenuItem("change", "GOYAUTIL_InstallChange", sakuraname, "ghost") + @"\n";
                value += AYATemplate.MenuItem("call", "GOYAUTIL_InstallCall", sakuraname) + @"\n";
                value += AYATemplate.MenuItem("hold", "Menu_CANCEL");
            }
            value = @"\1\s[100]\0\s[0]\_q" + value + @"\e";
            return(value);
        }
示例#6
0
        public string OnHeadlinesense_OnFind()
        {
            string value;

            value  = @"■" + this.sReference(0) + @"\_q\n\n[half]\_n";
            value += this.sReference(3) + @"\_n\n[half]\_q";
            if (Regex.IsMatch(this.reference(2), "^(First|Next)$"))
            {
                value += @"\![*]\q[" + AYATemplate.MakeJustText("next page", 46) + ",]\n";
            }
            value += AYATemplate.MenuItem("open browser", this.reference(1)) + @"\n";
            value += AYATemplate.MenuItem("cancel", "Menu_CANCEL");
            value  = @"\1\s[100]\0\b[2]\s[0]\_q" + value + @"\e";
            return(value);
        }
示例#7
0
        public static string MenuItem(string text, params string[] args)
        {
            string r = @"\![*]\__q[";
            int    i = 0;

            foreach (string arg in args)
            {
                if (i > 0)
                {
                    r += ",";
                }
                r += AYATemplate.EscapeText(arg);
                i++;
            }
            r += "]" + AYATemplate.MakeJustText(text, MENU_TEXT_WIDTH) + @"\__q";
            return(r);
        }
示例#8
0
        public string OnBIFFComplete()
        {
            string value = "";

            if (this.referenceInt(0) == 0)
            {
                value = "Not new.";
            }
            else if (this.referenceInt(0) > 0)
            {
                value  = this.sReference(0) + @" mail come to your mailbox.\n\n[half]";
                value += AYATemplate.MenuItem("open mailer", "OpenMailer") + @"\n";
                value += AYATemplate.MenuItem("calcel", "Menu_CANCEL");
            }
            value = @"\1\s[100]\0\s[0]\_q" + value + @"\e";
            return(value);
        }
示例#9
0
        public string OnInstallComplete()
        {
            string value = "「" + this.sReference(1)
                           + "」/「" + this.sReference(0) + "」installed.";
            string id = Regex.Split(this.reference(0), " with")[0];

            if (Regex.IsMatch(id, "ghost|shell|balloon"))
            {
                value += @"\n\n";
                value += AYATemplate.MenuItem("change", "GOYAUTIL_InstallChange", "lastinstalled", id) + @"\n";
                if (id.CompareTo("ghost") == 0)
                {
                    value += AYATemplate.MenuItem("call", "GOYAUTIL_InstallCall", "lastinstalled") + @"\n";
                }
                value += AYATemplate.MenuItem("hold", "Menu_CANCEL");
            }
            value = @"\1\s[100]\0\s[0]\_q" + value + @"\e";
            return(value);
        }
示例#10
0
        public string OnRSSComplete()
        {
            string value;

            value = @"■" + this.sReference(0) + @"\n\n[half]\_n";
            for (int i = 2; i < this.referenceCount(); i++)
            {
                if (i >= 22)
                {
                    value += @"and more...\n";
                    break;
                }
                string[] _r    = this.reference(i).Split('\u0001');
                string   title = _r.Length > 0 ? _r[0] : "";
                string   url   = _r.Length > 1 ? _r[1] : "";
                string   date  = _r.Length > 2 ? _r[2] : "";
                if (Regex.IsMatch(title, @"(^AD:)|(^PR:)|(\[ *PR *\])"))
                {
                    continue;
                }
                string content = title;
                if (date.CompareTo("") != 0)
                {
                    string[] _datea = date.Split(',');
                    string   month  = _datea.Length > 1 ? _datea[1] : "";
                    string   day    = _datea.Length > 2 ? _datea[2] : "";
                    content = "[" + month + "/" + day + "]" + title;
                }
                value += @"\_a[" + url + @"]"
                         + SHIORI3FW.EscapeAllTags(AYATemplate.MakeJustText(content, 46))
                         + @"\_a\n";
            }
            value += @"\_n\n\n[half]";
            value += AYATemplate.MenuItem("open browser", this.reference(1)) + @"\n";
            value += AYATemplate.MenuItem("cancel", "Menu_CANCEL");
            value  = @"\![set,choicetimeout,-1]\![set,balloontimeout,-1]\1\s[100]\0\b[2]\s[0]\_q" + value + @"\e";
            return(value);
        }
示例#11
0
        public string OnDive()
        {
            string url = "http://www.google.com/images?q=" + Uri.EscapeUriString(this.reference(0));

            return(@"\1\s[100]\0\s[7]とうっ!!\![open,browser," + AYATemplate.EscapeText(url) + "]");
        }