Ejemplo n.º 1
0
		public ProjectDocument(IManager manager, string fileName, Project project)
			: base(manager, fileName)
		{
			mBaseDirectory = Path.GetDirectoryName(fileName); //System.Windows.Forms.Application.StartupPath;
			mRootItem = new ProjectDocumentItem(this);
			mProject = project;
			mImports = new ListCollection<ProjectDocument>();
		}
Ejemplo n.º 2
0
		void Manager_ProjectOpened(object sender, Project project)
		{
			project.ItemAdded += new ProjectItemAddedHandler(Project_ItemAdded);
			project.ItemRemoved += new ProjectItemRemovedHandler(Project_ItemRemoved);
			project.ItemRenamed += new ProjectItemRenamedHandler(Project_ItemRenamed);
			project.ProjectReloaded += new ProjectReloadedHandler(Project_ProjectReloaded);
		}
Ejemplo n.º 3
0
		void Project_ProjectReloaded(Project sender, ProjectDocumentItem reloadedItem)
		{
			TreeNode node = FindItem(delegate(ProjectItem item) { return item == reloadedItem; });
			if (node != null)
			{
				node.Collapse();
				node.Nodes.Clear();
				UpdateTree(node, reloadedItem);
			}
		}
Ejemplo n.º 4
0
		void Project_ItemRenamed(Project sender, ProjectItem changedItem)
		{
			TreeNode node = FindItem(
				delegate(ProjectItem item)
				{
					return item == changedItem;
				}
			);

			if (node != null)
				UpdateNode(node);
		}
Ejemplo n.º 5
0
		void Project_ItemRemoved(Project sender, ProjectItem removedItem, ProjectItem itemParent)
		{
			TreeNode node = FindItem(delegate(ProjectItem item) { return item == removedItem; });
			if (node != null)
				node.Parent.Nodes.Remove(node);
		}
Ejemplo n.º 6
0
		void Manager_ProjectOpened(object sender, Project project)
		{
			UpdateFileList(project);
			project.ItemAdded += new ProjectItemAddedHandler(Project_ItemAdded);
			project.ItemRemoved += new ProjectItemRemovedHandler(Project_ItemRemoved);
			project.ProjectReloaded += new ProjectReloadedHandler(Project_ProjectReloaded);
		}
Ejemplo n.º 7
0
		public bool NewProject(Type projType)
		{
			if (mProject != null && !CloseProject(false))
				return false;

			mProject = (Project)Activator.CreateInstance(projType, new object[] { this });

			try
			{
				// Plugins might fail here
				OnProjectOpened();
				OnPropertyChange(this, "Project", null, mProject);
			}
			catch (System.Exception e)
			{
				DestroyProject();
				throw e;
			}
			return true;
		}
Ejemplo n.º 8
0
		public VCProjectDocument(IManager manager, string fileName, Project project)
			: base(manager, fileName, project)
		{

		}
Ejemplo n.º 9
0
		private void AddFile(Project project, DocumentItem documentItem)
		{
			ListViewItem listItem = new ListViewItem(Path.GetFileName(documentItem.RelativeFileName));
			listItem.Tag = documentItem;
			listItem.SubItems.Add(documentItem.AbsoluteFileName);

			mFileItems.Add(listItem);
		}
Ejemplo n.º 10
0
		private void UpdateFileList(Project project, ProjectItem root)
		{
			foreach(ProjectItem item in root.Items)
			{
				if(item is DocumentItem)
				{
					AddFile(project, item as DocumentItem);
				}
				UpdateFileList(project, item);
			}
		}
Ejemplo n.º 11
0
		private void UpdateFileList(Project project)
		{
			mFileItems.Clear();
			UpdateFileList(project, project.RootItem);

			FilterFileList();
		}
Ejemplo n.º 12
0
		void Project_ProjectReloaded(Project sender, ProjectDocumentItem reloadedItem)
		{
			UpdateFileList(sender);
		}
Ejemplo n.º 13
0
		void Project_ItemAdded(Project sender, ProjectItem addedItem)
		{
			UpdateFileList(sender);
		}
Ejemplo n.º 14
0
		void Project_ItemRemoved(Project sender, ProjectItem removedItem, ProjectItem itemParent)
		{
			UpdateFileList(sender);
		}
Ejemplo n.º 15
0
		void Manager_ProjectOpened(IManager sender, Project project)
		{
			if(Options.LuaSourceSearchPath.Length == 0)
			{
				Options.LuaSourceSearchPath = new string[] { project.RootDocument.BaseDirectory };
			}
		}
Ejemplo n.º 16
0
		void Manager_ProjectOpened(object sender, Project project)
		{
			this.Text = project.ProjectName + " - Tilde";
			tsiFileSaveProject.Enabled = project.Modified;
			sourceControlToolStripMenuItem.Enabled = true;
		}
Ejemplo n.º 17
0
		void Manager_ProjectOpened(object sender, Project project)
		{
			mBookmarkedHosts.Clear();
			string hostString = project.GetUserConfiguration("TCPHosts");
			string[] currHosts = hostString.Split(new char[] { ',' });
			foreach (string hostinfo in currHosts)
			{
				string[] pair = hostinfo.Split(new char[] { ':' });
				if(pair.Length == 2)
					mBookmarkedHosts.Add(new SocketHostInfo(this, pair[0], Int32.Parse(pair[1])));
			}
			mAutoConnectTCPHost = project.GetUserConfiguration("AutoConnectTCPHost");
			if (mAutoConnectTCPHost != "")
			{
				string[] pair = mAutoConnectTCPHost.Split(new char[] { ':' });
				if (pair.Length == 2)
					mDebugger.Connect(new SocketHostInfo(this, pair[0], Int32.Parse(pair[1])));
			}
		}
Ejemplo n.º 18
0
		public bool LoadProject(string fileName)
		{
			if (mProject != null && !CloseProject(false))
				return false;

			Type projType = FindProjectLoader(fileName);

			if (projType == null)
				throw new ApplicationException("Couldn't find loader for project: " + fileName);

			mProject = (Project)Activator.CreateInstance(projType, new object[] { this, fileName });

			if(mProject.VCSType == "")
			{
				if(MessageBoxEx.Show(MainWindow, "Source control has not been configured for this project. Would you like to configure it now?", "Source control configuration", new string [] {"Yes", "No"}, MessageBoxIcon.Question, "Yes" ) == "Yes")
				{
					SourceControlWindow window = new SourceControlWindow(this);
					window.ShowDialog(MainWindow);
				}
			}

			try
			{
				// Plugins might fail here
				OnProjectOpened();
				OnPropertyChange(this, "Project", null, mProject);
			}
			catch (System.Exception e)
			{
				DestroyProject();
				throw e;
			}
			return true;
		}
Ejemplo n.º 19
0
		public ProjectClosingEventArgs(Project project, bool cancelled)
		{
			m_project = project;
			m_cancelled = cancelled;
			m_cancel = false;
		}
Ejemplo n.º 20
0
		private void DestroyProject()
		{
			if (mProject != null)
			{
				mProject = null;
			}
		}
Ejemplo n.º 21
0
		void Project_ItemAdded(Project sender, ProjectItem addedItem)
		{
			TreeNode parent = FindItem(delegate(ProjectItem item) { return item == addedItem.Parent; });
			if (parent != null)
			{
				TreeNode newNode = CreateNode(addedItem);
				UpdateNodeImage(newNode);
				int index = addedItem.Parent.Items.IndexOf(addedItem);
				parent.Nodes.Insert(index, newNode);
				UpdateTree(newNode, addedItem);
				projectView.SelectedNode = newNode;
				newNode.EnsureVisible();
			}
		}