Exemplo n.º 1
0
        private static void RegisterNccResource(NccResource.ResourceType type, string resourcePath, NccResource.IncludePosition position = NccResource.IncludePosition.Footer, string version = "", int order = 1000, bool minify = true)
        {
            var nccResource = new NccResource()
            {
                FilePath  = resourcePath,
                Order     = order,
                Position  = position,
                Type      = type,
                UseMinify = minify,
                Version   = version
            };

            if (_nccResources.ContainsKey(resourcePath))
            {
                var old = _nccResources[resourcePath];
                if (old.Version != version)
                {
                    _nccResources[resourcePath] = nccResource;
                }
            }
            else
            {
                _nccResources.TryAdd(resourcePath, nccResource);
            }
        }
Exemplo n.º 2
0
        private static void RegisterNccResource(NccResource.ResourceType type, string resourcePath, NccResource.IncludePosition position = NccResource.IncludePosition.Footer, string version = "", int order = 1000, bool minify = true)
        {
            var nccResource = new NccResource()
            {
                FilePath  = resourcePath,
                Order     = order,
                Position  = position,
                Type      = type,
                UseMinify = minify,
                Version   = version
            };

            var old = _nccResources.Where(x => x.FilePath.ToLower() == resourcePath.ToLower()).FirstOrDefault();

            if (old != null)
            {
                if (old.Version != version)
                {
                    _nccResources.Remove(old);
                    _nccResources.Add(nccResource);
                }
            }
            else
            {
                _nccResources.Add(nccResource);
            }
        }