/// <summary>
        /// Return Parent Folder with object
        /// </summary>
        /// <param name="siteSetting">Site Setting</param>
        /// <param name="folder">Folder to retreive</param>
        /// <returns></returns>
        public Folder GetParentFolder(ISiteSetting siteSetting, Folder folder)
        {
            SPBaseFolder spFolder   = folder as SPBaseFolder;
            string       folderPath = spFolder.WebUrl.CombineUrl(spFolder.FolderPath).TrimEnd(new char[] { '/' });

            if (folderPath.Equals(siteSetting.Url, StringComparison.OrdinalIgnoreCase) == true)
            {
                return(null);
            }

            //folderPath = folderPath.Substring(0, folderPath.LastIndexOf('/'));//JD
            folderPath = folderPath.TrimEnd('/');

            ISharePointService spService = new SharePointService();

            if (folder as SPList != null)
            {
                //return spService.GetWeb(siteSetting, folderPath);
                return(spService.GetList(siteSetting, folderPath));
            }
            else if (folder as SPWeb != null)
            {
                return(spService.GetWeb(siteSetting, folderPath));
            }
            else
            {
                if (folder.GetRoot() == folder.GetUrl())
                {
                    return(spService.GetList(siteSetting, folderPath));
                }
                return(spService.GetList(siteSetting, folderPath));
                //return spService.GetFolder(siteSetting, folderPath);
            }
        }
        public Folder GetFolder(ISiteSetting siteSetting, BasicFolderDefinition folderDefinition)
        {
            ISharePointService spService = new SharePointService();

            if (typeof(SPList).FullName.Equals(folderDefinition.FolderType, StringComparison.OrdinalIgnoreCase) == true)
            {
                return(spService.GetList(siteSetting, folderDefinition.FolderUrl));
            }
            else if (typeof(SPWeb).FullName.Equals(folderDefinition.FolderType, StringComparison.OrdinalIgnoreCase) == true)
            {
                return(spService.GetWeb(siteSetting, folderDefinition.FolderUrl));
            }
            else
            {
                return(spService.GetFolder(siteSetting, folderDefinition.FolderUrl));
            }
        }
        public Folder GetWorkflowFolder(ISiteSetting siteSetting, Sobiens.Connectors.Entities.Folder itemFolder, string itemUrl)
        {
            ISharePointService spService = new SharePointService();

            return(spService.GetList(siteSetting, itemFolder.GetWebUrl() + itemFolder.GetRoot()));
        }