Ejemplo n.º 1
0
        public static UserProjectSettings MakeOptions()
        {
            UserProjectSettings   options                = new UserProjectSettings();
            List <OpenedFileInfo> openedDocuments        = new List <OpenedFileInfo>();
            List <OpenedFileInfo> openedProjectDocuments = new List <OpenedFileInfo>();

            foreach (CodeFileDocumentControl cfdc in VisualPABCSingleton.MainForm.OpenDocuments.Values)
            {
                OpenedFileInfo fi = new OpenedFileInfo();
                if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(cfdc.FileName))
                {
                    fi.FileName  = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), cfdc.FileName);
                    fi.InProject = true;
                }
                else
                {
                    fi.FileName = cfdc.FileName;
                }
                openedDocuments.Add(fi);
                fi.CaretLine   = cfdc.TextEditor.CaretLine;
                fi.CaretColumn = cfdc.TextEditor.CaretColumn;
            }
            if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName))
            {
                options.CurrentDocument            = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName);
                options.CurrentDocumentIsInProject = true;
            }
            else
            {
                options.CurrentDocument = WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName;
            }
            options.OpenDocuments = openedDocuments.ToArray();
            string[]             exprs   = VisualPABCSingleton.MainForm.DebugWatchListWindow.GetExpressions();
            List <WatchExprInfo> watches = new List <WatchExprInfo>();

            foreach (string s in exprs)
            {
                watches.Add(new WatchExprInfo(s));
            }
            options.WatchExprs = watches.ToArray();
            return(options);
        }
Ejemplo n.º 2
0
		public static UserProjectSettings MakeOptions()
		{
			UserProjectSettings options = new UserProjectSettings();
			List<OpenedFileInfo> openedDocuments = new List<OpenedFileInfo>();
            List<OpenedFileInfo> openedProjectDocuments = new List<OpenedFileInfo>();
            foreach (CodeFileDocumentControl cfdc in VisualPABCSingleton.MainForm.OpenDocuments.Values)
			{
				OpenedFileInfo fi = new OpenedFileInfo();
                if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(cfdc.FileName))
                {
                    fi.FileName = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path),cfdc.FileName);
                    fi.InProject = true;
                }
                else
                {
                    fi.FileName = cfdc.FileName;
                }
                openedDocuments.Add(fi);
                fi.CaretLine = cfdc.TextEditor.CaretLine;
                fi.CaretColumn = cfdc.TextEditor.CaretColumn;
			}
            if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName))
            {
                options.CurrentDocument = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName);
                options.CurrentDocumentIsInProject = true;
            }
            else
                options.CurrentDocument = WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName;
			options.OpenDocuments = openedDocuments.ToArray();
			string[] exprs = VisualPABCSingleton.MainForm.DebugWatchListWindow.GetExpressions();
			List<WatchExprInfo> watches = new List<WatchExprInfo>();
			foreach (string s in exprs)
			{
				watches.Add(new WatchExprInfo(s));
			}
			options.WatchExprs = watches.ToArray();
			return options;
		}