void FillServers() { int current = comboServers.Active; updatingServers = true; servers = BugzillaService.GetServers(); ((ListStore)comboServers.Model).Clear(); foreach (ServerInfo s in servers) { comboServers.AppendText(s.Name); } if (current < servers.Length) { comboServers.Active = current; } else { updatingServers = false; comboServers.Active = servers.Length - 1; } updatingServers = false; }
public void Save() { if (Id == 0) { throw new InvalidOperationException("Server not registered in BugzillaService"); } if (!Directory.Exists(BugzillaService.BugzillaDataPath)) { Directory.CreateDirectory(BugzillaService.BugzillaDataPath); } string file = BugzillaService.BugzillaDataPath.Combine(Id.ToString()); file = Path.GetFullPath(file); string tmpFile = file + ".tmp"; using (Stream fs = File.OpenWrite(tmpFile)) { BinaryFormatter f = new BinaryFormatter(); f.Serialize(fs, this); } FileService.SystemRename(tmpFile, file); if (oldName != Name) { BugzillaService.SaveIndex(); } oldName = Name; }
protected void OnDeleteServer() { if (MessageService.Confirm(GettextCatalog.GetString("Are you sure you want to delete all information about this bugzilla server?"), AlertButton.Delete)) { BugzillaService.RemoveServer(server); FillServers(); } }
protected void OnAddServer() { BugzillaServer newServer = new BugzillaServer(); EditServerDialog dlg = new EditServerDialog(newServer, true); if (dlg.Run() == (int)ResponseType.Ok) { dlg.Save(); BugzillaService.AddServer(newServer); FillServers(); servers = BugzillaService.GetServers(); comboServers.Active = servers.Length - 1; } dlg.Destroy(); }
void FillServer(ServerInfo s) { if (s != null) { vpaned1.Sensitive = true; server = BugzillaService.LoadServer(s); Fill(); } else { server = null; bugsStore.Clear(); countLabel.Text = string.Empty; vpaned1.Sensitive = false; } }