コード例 #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
ファイル: ListCopy.cs プロジェクト: Orvid/NAntUniversalTasks
        /// <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);
            }
        }