public void SetName(string matName) { // check and rename the material file. string oldPath = mainWindow.GetWorkDirectory() + sMaterialUniqueName; string newUniqueName = System.IO.Path.GetDirectoryName(sMaterialUniqueName) + @"\" + matName + ".gmat"; string newPath = mainWindow.GetWorkDirectory() + newUniqueName; if (!System.IO.File.Exists(newPath)) { // rename the .gmat file and the material. System.IO.FileInfo fi = new System.IO.FileInfo(oldPath); fi.MoveTo(newPath); IGCore.RenameMaterial(sMaterialUniqueName, newUniqueName); sMaterialUniqueName = newUniqueName; } mainWindow.RefreshBrowser(); }