public void Import(string fileName, bool replaceOnly = false)
        {
            var info = new FileInfo(fileName);
            var name = info.Name.Replace(".dds", "");

            var existingTexture = (TextureModel)null;

            foreach (var texture in textureDictionary.Textures)
            {
                if (texture.Name.Equals(name, StringComparison.OrdinalIgnoreCase))
                {
                    existingTexture = new TextureModel(texture);
                }
            }

            if (existingTexture != null)
            {
                existingTexture.Import(fileName);
            }
            else if (!replaceOnly)
            {
                var texture      = new TextureWrapper_GTA5_pc();
                var textureModel = new TextureModel(texture);
                textureModel.Name = name;
                textureModel.Import(fileName);

                textureDictionary.Textures.Add(texture);
            }
        }
 public void Export(TextureModel texture, string fileName)
 {
     texture.Export(fileName);
 }
 public void Delete(TextureModel texture)
 {
     textureDictionary.Textures.Remove(texture.Texture);
 }
        public void Import(string fileName, bool replaceOnly = false)
        {
            var info = new FileInfo(fileName);
            var name = info.Name.Replace(".dds", "");

            var existingTexture = (TextureModel)null;
            foreach (var texture in textureDictionary.Textures)
                if (texture.Name.Equals(name, StringComparison.OrdinalIgnoreCase))
                    existingTexture = new TextureModel(texture);

            if (existingTexture != null)
            {
                existingTexture.Import(fileName);
            }
            else if (!replaceOnly)
            {
                var texture = new TextureWrapper_GTA5_pc();
                var textureModel = new TextureModel(texture);
                textureModel.Name = name;
                textureModel.Import(fileName);

                textureDictionary.Textures.Add(texture);
            }
        }
 public void Delete(TextureModel texture)
 {
     textureDictionary.Textures.Remove(texture.Texture);
 }
 public void Export(TextureModel texture, string fileName)
 {
     texture.Export(fileName);
 }
示例#7
0
 public TextureViewModel(TextureModel model)
 {
     this.model = model;
 }