Пример #1
0
        public static bool Exists(string listName)
        {
            #region Preconditions
            if (String.IsNullOrEmpty(listName))
            {
                throw new ArgumentException("listName cannot be null or empty");
            }
            #endregion

            return(ListManager.ListExists(listName));
        }
Пример #2
0
        public static bool IsEmpty(string listName)
        {
            #region Preconditions
            if (String.IsNullOrEmpty(listName))
            {
                throw new ArgumentException("listName cannot be null or empty");
            }
            #endregion

            if (!ListManager.ListExists(listName))
            {
                return(true);
            }
            return(ListManager.GetList(listName).Count == 0);
        }
Пример #3
0
        /// <summary>
        /// Execute the task.
        /// </summary>
        protected override void ExecuteTask()
        {
            base.ExecuteTask();

            if (ListManager.ListExists(NewListName))
            {
                throw new BuildException(string.Format("List with name [{0}] already exists.", NewListName));
            }

            IList <string> newList = ListManager.GetList(NewListName);

            foreach (string val in List)
            {
                newList.Add(val);
            }
        }