Пример #1
0
		private void docManager_DocumentRemoved(object sender, DocumentEventArgs e)
		{
			for (int index = 0; index < tabs.Count; index++)
			{
				if (tabs[index].Document == e.Document)
				{
					tabs.RemoveAt(index);
					this.Invalidate();
					return;
				}
			}
		}
Пример #2
0
		//TODO: ez így nem szép! nem kéne internal!
		protected internal virtual void OnDocumentOpening(DocumentEventArgs e)
		{
			if (DocumentOpening != null)
				DocumentOpening(this, e);
		}
Пример #3
0
		private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e)
		{
			foreach (Tab tab in tabs)
			{
				if (tab.Document == docManager.ActiveDocument)
				{
					activeTab = tab;
					break;
				}
			}
			this.Invalidate();
		}
Пример #4
0
		private void docManager_DocumentAdded(object sender, DocumentEventArgs e)
		{
			Tab tab = new Tab(e.Document, this);
			tabs.Add(tab);
		}
Пример #5
0
		protected virtual void OnActiveDocumentChanged(DocumentEventArgs e)
		{
			if (ActiveDocumentChanged != null)
				ActiveDocumentChanged(this, e);
		}
Пример #6
0
		protected virtual void OnDocumentRemoved(DocumentEventArgs e)
		{
			if (DocumentRemoved != null)
				DocumentRemoved(this, e);
		}
Пример #7
0
		private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e)
		{
			if (docManager.HasDocument)
			{
				Workspace.Default.ActiveProject = docManager.ActiveDocument.Project;
				docManager.ActiveDocument.Modified += ActiveDocument_Modified;
				docManager.ActiveDocument.StatusChanged += ActiveDocument_StatusChanged;
				docManager.ActiveDocument.ClipboardAvailabilityChanged += 
					ActiveDocument_ClipboardAvailabilityChanged;
			}
			else
			{
				Workspace.Default.ActiveProject = null;
			}

			IDocument oldDocument = e.Document;
			if (oldDocument != null)
			{
				oldDocument.Modified -= ActiveDocument_Modified;
				oldDocument.StatusChanged -= ActiveDocument_StatusChanged;
				oldDocument.ClipboardAvailabilityChanged -=
					ActiveDocument_ClipboardAvailabilityChanged;
			}

			UpdateStatusBar();
			UpdateDynamicMenus();
			UpdateClipboardToolBar();
			UpdateStandardToolStrip();
		}
Пример #8
0
		private void modelExplorer_DocumentOpening(object sender, DocumentEventArgs e)
		{
			docManager.AddOrActivate(e.Document);
		}
Пример #9
0
 private void OnDocumentRemoved(DocumentEventArgs e)
 {
     DocumentRemoved?.Invoke(this, e);
 }
Пример #10
0
 private void OnActiveDocumentChanged(DocumentEventArgs e)
 {
     ActiveDocumentChanged?.Invoke(this, e);
 }
Пример #11
0
		private void docManager_ActiveDocumentChanged(object sender, DocumentEventArgs e)
		{
			canvas.Document = docManager.ActiveDocument;
		}
Пример #12
0
 protected virtual void OnDocumentRemoved(DocumentEventArgs e)
 {
     DocumentRemoved?.Invoke(this, e);
 }
Пример #13
0
 protected virtual void OnActiveDocumentChanged(DocumentEventArgs e)
 {
     ActiveDocumentChanged?.Invoke(this, e);
 }