Esempio n. 1
0
 /// <summary>
 /// Deletes a release folder
 /// </summary>
 /// <param name="parentFolderPath">Release folder path</param>
 /// <param name="folderToDelete"></param>
 /// <returns></returns>
 public Boolean Delete(String parentFolderPath, String folderToDelete)
 {
     TDAPIOLELib.ReleaseFolder        releaseFolder        = GetNodeObject(parentFolderPath + "\\" + folderToDelete);
     TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = tDConnection.ReleaseFolderFactory;
     releaseFolderFactory.RemoveItem(releaseFolder.ID);
     return(true);
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a release folder
 /// </summary>
 /// <param name="parentFolder">TDAPIOLELib.ReleaseFolder Object</param>
 /// <param name="newFolderName">New Folder Name</param>
 /// <returns>TDAPIOLELib.ReleaseFolder Object</returns>
 public TDAPIOLELib.ReleaseFolder Create(TDAPIOLELib.ReleaseFolder parentFolder, String newFolderName)
 {
     TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = parentFolder.ReleaseFolderFactory;
     parentFolder      = releaseFolderFactory.AddItem(System.DBNull.Value);
     parentFolder.Name = newFolderName;
     parentFolder.Post();
     return(parentFolder);
 }
Esempio n. 3
0
        /// <summary>
        /// Creates a release folder
        /// </summary>
        /// <param name="parentFolderPath"></param>
        /// <param name="newFolderName"></param>
        /// <returns></returns>
        public TDAPIOLELib.ReleaseFolder Create(String parentFolderPath, String newFolderName)
        {
            TDAPIOLELib.ReleaseFolder releaseFolder = GetNodeObject(parentFolderPath);

            TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = releaseFolder.ReleaseFolderFactory;
            releaseFolder      = releaseFolderFactory.AddItem(System.DBNull.Value);
            releaseFolder.Name = newFolderName;
            releaseFolder.Post();
            return(releaseFolder);
        }
Esempio n. 4
0
        /// <summary>
        /// Get the Child Folder names for the release
        /// </summary>
        /// <param name="folderPath">Path of the folder to search for the release</param>
        /// <returns>List of release folder names</returns>
        public List <String> GetChildFolderNames(String folderPath)
        {
            List <String> relFolderNames = new List <string>();

            TDAPIOLELib.ReleaseFolder        releaseFolder        = GetNodeObject(folderPath);
            TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = releaseFolder.ReleaseFolderFactory;
            foreach (TDAPIOLELib.ReleaseFolder rf in releaseFolderFactory.NewList(""))
            {
                relFolderNames.Add(rf.Name);
            }

            return(relFolderNames);
        }
Esempio n. 5
0
        /// <summary>
        /// Get the path of the release folder
        /// </summary>
        /// <param name="releaseFolder">TDAPIOLELib.ReleaseFolder Object</param>
        /// <returns>Path of the release folder</returns>
        public String GetPath(TDAPIOLELib.ReleaseFolder releaseFolder)
        {
            TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = tDConnection.ReleaseFolderFactory;

            String Path = "";

            while (releaseFolder.ID != releaseFolderFactory.Root.ID)
            {
                Path          = Path + releaseFolder.Name + "\\";
                releaseFolder = releaseFolder.Parent;
            }

            return(reversePath(Path + "Releases"));
        }
Esempio n. 6
0
        /// <summary>
        /// Converts folder path string to TDAPIOLELib.ReleaseFolder
        /// <para/> retruns TDAPIOLELib.ReleaseFolder object
        /// </summary>
        /// <param name="folderPath">Releases folder path</param>
        /// <returns>TDAPIOLELib.ReleaseFolder object</returns>
        public TDAPIOLELib.ReleaseFolder GetNodeObject(String folderPath)
        {
            TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = tDConnection.ReleaseFolderFactory;
            TDAPIOLELib.ReleaseFolder        releaseFolder        = releaseFolderFactory.Root;

            foreach (String Folder in folderPath.Split('\\'))
            {
                if (!(Folder.ToUpper() == "RELEASES"))
                {
                    releaseFolder = GetChildFolderWithName(releaseFolder, Folder);
                }
            }

            return(releaseFolder);
        }
Esempio n. 7
0
        /// <summary>
        /// Finds a Release Folder with name
        /// </summary>
        /// <param name="releaseFolder">TDAPIOLELib.ReleaseFolder Object</param>
        /// <param name="Name">Name of the folder to be serached</param>
        /// <returns>TDAPIOLELib.ReleaseFolder Object</returns>
        public TDAPIOLELib.ReleaseFolder GetChildFolderWithName(TDAPIOLELib.ReleaseFolder releaseFolder, String Name)
        {
            TDAPIOLELib.ReleaseFolderFactory releaseFolderFactory = releaseFolder.ReleaseFolderFactory;
            TDAPIOLELib.TDFilter             tDFilter             = releaseFolderFactory.Filter;
            tDFilter["RF_NAME"] = Name;

            TDAPIOLELib.List list = tDFilter.NewList();
            if (list.Count > 0)
            {
                return(list[1]);
            }
            else
            {
                return(null);
            }
        }