• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Projects.ProjectFile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoDevelop.Projects.ProjectFile的典型用法代码示例。如果您正苦于以下问题:C# ProjectFile类的具体用法?C# ProjectFile怎么用?C# ProjectFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectFile类属于MonoDevelop.Projects命名空间,在下文中一共展示了ProjectFile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetCodeBehindClassName

		public static string GetCodeBehindClassName (ProjectFile file)
		{
			AspNetAppProject proj = file.Project as AspNetAppProject;
			if (proj == null)
				return null;
			return proj.GetCodebehindTypeName (file.Name);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:CodeBehind.cs


示例2: GenerateAllFiles

		List<Tuple<string, string, ProjectFile>> GenerateAllFiles ()
		{
			//Slowest thing here is GetRelProjectPath, hence Tuple<,,> needs to be cached
			var list = new List<Tuple<string, string, ProjectFile>> ();
			foreach (var doc in IdeApp.Workbench.Documents) {
				// We only want to check it here if it's not part
				// of the open combine.  Otherwise, it will get
				// checked down below.
				if (doc.Project == null && doc.IsFile) {
					var pf = new ProjectFile (doc.Name);
					list.Add (new Tuple<string, string, ProjectFile> (System.IO.Path.GetFileName (pf.FilePath), FileSearchResult.GetRelProjectPath (pf), pf));
				}
			}

			var projects = IdeApp.Workspace.GetAllProjects ();

			foreach (var p in projects) {
				foreach (ProjectFile pf in p.Files) {
					if (pf.Subtype != Subtype.Directory && (pf.Flags & ProjectItemFlags.Hidden) != ProjectItemFlags.Hidden) {
						list.Add (new Tuple<string, string, ProjectFile> (System.IO.Path.GetFileName (pf.FilePath), FileSearchResult.GetRelProjectPath (pf), pf));
					}
				}
			}
			return list;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:25,代码来源:FileSearchCategory.cs


示例3: GetDefaultCustomToolForFileName

		public string GetDefaultCustomToolForFileName (ProjectFile projectItem)
		{
			if (defaultCustomTools.ContainsKey (projectItem.FilePath.ToString ())) {
				return defaultCustomTools [projectItem.FilePath.ToString ()];
			}
			return String.Empty;
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:7,代码来源:FakePackageManagementProjectService.cs


示例4: FromCodeIssue

		public static IssueSummary FromCodeIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue codeIssue)
		{
			var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;
			if (topLevelProvider == null)
				throw new ArgumentException ("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
			var issueSummary = new IssueSummary {
				IssueDescription = codeIssue.Description,
				Region = codeIssue.Region,
				ProviderTitle = topLevelProvider.Title,
				ProviderDescription = topLevelProvider.Description,
				ProviderCategory = topLevelProvider.Category,
				Severity = topLevelProvider.GetSeverity (),
				IssueMarker = codeIssue.IssueMarker,
				File = file,
				Project = file.Project,
				InspectorIdString = codeIssue.InspectorIdString
			};
			issueSummary.Actions = codeIssue.Actions.Select (a => new ActionSummary {
				Batchable = a.SupportsBatchRunning,
				SiblingKey = a.SiblingKey,
				Title = a.Title,
				Region = a.DocumentRegion,
				IssueSummary = issueSummary
			}).ToList ();
			return issueSummary;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:IssueSummary.cs


示例5: UpdateDesignerFile

		public static BuildResult UpdateDesignerFile (
			CodeBehindWriter writer,
			DotNetProject project,
			ProjectFile file, ProjectFile designerFile
		)
		{
			var result = new BuildResult ();

			//parse the ASP.NET file
			var parsedDocument = TypeSystemService.ParseFile (project, file.FilePath).Result as WebFormsParsedDocument;
			if (parsedDocument == null) {
				result.AddError (string.Format ("Failed to parse file '{0}'", file.Name));
				return result;
			}

			//TODO: ensure type system is up to date

			CodeCompileUnit ccu;
			result.Append (GenerateCodeBehind (project, designerFile.FilePath, parsedDocument, out ccu));
			if (ccu != null) {
				writer.WriteFile (designerFile.FilePath, ccu);
			}

			return result;
		}
开发者ID:polluks,项目名称:monodevelop,代码行数:25,代码来源:WebFormsCodeBehind.cs


示例6: GenerateInternal

		static void GenerateInternal (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
		{
			if (file.Project.SupportedLanguages.All (l => l != "C#")) {
				const string msg = "Razor templates are only supported in C# projects";
				result.Errors.Add (new CompilerError (file.Name, -1, -1, null, msg));
				monitor.Log.WriteLine (msg);
				return;
			}

			var host = new PreprocessedRazorHost (file.FilePath);

			var defaultOutputName = file.FilePath.ChangeExtension (".cs");

			var ns = CustomToolService.GetFileNamespace (file, defaultOutputName);
			host.DefaultNamespace = ns;

			CompilerErrorCollection errors;
			var code = host.GenerateCode (out errors);
			result.Errors.AddRange (errors);

			var writer = new MonoDevelop.DesignerSupport.CodeBehindWriter ();
			writer.WriteFile (defaultOutputName, code);
			writer.WriteOpenFiles ();

			result.GeneratedFilePath = defaultOutputName;

			foreach (var err in result.Errors) {
				monitor.Log.WriteLine (err);
			}
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:30,代码来源:RazorTemplatePreprocessor.cs


示例7: GetDesignerFileName

		private static string GetDesignerFileName (ProjectFile file)
		{
			string directory = Path.GetDirectoryName (file.FilePath);
			string extension = Path.GetExtension (file.Name);
			string designerFile = Path.GetFileNameWithoutExtension (file.Name) + ".Designer" + extension;
			return Path.Combine (directory, designerFile);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:CodeBehind.cs


示例8: GetCodeBehindClassName

		public static string GetCodeBehindClassName (ProjectFile file)
		{
			var proj = file.Project.GetService<AspNetAppProjectFlavor> ();
			if (proj == null)
				return null;
			return proj.GetCodebehindTypeName (file.Name);
		}
开发者ID:polluks,项目名称:monodevelop,代码行数:7,代码来源:WebFormsCodeBehind.cs


示例9: HandleException

		private void HandleException(Exception ex, ProjectFile file, SingleFileCustomToolResult result)
		{
			if (ex is SpecFlowParserException)
			{
				SpecFlowParserException sfpex = (SpecFlowParserException) ex;
			                
				if (sfpex.ErrorDetails == null || sfpex.ErrorDetails.Count == 0)
				{
					result.UnhandledException = ex;
				}
				else
				{
					var compilerErrors = new CompilerErrorCollection();
					
					foreach (var errorDetail in sfpex.ErrorDetails)
					{
						var compilerError = new CompilerError(file.Name, errorDetail.ForcedLine, errorDetail.ForcedColumn, "0", errorDetail.Message);
						compilerErrors.Add(compilerError);
					}
							
					result.Errors.AddRange(compilerErrors);
				}
			}
			else
			{
				result.UnhandledException = ex;
			}
		}
开发者ID:roffster,项目名称:SpecFlow,代码行数:28,代码来源:SingleFeatureFileGenerator.cs


示例10: GetGenerator

		static ISingleFileCustomTool GetGenerator (ProjectFile file)
		{
			CustomToolExtensionNode node;
			if (!string.IsNullOrEmpty (file.Generator) && nodes.TryGetValue (file.Generator, out node))
				return node.Tool;
			return null;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:CustomToolService.cs


示例11: GenerateInternal

		void GenerateInternal (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
		{
			var dnp = file.Project as DotNetProject;
			if (dnp == null || dnp.LanguageName != "C#") {
				var msg = "Razor templates are only supported in C# projects";
				result.Errors.Add (new CompilerError (file.Name, -1, -1, null, msg));
				monitor.Log.WriteLine (msg);
				return;
			}

			var host = PreprocessedRazorHost.Create (file.FilePath);

			var defaultOutputName = file.FilePath.ChangeExtension (".cs");

			var ns = GetNamespaceHint (file, defaultOutputName);
			host.DefaultNamespace = ns;

			CompilerErrorCollection errors;
			var code = host.GenerateCode (out errors);
			result.Errors.AddRange (errors);

			var writer = new MonoDevelop.DesignerSupport.CodeBehindWriter ();
			writer.WriteFile (defaultOutputName, code);
			writer.WriteOpenFiles ();

			result.GeneratedFilePath = defaultOutputName;

			foreach (var err in result.Errors) {
				monitor.Log.WriteLine (err.ToString ());
			}
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:31,代码来源:RazorTemplatePreprocessor.cs


示例12: Generate

		public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
		{
			return new ThreadAsyncOperation (delegate {
				var dnp = file.Project as DotNetProject;
				if (dnp == null) {
					var err = "ResXFileCodeGenerator can only be used with .NET projects";
					result.Errors.Add (new CompilerError (null, 0, 0, null, err));
					return;
				}

				var provider = dnp.LanguageBinding.GetCodeDomProvider ();
				if (provider == null) {
					var err = "ResXFileCodeGenerator can only be used with languages that support CodeDOM";
					result.Errors.Add (new CompilerError (null, 0, 0, null, err));
					return;
				}

				var outputfile = file.FilePath.ChangeExtension (".Designer." + provider.FileExtension);
				var ns = CustomToolService.GetFileNamespace (file, outputfile);
				var cn = provider.CreateValidIdentifier (file.FilePath.FileNameWithoutExtension);

				string[] unmatchable;
				var ccu = StronglyTypedResourceBuilder.Create (file.FilePath, cn, ns, provider, true, out unmatchable);

				foreach (var p in unmatchable) {
					var msg = string.Format ("Could not generate property for resource ID '{0}'", p);
					result.Errors.Add (new CompilerError (file.FilePath, 0, 0, null, msg));
				}

				using (var w = new StreamWriter (outputfile, false, Encoding.UTF8))
					provider.GenerateCodeFromCompileUnit (ccu, w, new CodeGeneratorOptions ());

				result.GeneratedFilePath = outputfile;
			}, result);
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:35,代码来源:ResXFileCodeGenerator.cs


示例13: BuildModuleName

        public static string BuildModuleName(ProjectFile pf)
        {
            // When handling an external link, keep it rooted though it might occur in a project's subfolder
            if (pf.IsLink || pf.IsExternalToProject)
                return pf.FilePath.FileNameWithoutExtension;

            return pf.ProjectVirtualPath.ChangeExtension(null).ToString().Replace(Path.DirectorySeparatorChar, '.');
        }
开发者ID:gavin-norman,项目名称:Mono-D,代码行数:8,代码来源:DParserWrapper.cs


示例14: ProjectFileDescriptor

		public ProjectFileDescriptor (ProjectFile file)
		{
			this.file = file;
			project = file.Project;
			if (project != null) {
				project.FilePropertyChangedInProject += OnFilePropertyChangedInProject;
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:ProjectFileDescriptor.cs


示例15: SetUp

		public void SetUp ()
		{
			queue = new AnalysisJobQueue ();
			file1 = new ProjectFile ("file1.cs");
			file2 = new ProjectFile ("file2.cs");
			file3 = new ProjectFile ("file3.cs");
			job = new SimpleAnalysisJob (new [] { file1, file2 });
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:AnalysisJobQueueTests.cs


示例16: ProjectItem

		public ProjectItem (Project project, MD.ProjectFile projectItem)
		{
			this.projectItem = projectItem;
			this.containingProject = project;
			this.ProjectItems = CreateProjectItems (projectItem);
			CreateProperties ();
			Kind = GetKindFromFileProjectItemType ();
		}
开发者ID:modulexcite,项目名称:monodevelop-nuget-extensions,代码行数:8,代码来源:ProjectItem.cs


示例17: WebReferenceItem

		/// <summary>Initializes a new instance of the WebReferenceItem class.</summary>
		/// <param name="name">A string containing the name for the web reference.</param>
		public WebReferenceItem (WebServiceEngine engine, DotNetProject project, string name, FilePath basePath, ProjectFile mapFile)
		{
			this.engine = engine;
			this.name = name;
			this.project = project;
			this.mapFile = mapFile;
			BasePath = basePath.CanonicalPath;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:10,代码来源:WebReferenceItem.cs


示例18: GetDefaultResourceId

        public string GetDefaultResourceId(ProjectFile pf)
        {
            if (String.IsNullOrEmpty (pf.DependsOn) || !File.Exists (pf.DependsOn))
                    // FIXME: Always returning null here
                //return MSBuildProjectService.GetDefaultResourceId (pf);
                return null;

            string ns = null;
            string classname = null;

            using (StreamReader rdr = new StreamReader (pf.DependsOn)) {
                int numopen = 0;
                while (true) {
                    string tok = GetNextToken (rdr);
                    if (tok == null)
                        break;

                    if (tok == "@") {
                        //Handle @namespace, @class
                        GetNextToken (rdr);
                        continue;
                    }

                    if (String.Compare (tok, "namespace", false) == 0)
                        ns = GetNextToken (rdr);

                    if (tok == "{")
                        numopen ++;

                    if (tok == "}") {
                        numopen --;
                        if (numopen == 0)
                            ns = String.Empty;
                    }

                    if (tok == "class") {
                        classname = GetNextToken (rdr);
                        break;
                    }
                }

                if (classname == null)
                        // FIXME: Always returning null here
                    //return MSBuildProjectService.GetDefaultResourceId (pf);
                    return null;

                string culture, extn, only_filename;
                if (MSBuildProjectService.TrySplitResourceName (pf.RelativePath, out only_filename, out culture, out extn))
                    extn = "." + culture + ".resources";
                else
                    extn = ".resources";

                if (ns == null)
                    return classname + extn;
                else
                    return ns + '.' + classname + extn;
            }
        }
开发者ID:mikkom,项目名称:fsharpbinding,代码行数:58,代码来源:FSharpResourceIdBuilder.cs


示例19: GenerateDesignerCode

		static void GenerateDesignerCode (CodeBehindWriter writer, ProjectFile xibFile, ProjectFile designerFile)
		{
			var ns = new CodeNamespace (((DotNetProject)designerFile.Project).GetDefaultNamespace (designerFile.FilePath));
			var ccu = new CodeCompileUnit ();
			ccu.Namespaces.Add (ns);
			foreach (var ctd in CodeBehindGenerator.GetTypes (XDocument.Load (xibFile.FilePath), writer.Provider, writer.GeneratorOptions))
				ns.Types.Add (ctd);
			writer.Write (ccu, designerFile.FilePath);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:CodeBehind.cs


示例20: GetNamespaceHint

		//from TextTemplatingFilePreprocessor
		static string GetNamespaceHint (ProjectFile file, string outputFile)
		{
			string ns = file.CustomToolNamespace;
			if (string.IsNullOrEmpty (ns) && !string.IsNullOrEmpty (outputFile)) {
				var dnp = ((DotNetProject) file.Project);
				ns = dnp.GetDefaultNamespace (outputFile);
			}
			return ns;
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:10,代码来源:RazorTemplatePreprocessor.cs



注:本文中的MonoDevelop.Projects.ProjectFile类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Projects.ProjectFileEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Projects.ProjectCreateInformation类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap