FlatRedBall.Glue.ProjectManager.MakeAbsolute C# (CSharp) Method

MakeAbsolute() public static method

Converts a relative path to an absolute path assuming that the relative path is relative to the base Project's directory. This determines whether to use the base project or the content project according to the extension of the file or whether forceAsContent is true.
public static MakeAbsolute ( string relativePath, bool forceAsContent ) : string
relativePath string The path to make absolute.
forceAsContent bool Whether to force as content - can be passed as true if the file should be treated as content despite its extension.
return string
        public static string MakeAbsolute(string relativePath, bool forceAsContent)
        {
            if (FileManager.IsRelative(relativePath))
            {
                if ((forceAsContent || IsContent(relativePath)))
                {
                    return !relativePath.StartsWith(ContentDirectoryRelative)
                               ? ContentProject.MakeAbsolute(ContentDirectoryRelative + relativePath)
                               : ContentProject.MakeAbsolute(relativePath);
                }
                else
                {
                    return ProjectBase.MakeAbsolute(relativePath);
                }
            }

            return relativePath;
        }

Same methods

ProjectManager::MakeAbsolute ( string relativePath ) : string

Usage Example

示例#1
0
        internal static List <string> GetMemberNamesFrom(ReferencedFileSave rfs)
        {
            List <string> toReturn = new List <string>();


            string fileName = rfs.Name;

            fileName = ProjectManager.MakeAbsolute(fileName);

            RuntimeCsvRepresentation rcr = CsvFileManager.CsvDeserializeToRuntime(
                fileName);


            for (int i = 0; i < rcr.Headers.Length; i++)
            {
                string memberName = rcr.Headers[i].Name;

                if (memberName.Trim().StartsWith("//"))
                {
                    continue;
                }

                memberName = StringFunctions.RemoveWhitespace(memberName);

                if (memberName.Contains("("))
                {
                    memberName = memberName.Substring(0, memberName.IndexOfAny(new char[] { '(' }));
                }

                toReturn.Add(memberName);
            }


            return(toReturn);
        }
All Usage Examples Of FlatRedBall.Glue.ProjectManager::MakeAbsolute