src/Misc/EFTools/EntityDesign/UI/ViewModels/PropertyWindow/Converters/ExtensibleFileListConverter.cs
// <summary>
//     We take the full path and create macros out of the user and VS dirs. This allows us to understand where the file is semantically without
//     being bound to a full path that is specific to one user's box.
// </summary>
We take the full path and create macros out of the user and VS dirs. This allows us to understand where the file is semantically without
being bound to a full path that is specific to one user's box.
We take the full path and create macros out of the user and VS dirs . This allows us to understand where the file is semantically without being bound to a full path that is specific to one user ' s box .
protected static string MacroizeFilePath(string fullPath)
        {
            var userEFToolsIndex = fullPath.IndexOf(ExtensibleFileManager.UserEFToolsDir.FullName, StringComparison.OrdinalIgnoreCase);
            var vsEFToolsIndex = fullPath.IndexOf(ExtensibleFileManager.VSEFToolsDir.FullName, StringComparison.OrdinalIgnoreCase);
            if (userEFToolsIndex != -1)
            {
                var restOfPath = fullPath.Substring(userEFToolsIndex + ExtensibleFileManager.UserEFToolsDir.FullName.Length).TrimStart('\\');
                return Path.Combine(
                    String.Format(CultureInfo.InvariantCulture, "$({0})", ExtensibleFileManager.EFTOOLS_USER_MACRONAME), restOfPath);
            }
            else if (vsEFToolsIndex != -1)
            {
                var restOfPath = fullPath.Substring(vsEFToolsIndex + ExtensibleFileManager.VSEFToolsDir.FullName.Length).TrimStart('\\');
                return Path.Combine(
                    String.Format(CultureInfo.InvariantCulture, "$({0})", ExtensibleFileManager.EFTOOLS_VS_MACRONAME), restOfPath);
            }
            return fullPath;
        }
protected static string MacroizeFilePath ( string fullPath ) { var userEFToolsIndex = fullPath . IndexOf ( ExtensibleFileManager . UserEFToolsDir . FullName , StringComparison . OrdinalIgnoreCase ) ; var vsEFToolsIndex = fullPath . IndexOf ( ExtensibleFileManager . VSEFToolsDir . FullName , StringComparison . OrdinalIgnoreCase ) ; if ( userEFToolsIndex != - 1 ) { var restOfPath = fullPath . Substring ( userEFToolsIndex + ExtensibleFileManager . UserEFToolsDir . FullName . Length ) . TrimStart ( ' \\ ' ) ; return Path . Combine ( String . Format ( CultureInfo . InvariantCulture , " " , ExtensibleFileManager . EFTOOLS_USER_MACRONAME ) , restOfPath ) ; } else if ( vsEFToolsIndex != - 1 ) { var restOfPath = fullPath . Substring ( vsEFToolsIndex + ExtensibleFileManager . VSEFToolsDir . FullName . Length ) . TrimStart ( ' \\ ' ) ; return Path . Combine ( String . Format ( CultureInfo . InvariantCulture , " " , ExtensibleFileManager . EFTOOLS_VS_MACRONAME ) , restOfPath ) ; } return fullPath ; }
We take the full path and create macros out of the user and VS dirs.
We take the full path and create macros out of the user and VS dirs .
fullPath
string