protected Control CreateControl(File file, IModelFile modelfile) { var view = new ModelView(); var controller = new ModelViewController(view); var fileName = file.Name; var fileNameWOE = fileName.Substring(0, fileName.LastIndexOf('.')); List<TextureFile> textures = new List<TextureFile>(); TryLoadTexture(textures, file, fileNameWOE); TryLoadTexture(textures, file, "vehshare"); TryLoadTexture(textures, file, "vehshare_truck"); controller.TextureFiles = textures.ToArray(); controller.ModelFile = modelfile; return view; }
private void View_Disposed(object sender, EventArgs e) { if (TextureFiles != null) { foreach (var file in _textureFiles) { file.Dispose(); } TextureFiles = null; } if (ModelFile != null) { ModelFile.Dispose(); ModelFile = null; } }
protected Control CreateControl(File file, IModelFile modelfile) { var view = new ModelView(); var controller = new ModelViewController(view); var fileName = file.Name; var fileNameWOE = fileName.Substring(0, fileName.LastIndexOf('.')); List <TextureFile> textures = new List <TextureFile>(); TryLoadTexture(textures, file, fileNameWOE); TryLoadTexture(textures, file, "vehshare"); TryLoadTexture(textures, file, "vehshare_truck"); controller.TextureFiles = textures.ToArray(); controller.ModelFile = modelfile; return(view); }