Example #1
0
        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());
        }
Example #2
0
        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());
        }
Example #3
0
        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());
        }
Example #4
0
        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;
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
 private string FillTemplate(GroupBundle groupBundle, string path)
 {
     return(string.Format(Template, GetAdditionalAttributes(groupBundle), path));
 }