Ejemplo n.º 1
0
        public File(Asset asset, Version version, Models.Assets.File model)
        {
            if (asset == null)
            {
                throw new ArgumentNullException("asset");
            }
            if (version == null)
            {
                throw new ArgumentNullException("version");
            }

            _asset   = asset;
            _version = version;
            _model   = model;

            Path = _version.Path;

            while (Path.EndsWith("\\") || Path.EndsWith("/"))
            {
                Path = Path.TrimEnd('\\').TrimEnd('/');
            }

            Path += System.IO.Path.DirectorySeparatorChar.ToString() + _model.Id;
            if (!string.IsNullOrEmpty(_model.Extension))
            {
                Path += _model.Extension;
            }
        }
Ejemplo n.º 2
0
        public File(Asset asset, Version version, Models.Assets.File model)
        {
            if (asset == null) throw new ArgumentNullException("asset");
            if (version == null) throw new ArgumentNullException("version");

            _asset = asset;
            _version = version;
            _model = model;

            Path = _version.Path;

            while (Path.EndsWith("\\") || Path.EndsWith("/"))
                Path = Path.TrimEnd('\\').TrimEnd('/');

            Path += System.IO.Path.DirectorySeparatorChar.ToString() + _model.Id;
            if (!string.IsNullOrEmpty(_model.Extension))
                Path += _model.Extension;
        }