コード例 #1
0
        /// <summary>
        /// Checks whether any conditions exists that should prevent the user from being able to run AddArchiveAsync (no folder chosen, name has already been used etc)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnInputValuesChanged(object sender, System.EventArgs e)
        {
            Archive archiveWithMatchingName = new Archive();

            if (CatalogName != null)
            {
                archiveWithMatchingName = Archives.FirstOrDefault(archiveToCheck => archiveToCheck.Name.Equals(CatalogName));
            }

            bool match = false;

            if (archiveWithMatchingName != null)
            {
                match = true;
            }

            if (addFolderPathText?.Length > 0 && CatalogName?.Length > 0 && !(match) && PercentDone == 0)
            {
                GoEnabled = true;
            }
            else
            {
                GoEnabled = false;
            }
        }