private string GetFilesForRemote(List <string> remoteAssetPaths, GroupBundle groupBundle) { var sb = new StringBuilder(); foreach (var uri in remoteAssetPaths) { sb.Append(FillTemplate(groupBundle, uri)); } return(sb.ToString()); }
private string GetRemoteTags(List <Asset> remoteAssets, GroupBundle groupBundle) { var sb = new StringBuilder(); foreach (var asset in remoteAssets) { sb.Append(FillTemplate(groupBundle, asset.RemotePath)); } return(sb.ToString()); }
private string GetAdditionalAttributes(GroupBundle groupBundle) { var result = new StringBuilder(); foreach (var attribute in groupBundle.Attributes) { result.Append(attribute.Key); result.Append("=\""); result.Append(attribute.Value); result.Append("\" "); } return(result.ToString()); }
private void AddAsset(Asset asset, string group = DEFAULT_GROUP) { GroupBundle groupBundle; if (GroupBundles.TryGetValue(group, out groupBundle)) { groupBundle.Assets.Add(asset); } else { groupBundle = new GroupBundle(); groupBundle.Assets.Add(asset); GroupBundles[group] = groupBundle; } }
private void AddAttributes(Dictionary <string, string> attributes, string group = DEFAULT_GROUP, bool merge = true) { GroupBundle groupBundle; if (GroupBundles.TryGetValue(group, out groupBundle)) { if (merge) { foreach (var attribute in attributes) { groupBundle.Attributes[attribute.Key] = attribute.Value; } } else { groupBundle.Attributes = attributes; } } else { GroupBundles[group] = new GroupBundle(attributes); } }
private string FillTemplate(GroupBundle groupBundle, string path) { return(string.Format(Template, GetAdditionalAttributes(groupBundle), path)); }