public void RenameLayout(string name) { using (var dialog = new SaveLayoutForm(name)) { dialog.Text = "Rename Layout"; if (Theme != null) { C1ThemeController.ApplyThemeToControlTree(dialog, C1ThemeController.GetThemeByName(Theme, false)); } if (dialog.ShowDialog() == DialogResult.OK && Directory.Exists(_layoutsDir)) { File.Move(GetLayoutPath(name), GetLayoutPath(dialog.FileName)); } } }
public bool SaveLayoutDialog(out string filePath) { filePath = null; using (var dialog = new SaveLayoutForm()) { if (Theme != null) { C1ThemeController.ApplyThemeToControlTree(dialog, C1ThemeController.GetThemeByName(Theme, false)); } if (dialog.ShowDialog() == DialogResult.OK) { if (!Directory.Exists(_layoutsDir)) { Directory.CreateDirectory(_layoutsDir); } filePath = _layoutsDir + @"\" + dialog.FileName + ".xml"; return(true); } } return(false); }