public void StartEditDatabase(DatabaseData srcDatabaseData) { DatabaseData dstDatabaseData = model.SetDatabaseAsEdit(srcDatabaseData); TreeForm.SetDatabaseDefinition(dstDatabaseData); TreeForm.SetEditMode(true); }
public void DatabaseCreated() { DatabaseData databaseData = model.GetDatabasedata(); TreeForm.SetDatabaseDefinition(databaseData); TreeForm.SetEditMode(true); rrdDbForm.SetDatabaseDefinition(databaseData); }
public bool OpenDatabase(string databasePath) { DatabaseData databaseData = model.AddDatabase(databasePath); TreeForm.SetDatabaseDefinition(databaseData); rrdDbForm.SetDatabaseDefinition(databaseData); TreeForm.SetEditMode(false); return(true); }
public void DatabaseUpdated(DatabaseData srcDatabaseData) { DatabaseData reloadedData; if (srcDatabaseData != null) { reloadedData = model.ReloadDatabase(srcDatabaseData); } else { reloadedData = model.EditingDatabaseData; } rrdDbForm.SetDatabaseDefinition(reloadedData); TreeForm.SetDatabaseDefinition(reloadedData); }
public void CreateDatabase(string databasePath) { if (model.EditingDatabaseData == null) { throw new ApplicationException("Not in edit mode"); } string oldpath = model.EditingDatabaseData.Definition.Path; RrdDb srcDatabase = null; if (!string.IsNullOrEmpty(model.EditingDatabaseData.SourceDatabasePath)) { srcDatabase = new RrdDb(model.EditingDatabaseData.SourceDatabasePath); } RrdDef rrdDef = model.EditingDatabaseData.Definition; rrdDef.setPath(databasePath); RrdDb dstDatabase = new RrdDb(rrdDef); if (srcDatabase != null) { srcDatabase.copyStateTo(dstDatabase); } if (srcDatabase != null) { srcDatabase.close(); } dstDatabase.close(); model.DatabaseDirty = false; model.EditingDatabaseData = null; DatabaseData databaseData = model.AddDatabase(databasePath); rrdDbForm.SetDatabaseDefinition(databaseData); TreeForm.RemoveDatabaseDefinition(oldpath); TreeForm.SetDatabaseDefinition(databaseData); TreeForm.SetEditMode(false); }
public void NewDatabase(string databaseName, DateTime startTime, long step) { TreeForm.SetDatabaseDefinition(model.CreateDatabase(databaseName, startTime, step)); rrdDbForm.SetDatabaseDefinition(model.CreateDatabase(databaseName, startTime, step)); }