예제 #1
0
        public Column ToColumn(Main m)
        {
            var v = new Twitterizer.Streaming.StreamOptions();

            v.Track.AddRange(Rc.CutString(",", Track));
            v.Follow.AddRange(Rc.CutString(",", Follow));
            try
            {
                if (Image == "null")
                {
                    return(new Column(new Twitterizer.Streaming.TwitterStream(m.Accounts[AccountName].OAuthTokens, "Alicium", v), ColumnType, Tille));
                }
                else
                {
                    using (var f = File.OpenRead(Image))
                    {
                        var b = Bitmap.FromStream(f);
                        return(new Column(new Twitterizer.Streaming.TwitterStream(m.Accounts[AccountName].OAuthTokens, "Alicium", v), ColumnType, Tille, (Image)b.Clone()));
                    }
                }
            }
            catch
            {
                MessageBox.Show("Can't find " + AccountName + " from accounts data.Please authenticate again.", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false);
                return(null);
            }
        }
예제 #2
0
        public static Dictionary <string, ExtendedOAuthTokens> Read(string path)
        {
            if (!File.Exists(path))
            {
                new FileInfo(path).Directory.Create();
                File.Create(path).Dispose();
            }
            var d    = new Dictionary <string, ExtendedOAuthTokens>();
            var read = Rc.CutString(";", Rc.loadData(path));

            foreach (var s in read)
            {
                var add = new ExtendedOAuthTokens().Create(Rc.CutString(",", s)[1], Rc.CutString(",", s)[2], Rc.CutString(",", s)[0]);
                d[Rc.CutString(",", s)[0]] = add;
            }
            return(d);
        }
예제 #3
0
 private void debugDToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TwitterStatus[][] t = new TwitterStatus[Main.Columns.Count][];
     for (int i = 0; i < Main.Columns.Count; i++)
     {
         t[i] = Main.Columns[i].timeline.ToArray();
     }
     OAuthTokens[] o = new OAuthTokens[ExtendedOAuthTokens.Tokens.Count];
     for (int j = 0; j < ExtendedOAuthTokens.Tokens.Count; j++)
     {
         o[j] = ExtendedOAuthTokens.Tokens[j].OAuthTokens;
     }
     if (EditingPath != null)
     {
         string copy = "Scripts/" + Rc.CutString("\\", EditingPath)[Rc.CutString("\\", EditingPath).Length - 1];
         try { File.Copy(EditingPath, copy); }
         catch { }
         Script.Run(Rc.CutString(".", Rc.CutString("\\", EditingPath)[Rc.CutString("\\", EditingPath).Length - 1])[0], this.textBox1.Text, new Action <object>(Get), new Arg().SetArgValue(t, "Tweets"), new Arg().SetArgValue(o, "Accounts"));
     }
 }