ActivEarth.Account.EditProfile.getSizedIconPath C# (CSharp) Method

getSizedIconPath() private method

Gets the absolute path to a particular image of named size. Current sizes: - icon: a 150x150 icon for the user
private getSizedIconPath ( int userID, string sizeName, string fileExtension ) : string
userID int The ID of the user.
sizeName string The name of the icon size.
fileExtension string The extension of the file to retrieve the path for.
return string
        private string getSizedIconPath(int userID, string sizeName, string fileExtension)
        {
            string imgName = userID + fileExtension;

            string path = imageDirPath(sizeName);
            string uploadDir = userImageDirPath(sizeName, userID);
            string uploadPath = uploadDir + imgName;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            if (!Directory.Exists(uploadDir))
            {
                Directory.CreateDirectory(uploadDir);
            }

            return uploadPath;
        }