Exemplo n.º 1
0
		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);
			}
		}
Exemplo n.º 2
0
		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();
		}
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
		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);
			}
		}