예제 #1
0
		protected void OnDocumentClosing(object sender, DocumentClosingEventArgs args)
		{
			if (DocumentClosing != null)
			{
				DocumentClosing(sender, args);
			}
		}
예제 #2
0
		public void CloseDocument(DocumentBase document)
		{
			if (Documents.Contains(document))
			{
				DocumentClosingEventArgs closeArgs = new DocumentClosingEventArgs(document);

				OnDocumentClosing(this, closeArgs);
				if (closeArgs.Cancel)
				{					
					return;
				}

				if (document.Equals(CurrentDocument))
				{
					CurrentDocument = null;
				}
											
				Documents.Remove(document);
				document.Dispose();
				OnDocumentClosed(this, new DataEventArgs<DocumentBase>(document));
			}
		}