Ejemplo n.º 1
0
        private AppController()
        {
            savedUsernames = new List<string>();
            savedHashtags = new List<string>();
            accounts = new ObservableCollection<Model.Account>();
            accounts.CollectionChanged += accounts_CollectionChanged;
            AppController.version_string = pretty_version.get_nice_version_string();

            startup = new Startup();
            startup.Show();

            try
            {
                if (!Properties.Settings.Default.settings_updated)
                {
                    Properties.Settings.Default.Upgrade();
                    Properties.Settings.Default.settings_updated = true;
                }
            }
            catch
            {
                try
                {
                    Properties.Settings.Default.Reset();
                }
                catch { }
            }

            if (!string.IsNullOrEmpty(Common.api_key) && !string.IsNullOrEmpty(Common.api_secret))
            {
                AppController.api_key = Common.api_key;
                AppController.api_secret = Common.api_secret;
            }
            else if (!string.IsNullOrEmpty(Properties.Settings.Default.api_key) && !string.IsNullOrEmpty(Properties.Settings.Default.api_secret))
            {
                AppController.api_key = Properties.Settings.Default.api_key;
                AppController.api_secret = Properties.Settings.Default.api_secret;
            }
            else
            {
                UserInterface.GetCommonParameter parameter = new GetCommonParameter();
                parameter.Show();
                return;
            }

            startup_completed();
        }
Ejemplo n.º 2
0
        private AppController()
        {
            savedUsernames               = new List <string>();
            savedHashtags                = new List <string>();
            accounts                     = new ObservableCollection <Model.Account>();
            accounts.CollectionChanged  += accounts_CollectionChanged;
            AppController.version_string = pretty_version.get_nice_version_string();

            startup = new Startup();
            startup.Show();

            try
            {
                if (!Properties.Settings.Default.settings_updated)
                {
                    Properties.Settings.Default.Upgrade();
                    Properties.Settings.Default.settings_updated = true;
                }
            }
            catch
            {
                try
                {
                    Properties.Settings.Default.Reset();
                }
                catch { }
            }

            if (!string.IsNullOrEmpty(Common.api_key) && !string.IsNullOrEmpty(Common.api_secret))
            {
                AppController.api_key    = Common.api_key;
                AppController.api_secret = Common.api_secret;
            }
            else if (!string.IsNullOrEmpty(Properties.Settings.Default.api_key) && !string.IsNullOrEmpty(Properties.Settings.Default.api_secret))
            {
                AppController.api_key    = Properties.Settings.Default.api_key;
                AppController.api_secret = Properties.Settings.Default.api_secret;
            }
            else
            {
                UserInterface.GetCommonParameter parameter = new GetCommonParameter();
                parameter.Show();
                return;
            }

            startup_completed();
        }