internal string GetFinalItemName (TemplateParameters parameters) { if (string.IsNullOrWhiteSpace (TargetFileName)) return Value; return parameters.Replace (TargetFileName); }
internal void Export (string directory, TemplateParameters parameters) { var filename = Path.Combine (directory, GetFinalItemName (parameters)); Directory.CreateDirectory (Path.GetDirectoryName (filename)); if (ReplaceParameters) File.WriteAllText (filename, parameters.Replace (ContentText)); else File.WriteAllBytes (filename, ContentBytes); }