예제 #1
0
파일: Main.cs 프로젝트: karno/Alicium-2.x
		public Main()
		{
            TestCode();
			using (var sp = new Sprash())
			{
				sp.Show();
				InitializeComponent();
				if (version < CheckLatestVersion())
				{
					sp.Close();
					MessageBox.Show("There is an update.");
					System.Diagnostics.Process.Start("https://github.com/a1cn/Alicium-2.x/downloads");
				}
				Accounts = AccountReader.Read("Settings/Accounts.dat");
				if (Accounts.Count != 0)
				{
					AccountsList.Items.AddRange(Accounts.Keys.ToArray());
				}
				else
				{
					sp.Close();
					MessageBox.Show("Accounts not found.Let's authenticate your first account.");
					var m = new AccountManager(Accounts);
					m.ShowDialog();
					if (m.Change)
					{
						Accounts.Clear();
						AccountsList.Items.Clear();
						Accounts = AccountReader.Read("Settings/Accounts.dat");
						if (Accounts.Count != 0)
						{
							AccountsList.Items.AddRange(Accounts.Keys.ToArray());
							AccountsList.SelectedIndex = 0;
						}
					}
				}
				var f = ColumnReader.Load(this);
				for (int i = 0; i < f.Length; i++)
				{
					f[i].TopLevel = false;
					f[i].TopMost = false;
					f[i].Fresh = false;
					f[i].Parent = this;
					f[i].Show();
					f[i].Size = new Size(240, this.Size.Height - 160);
					f[i].Text = f[i].Text.Remove(0, 3);
					f[i].Text = i + ": " + f[i].Text;
					f[i].Location = new Point(240 * i, f[i].Fresh ? 0 : 27);
					f[i].Size = new Size(240, this.Size.Height - 160);
					Columns.Add(f[i]);
				}
				twitterDo = new TwitterDo(this);
				try
				{
					sp.Close();
				}
				catch{}
			}
		}
예제 #2
0
파일: Main.cs 프로젝트: karno/Alicium-2.x
		private bool CodeDo()
		{
			/*
			 * //TEMP:
else if (PostText.Text == "/" || PostText.Text == "/")
            {
                return true;
            }
			 */
			if (PostText.Text == "/exit" || PostText.Text == "/e")
			{
				this.Close();
				return true;
			}
			else if (PostText.Text == "/halt" || PostText.Text == "/h")
			{
				System.Environment.Exit(0);
				return true;
			}
			else if (PostText.Text == "/account" || PostText.Text == "/a")
			{
				AccountManager m = new AccountManager(Accounts);
				m.ShowDialog();
				if (m.Change)
				{
					Accounts.Clear();
					AccountsList.Items.Clear();
					Accounts = AccountReader.Read("Settings/Accounts.dat");
					if (Accounts.Count != 0)
					{
						AccountsList.Items.AddRange(Accounts.Keys.ToArray());
					}
				}
				return true;
			}
			else if (PostText.Text == "/mariari" || PostText.Text == "/m")
			{
				twitterDo.MultiPoster(Mariari.Yakkai);
				return true;
			}
			else if (PostText.Text == "/cannon" || PostText.Text == "/c")
			{
				twitterDo.MultiPoster(Mariari.Cannon);
				return true;
			}
			else if (PostText.Text == "/stealth" || PostText.Text == "/s")
			{
				twitterDo.Post(Mariari.Stealth);
				return true;
			}
			else if (PostText.Text == "/boss" || PostText.Text == "/b")
			{
				this.WindowState = FormWindowState.Minimized;
				this.ShowInTaskbar = false;
				if (MessageBox.Show("上書きしますか?","確認",MessageBoxButtons.OKCancel,MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Cancel)
				{
					this.WindowState = FormWindowState.Normal;
					this.ShowInTaskbar = true;
				}
				else
				{
					System.Environment.Exit(0);
				}
				return true;
			}
			else if (PostText.Text.Contains("/user ") || PostText.Text.Contains("/u "))
			{
				if (NowTokens.Length != 0)
				{
					string view = PostText.Text.Replace("/user ", "").Replace("/u ", "");
					try
					{
						new UserView(view, NowTokens.First().OAuthTokens).Show();
					}
					catch { }
				}
				else
				{
					MConsole.WriteLine("You haven't selected any accounts.");
				}
				return true;
			}
			else
			{
				return false;
			}
		}
예제 #3
0
파일: Main.cs 프로젝트: karno/Alicium-2.x
		private void accountsToolStripMenuItem_Click(object sender, EventArgs e)
		{
			AccountManager m = new AccountManager(Accounts);
			m.ShowDialog();
			if (m.Change)
			{
				Accounts.Clear();
				AccountsList.Items.Clear();
				Accounts = AccountReader.Read("Settings/Accounts.dat");
				if (Accounts.Count != 0)
				{
					AccountsList.Items.AddRange(Accounts.Keys.ToArray());
				}
			}
		}
예제 #4
0
 private bool CodeDo()
 {
     /*
      * //TEMP:
      * else if (PostText.Text == "/" || PostText.Text == "/")
      * {
      * return true;
      * }
      */
     if (PostText.Text == "/exit" || PostText.Text == "/e")
     {
         this.Close();
         return(true);
     }
     else if (PostText.Text == "/halt" || PostText.Text == "/h")
     {
         System.Environment.Exit(0);
         return(true);
     }
     else if (PostText.Text == "/account" || PostText.Text == "/a")
     {
         AccountManager m = new AccountManager(Accounts);
         m.ShowDialog();
         if (m.Change)
         {
             Accounts.Clear();
             AccountsList.Items.Clear();
             Accounts = AccountReader.Read("Settings/Accounts.dat");
             if (Accounts.Count != 0)
             {
                 AccountsList.Items.AddRange(Accounts.Keys.ToArray());
             }
         }
         return(true);
     }
     else if (PostText.Text == "/mariari" || PostText.Text == "/m")
     {
         twitterDo.MultiPoster(Mariari.Yakkai);
         return(true);
     }
     else if (PostText.Text == "/cannon" || PostText.Text == "/c")
     {
         twitterDo.MultiPoster(Mariari.Cannon);
         return(true);
     }
     else if (PostText.Text == "/stealth" || PostText.Text == "/s")
     {
         twitterDo.Post(Mariari.Stealth);
         return(true);
     }
     else if (PostText.Text == "/boss" || PostText.Text == "/b")
     {
         this.WindowState   = FormWindowState.Minimized;
         this.ShowInTaskbar = false;
         if (MessageBox.Show("上書きしますか?", "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Cancel)
         {
             this.WindowState   = FormWindowState.Normal;
             this.ShowInTaskbar = true;
         }
         else
         {
             System.Environment.Exit(0);
         }
         return(true);
     }
     else if (PostText.Text.Contains("/user ") || PostText.Text.Contains("/u "))
     {
         if (NowTokens.Length != 0)
         {
             string view = PostText.Text.Replace("/user ", "").Replace("/u ", "");
             try
             {
                 new UserView(view, NowTokens.First().OAuthTokens).Show();
             }
             catch { }
         }
         else
         {
             MConsole.WriteLine("You haven't selected any accounts.");
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }