예제 #1
0
 /// <summary>
 /// Lädt die gespeicherten Standards in die Form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnRestoreDefaults_Click(object sender, EventArgs e)
 {
     if (Supporter.AreDefaultsValid())
     {
         RestoreDefault();
     }
 }
예제 #2
0
        /// <summary>
        /// Checkt, ob Notify lauffähig ist und verändert 'NotifyIsExecutable' dementsprechend.
        /// </summary>
        /// <param name="focus"></param>
        /// <returns></returns>
        public bool CheckStatus(bool focus = false)
        {
            // FilePath
            // LogPath
            // FileURL
            // UserToken
            // UserTokenList
            // Defaults
            List <bool> configList = new List <bool>();

            configList.Add(File.Exists(Settings.Default.filePath));
            configList.Add(File.Exists(Settings.Default.logFilePath));
            configList.Add(Settings.Default.SettingUseLocalFile ? true : !string.IsNullOrEmpty(Settings.Default.fileURL));
            configList.Add(!string.IsNullOrEmpty(Settings.Default.userToken));
            configList.Add(TokenIDs.Length >= 1);
            configList.Add(Supporter.AreDefaultsValid());
            if (focus)
            {
                for (int i = 0; i < configList.Count; i++)
                {
                    if (!configList[i])
                    {
                        HelpUser(i);
                    }
                }
                foreach (bool configItem in configList)
                {
                    if (!configItem)
                    {
                        NotifyIsExecutable = false;
                    }
                }
                NotifyIsExecutable = true;
                return(true);
            }
            else
            {
                foreach (bool configItem in configList)
                {
                    if (!configItem)
                    {
                        NotifyIsExecutable = false;
                    }
                    return(false);
                }
                NotifyIsExecutable = true;
                return(true);
            }
        }