Пример #1
0
        public MainFrm()
        {
            InitializeComponent();

            var version = Program.Version.ToCharArray();

            Text = "DevPro" + " v" + version[0] + "." + version[1] + "." + version[2] + " r" + Program.Version[3];

            LauncherHelper.LoadBanlist();

            var loginTab = new TabPage("Login");

            m_loginWindow = new LoginFrm();
            loginTab.Controls.Add(m_loginWindow);
            mainTabs.TabPages.Add(loginTab);

            m_wcsBrowser = new Browser_frm();
            m_wcsBrowser.FormBorderStyle = FormBorderStyle.None;
            m_chatWindow                 = new ChatFrm();
            GameWindow                   = new HubGameList_frm();
            m_rankingWindow              = new RankingFrm();
            m_devpointWindow             = new SupportFrm();
            m_filemanagerWindow          = new FileManagerFrm();
            m_customizerWindow           = new CustomizeFrm();
            m_faqBrowser                 = new Browser_frm();
            m_faqBrowser.FormBorderStyle = FormBorderStyle.None;

            Program.ChatServer.ServerMessage += ServerMessage;

            mainTabs.SelectedIndexChanged += TabChange;

            ApplyTranslation();
        }
Пример #2
0
        public MainFrm()
        {
            InitializeComponent();

            var version = Program.Version.ToCharArray();
            Text = "DevPro" + " v" + version[0] + "." + version[1] + "." + version[2] + " r" + Program.Version[3];

            LauncherHelper.LoadBanlist();

            var loginTab = new TabPage("Login");
            m_loginWindow = new LoginFrm();
            loginTab.Controls.Add(m_loginWindow);
            mainTabs.TabPages.Add(loginTab);

            m_wcsBrowser = new Browser_frm();
            m_wcsBrowser.FormBorderStyle = FormBorderStyle.None;
            m_chatWindow = new ChatFrm();
            GameWindow = new HubGameList_frm();
            m_devpointWindow = new SupportFrm();
            m_filemanagerWindow = new FileManagerFrm();
            m_customizerWindow = new CustomizeFrm();
            m_faqBrowser = new Browser_frm();
            m_faqBrowser.FormBorderStyle = FormBorderStyle.None;

            Program.ChatServer.ServerMessage += ServerMessage;

            mainTabs.SelectedIndexChanged += TabChange;

            ApplyTranslation();
        }
Пример #3
0
        public MainFrm()
        {
            InitializeComponent();

            var version = Program.Version.ToCharArray();

            Text = "DevPro" + " v" + version[0] + "." + version[1] + "." + version[2] + " r" + Program.Version[3];

            LauncherHelper.LoadBanlist();

            var loginTab = new TabPage("Login");

            m_loginWindow = new LoginFrm();
            loginTab.Controls.Add(m_loginWindow);
            mainTabs.TabPages.Add(loginTab);

            m_wcsBrowser = new Browser_frm();
            m_wcsBrowser.FormBorderStyle = FormBorderStyle.None;
            m_chatWindow                 = new ChatFrm();
            GameWindow                   = new HubGameList_frm();
            m_devpointWindow             = new SupportFrm();
            m_filemanagerWindow          = new FileManagerFrm();
            m_customizerWindow           = new CustomizeFrm();
            m_faqBrowser                 = new Browser_frm();
            m_faqBrowser.FormBorderStyle = FormBorderStyle.None;

            Program.ChatServer.ServerMessage += ServerMessage;

            mainTabs.SelectedIndexChanged += TabChange;

            ApplyTranslation();

            //if (!String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserToken) && !String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserSecret))
            //{
            //    DropNetClient dbctrl = new DropNetClient(Program.Config.AppKey, Program.Config.AppSecret);

            //    dbctrl.UserLogin = new DropNet.Models.UserLogin();

            //    dbctrl.UserLogin.Token = Properties.Settings.Default.DropBoxUserToken;
            //    dbctrl.UserLogin.Secret = Properties.Settings.Default.DropBoxUserSecret;

            //    DropBoxController.filesyncAsync();
            //}
        }
Пример #4
0
        public MainFrm()
        {
            InitializeComponent();

            var version = Program.Version.ToCharArray();
            Text = "DevPro" + " v" + version[0] + "." + version[1] + "." + version[2] + " r" + Program.Version[3];

            LauncherHelper.LoadBanlist();

            var loginTab = new TabPage("Login");
            m_loginWindow = new LoginFrm();
            loginTab.Controls.Add(m_loginWindow);
            mainTabs.TabPages.Add(loginTab);

            m_wcsBrowser = new Browser_frm();
            m_wcsBrowser.FormBorderStyle = FormBorderStyle.None;
            m_chatWindow = new ChatFrm();
            GameWindow = new HubGameList_frm();
            m_devpointWindow = new SupportFrm();
            m_filemanagerWindow = new FileManagerFrm();
            m_customizerWindow = new CustomizeFrm();
            m_faqBrowser = new Browser_frm();
            m_faqBrowser.FormBorderStyle = FormBorderStyle.None;
            LauncherHelper.CardManager.Init();

            Program.ChatServer.ServerMessage += ServerMessage;

            mainTabs.SelectedIndexChanged += TabChange;

            ApplyTranslation();

            //if (!String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserToken) && !String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserSecret))
            //{
            //    DropNetClient dbctrl = new DropNetClient(Program.Config.AppKey, Program.Config.AppSecret);

            //    dbctrl.UserLogin = new DropNet.Models.UserLogin();

            //    dbctrl.UserLogin.Token = Properties.Settings.Default.DropBoxUserToken;
            //    dbctrl.UserLogin.Secret = Properties.Settings.Default.DropBoxUserSecret;

            //    DropBoxController.filesyncAsync();
            //}
        }
Пример #5
0
        public static void syncAcc(bool resync)
        {
            //Testing Connection

            try
            {
                Ping pSender = new Ping();

                PingReply pResult = pSender.Send("8.8.8.8");

                if (pResult.Status == IPStatus.Success)
                {
                    Console.WriteLine("Internet available");
                }
                else
                {
                    Exception exc = new Exception("no internetconnection");

                    throw exc;
                }

            }
            catch (Exception)
            {
                MessageBox.Show("Please make sure your connection to the internet is available");
                return;
            }

            DropNetClient dbClient = new DropNetClient(Program.Config.AppKey, Program.Config.AppSecret);
            #if DEBUG
            dbClient.UseSandbox = true;
            #endif

            if (String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserToken) || resync)
            {
                try
                {
                    dbClient.GetToken();
                }
                catch (Exception)
                {

                    throw;
                }

                var url = dbClient.BuildAuthorizeUrl();

                Browser_frm browser = new Browser_frm();
                browser.Navigate(url,false);
                browser.ShowDialog();

                try
                {

                    var accessToken = dbClient.GetAccessToken();

                    MessageBox.Show(accessToken.Token);

                    Properties.Settings.Default.DropBoxUserSecret = accessToken.Secret;
                    Properties.Settings.Default.DropBoxUserToken = accessToken.Token;
                    Properties.Settings.Default.Save();
                    MessageBox.Show("Login Saved");

                }
                catch (Exception)
                {

                    throw;
                }

            }
            else
            {
                MessageBox.Show("already synchronized");
            }
        }