Exemple #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (Cmd.States.Silent)
            {
                this.Hide();
            }

            Init.Start();
            SqlManager.Connect();

            IconManager = new TrayIconManager(TrayIcon);

            Log.Destination = LogBox;
            Log.Debug       = Cmd.States.Debug;

            MainStats.ConnectionsChange      += new MainStats.EventInt(MainStats_ConnectionsChange);
            MainStats.Downloaded             += new MainStats.EventLong(MainStats_Downloaded);
            MainStats.FileDownloaded         += new MainStats.EventInt(MainStats_FileDownloaded);
            MainStats.FileUploaded           += new MainStats.EventInt(MainStats_FileUploaded);
            MainStats.Uploaded               += new MainStats.EventLong(MainStats_Uploaded);
            MainStats.ConnectionsChangeTotal += new MainStats.EventInt(MainStats_ConnectionsChangeTotal);
            MainStats.CacheUsed              += new MainStats.EventLong(MainStats_CacheUsed);
            MainStats.FileInCache            += new MainStats.EventInt(MainStats_FileInCache);
            MainStats.Pendingfiles           += new MainStats.EventInt(MainStats_Pendingfiles);
            MainStats.CacheUsedPercent       += new MainStats.EventDouble(MainStats_CacheUsedPercent);
            MainStats.KAlive += new MainStats.EventInt(MainStats_KAlive);

            MainStats.Start();
            GCollector.Start();
        }
Exemple #2
0
        public void Start()
        {
            Init.Start();
            SqlManager.Connect();
            MainStats.Start();
            GCollector.Start();

            if (string.IsNullOrEmpty(IniParser.Get("useruid")) || string.IsNullOrEmpty(IniParser.Get("userkey")))
            {
                Console.Write("Enter UserID: ");
                Settings.UserID = Console.ReadLine();

                Console.Write("Enter UserKey: ");
                Settings.UserKey = Console.ReadLine();


                IniParser.InsertMissing("useruid", Settings.UserID);
                IniParser.InsertMissing("userkey", Settings.UserKey);
                IniParser.Save();
            }
            else
            {
                Settings.UserID  = IniParser.Get("useruid");
                Settings.UserKey = IniParser.Get("userkey");
            }

            new Thread(new ThreadStart(Check)).Start();
        }