示例#1
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modifierItems)
        {
            string service = null;
            string icon    = Icon;
            string method  = "default";

            int    len  = GetMessageLength((items.First() as ITextItem).Text);
            string body = MessageWithoutTrigger((items.First() as ITextItem).Text);

            if (len < 140 && (modifierItems.First() as PingFMServiceItem).Method.Contains("microblog"))
            {
                method = "microblog";
            }
            else
            {
                method = "status";
            }

            service = (modifierItems.First() as PingFMServiceItem).Id;
            icon    = (modifierItems.First() as PingFMServiceItem).Icon;

            Services.Application.RunOnThread(() => {
                PingFM.Post(method, body, service, null, icon);
            });

            yield break;
        }
示例#2
0
        void UpdateButtons()
        {
            string appkey = appkey_entry.Text;
            bool   valid  = PingFM.TryConnect(appkey);

            Gtk.Application.Invoke(delegate {
                if (valid)
                {
                    validate_lbl.Markup       = "<i>Account validation succeeded!</i>";
                    PingFM.Preferences.AppKey = appkey_entry.Text;
                }
                else
                {
                    validate_lbl.Markup = "<i>Account validation failed!</i>";
                }
                validate_btn.Sensitive = true;
            });
        }