public void OpenCollection(string fileName) { if(String.IsNullOrEmpty(fileName)) { NewCollection(); return; } collection = PPCollection.Load(fileName); SetupCollection(); switch(collection.Config.PaletteOption) { case PPConfig.PaletteOptions.SaveFile: palettePanel.Set(collection.ColorPalette); break; case PPConfig.PaletteOptions.SaveFileName: palettePanel.Set(collection.Config.PaletteFileName); break; } flowPanel.Controls.Clear(); foreach(PPProject project in collection.Projects) { DisplayProject(project); } }
private void NewCollection() { bool continueOperation = PossiblySaveChangesBeforeClosingCollection(); if(!continueOperation) return; collection = new PPCollection(); if(palettePanel.PaletteFileName != null) collection.SetPaletteOption(PPConfig.PaletteOptions.SaveFileName, paletteFileName: palettePanel.PaletteFileName); SetupCollection(); flowPanel.Controls.Clear(); }
private void Collection_OnStatusChanged(object sender, EventArgs e) { PPCollection collection = (sender as PPCollection); if(collection == null) { saveToolStripItem.Image = IconManager.SAVE; return; } if(collection.EditedSinceLastSave) saveToolStripItem.Image = IconManager.SAVE_RED; else saveToolStripItem.Image = IconManager.SAVE; }
public CollectionForm(string fileName = null) { this.Text = "Collection"; this.WindowState = FormWindowState.Normal; this.Width = 500; this.Height = 500; this.FormClosing += new FormClosingEventHandler(Form_Closing); InitMenus(); InitTools(); InitControls(); collection = new PPCollection(); SetupCollection(); if(!String.IsNullOrEmpty(fileName)) { OpenCollection(fileName); } }