示例#1
0
        private void CreateLink(Item item)
        {
            DeleteLink(item);

            for (int iLink = 0; iLink < item.Links.Count; iLink++)
            {
                LinkItem iterLink = item.Links[iLink];
                ExecuteProcessUtility.Mklink(iterLink.Link, iterLink.Target, false, iterLink.IsDirectory, true);
            }
        }
示例#2
0
 private void DeleteLink(Item item)
 {
     for (int iLink = 0; iLink < item.Links.Count; iLink++)
     {
         LinkItem iterLink = item.Links[iLink];
         if (iterLink.IsDirectory)
         {
             if (Directory.Exists(iterLink.Link))
             {
                 ExecuteProcessUtility.Rmdir(iterLink.Link);
             }
         }
         else
         {
             if (File.Exists(iterLink.Link))
             {
                 File.Delete(iterLink.Link);
             }
         }
     }
 }
示例#3
0
 public Item AddLink(LinkItem link)
 {
     Links.Add(link);
     return(this);
 }