public void AddMaterial(string materialName, string materialFile, XmlNode materialNode) { string bmpPath = m_BmpTempDir + Path.GetFileNameWithoutExtension(materialFile) + ".bmp"; RenderMethods.AddMaterial(@"Materials\" + Path.GetFileName(materialFile), bmpPath); ListViewItem item = new ListViewItem(); item.Text = materialName; item.Name = materialFile; item.Tag = materialNode; listViewMaterials.Items.Add(item); try { Image original = Image.FromFile(bmpPath); if (original != null) { imageListLarge.Images.Add(original); item.ImageIndex = imageListLarge.Images.Count - 1; } } catch (OutOfMemoryException) { } }