Esempio n. 1
0
 public void addAccount(Account acct)
 {
     if (!this.accounts.Contains(acct)) {
         this.accounts.Add(acct);
     }
     this.main.updateGroups();
 }
Esempio n. 2
0
 public CharSelect(Account acct, object specificIDs)
 {
     InitializeComponent();
     this.acct = acct;
     this.SpecificIDs = string.Format("{0}", specificIDs).Split(',').ToList();
     this.settingsPath = String.Format("{0}\\{1}", this.acct.main.localAppPath(), "settings");
     this.popListFromFile();
     this.popListFromSettings();
     this.checkBoxes();
 }
Esempio n. 3
0
 private void addAccount_Click(object sender, RoutedEventArgs e)
 {
     Account account = new Account(this);
     this.accountsPanel.Children.Add(account);
 }
Esempio n. 4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (Properties.Settings.Default.evePath.Length == 0) {
                string path = null;
                string appdata = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                foreach (string dir in Directory.EnumerateDirectories(Path.Combine(appdata, "CCP", "EVE"), "*_tranquility")) {
                    string[] split = dir.Split(new char[] { '_' }, 2);
                    string drive = split[0].Substring(split[0].Length-1);
                    path = split[1].Substring(0, split[1].Length - "_tranquility".Length).Replace('_', Path.DirectorySeparatorChar);
                    path = drive.ToUpper() + Path.VolumeSeparatorChar + Path.DirectorySeparatorChar + path;
                    break;
                }
                if (path != null && File.Exists(Path.Combine(path, "bin", "ExeFile.exe"))) {
                    Properties.Settings.Default.evePath = path;
                    Properties.Settings.Default.Save();
                }
            }
            this.txtEvePath.Text = Properties.Settings.Default.evePath;

            this.tray = new System.Windows.Forms.NotifyIcon();
            this.tray.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ResourceAssembly.Location);
            this.tray.Text = this.Title;
            this.tray.ContextMenu = new System.Windows.Forms.ContextMenu();
            this.tray.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tray_Click);
            this.contextMenuClick = new EventHandler(this.contextMenu_Click);

            this.tray.ContextMenu.MenuItems.Add("launch all", this.contextMenuClick);
            this.tray.ContextMenu.MenuItems.Add("-");
            if (Properties.Settings.Default.accounts != null) {
                foreach (string credentials in Properties.Settings.Default.accounts) {
                    Account account = new Account(this);
                    string[] split = credentials.Split(new char[]{':'}, 2);
                    account.username.Text = split[0];
                    account.password.Password = split[1];
                    this.accountsPanel.Children.Add(account);
                    this.tray.ContextMenu.MenuItems.Add(split[0], this.contextMenuClick);
                }
            }

            this.tray.Visible = true;
            this.saveAccounts = true;
        }