CloseItems() public method

public CloseItems ( ) : void
return void
Beispiel #1
0
		private bool RemoveProject(Project project, bool saveConfirmation)
		{
			if (saveConfirmation && project.IsDirty)
			{
				DialogResult result = MessageBox.Show(
					Strings.AskSaveChanges, Strings.Confirmation,
					MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

				if (result == DialogResult.Yes)
				{
					if (!SaveProject(project))
						return false;
				}
				else if (result == DialogResult.Cancel)
				{
					return false;
				}
			}

			if (projects.Remove(project))
			{
				project.CloseItems();
				project.Modified -= new EventHandler(project_StateChanged);
				project.FileStateChanged -= new EventHandler(project_StateChanged);
				OnProjectRemoved(new ProjectEventArgs(project));
				if (ActiveProject == project)
					ActiveProject = null;
				return true;
			}
			return false;
		}