public string getSubFolferName(int index) { string[] arr = SubFolderName.Split(';'); if (arr.Length >= index + 1) { return(arr[index]); } return(string.Empty); }
/// <summary> /// Generate URL for the image uploaded on s3 /// </summary> /// <param name="Buketname"></param> /// <param name="folderName"></param> /// <param name="subFolderName"></param> /// <param name="FileName"></param> /// <returns></returns> public static string GenerateURL(string Buketname, FolderName folderName, SubFolderName subFolderName, string FileName) { //S3URL is coming from web.config. string ServiceURL = ConfigurationManager.AppSettings["S3URL"];; if (subFolderName != SubFolderName.None) { return(ServiceURL + folderName + "/" + subFolderName + "/" + FileName); } else { return(ServiceURL + folderName + "/" + FileName); } }
public CloudServiceInfo(string fullServiceName) { var match = Regex.Match(fullServiceName, @"\s*(.*\\)?(\w+)\s*[:]?\s*(\w+)?"); if (match.Success) { SubFolderName = match.Groups[1].ToString(); ServiceName = match.Groups[2].ToString(); BaseClassName = match.Groups[3].ToString(); if (string.IsNullOrEmpty(BaseClassName)) { BaseClassName = AppConfiguration.CloudServiceMainBaseClass; } NamespaceName = string.IsNullOrEmpty(SubFolderName) ? string.Empty : "." + SubFolderName.Substring(0, SubFolderName.Length - 1).Replace(@"\", "."); } }