Beispiel #1
0
		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{}
			}
		}
Beispiel #2
0
 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 {}
     }
 }