コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public void Export(TextureModel texture, string fileName)
 {
     texture.Export(fileName);
 }
コード例 #3
0
 public void Delete(TextureModel texture)
 {
     textureDictionary.Textures.Remove(texture.Texture);
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public void Delete(TextureModel texture)
 {
     textureDictionary.Textures.Remove(texture.Texture);
 }
コード例 #6
0
 public void Export(TextureModel texture, string fileName)
 {
     texture.Export(fileName);
 }
コード例 #7
0
 public TextureViewModel(TextureModel model)
 {
     this.model = model;
 }