コード例 #1
0
ファイル: AppController.cs プロジェクト: rastabrane/Spinnaker
        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();
        }
コード例 #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();
        }