private static string GetExpansionPath(ConfigLayerExpansion Expansion, string LayerPath) { string ExpansionPath = LayerPath.Replace("{ED}", Expansion.DirectoryPrefix); ExpansionPath = ExpansionPath.Replace("{EF}", Expansion.FilePrefix); return(ExpansionPath); }
private static string PerformExpansionReplacements(ConfigLayerExpansion Expansion, string InString) { // if there's replacement to do, the output is just the output if (Expansion.Before1 == null) { return(InString); } // if nothing to replace, then skip it entirely if (!InString.Contains(Expansion.Before1) && (Expansion.Before2 == null || !InString.Contains(Expansion.Before2))) { return(null); } // replace the directory bits string OutString = InString.Replace(Expansion.Before1, Expansion.After1); if (Expansion.Before2 != null) { OutString = OutString.Replace(Expansion.Before2, Expansion.After2); } return(OutString); }