void AddFile (string file, Project project)
		{
			if (!file.StartsWith (project.BaseDirectory))
				return;

			ITreeBuilder tb = Context.GetTreeBuilder ();
			string filePath = Path.GetDirectoryName (file);
			
			object data = new SystemFile (file, project);
				
			// Already there?
			if (tb.MoveToObject (data))
				return;
			
			if (filePath != project.BaseDirectory) {
				if (tb.MoveToObject (new ProjectFolder (filePath, project))) {
					if (tb.Filled && tb.Options ["ShowAllFiles"])
						tb.AddChild (data);
				} else {
					// Make sure there is a path to that folder
					EnsureReachable (project, file);
				}
			} else {
				if (tb.MoveToObject (project) && tb.Options ["ShowAllFiles"])
					tb.AddChild (data);
			}
		}
Exemple #2
0
        public override void ActivateItem()
        {
            SystemFile file = CurrentNode.DataItem as SystemFile;

            IdeApp.Workbench.OpenDocument(file.Path);
        }
Exemple #3
0
        public void OnOpenWith(object ob)
        {
            SystemFile file = CurrentNode.DataItem as SystemFile;

            ((FileViewer)ob).OpenFile(file.Path);
        }
        public override bool Equals(object other)
        {
            SystemFile f = other as SystemFile;

            return(f != null && absolutePath == f.absolutePath && parent == f.parent);
        }