当前位置: 首页>>代码示例>>C#>>正文


C# IProjectContent类代码示例

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


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

示例1: ElementReturnType

		public ElementReturnType(IProjectContent pc, IReturnType enumerableType)
		{
			if (pc == null)
				throw new ArgumentNullException("pc");
			this.enumerableType = enumerableType;
			this.pc = pc;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:7,代码来源:ElementReturnType.cs

示例2: CodeNamespace

		public CodeNamespace(IProjectContent projectContent, NamespaceName namespaceName)
		{
			this.projectContent = projectContent;
			this.namespaceName = namespaceName;
			this.InfoLocation = vsCMInfoLocation.vsCMInfoLocationExternal;
			this.Language = GetLanguage(projectContent);
		}
开发者ID:GMRyujin,项目名称:SharpDevelop,代码行数:7,代码来源:CodeNamespace.cs

示例3: AddAttributes

		static void AddAttributes(IProjectContent pc, IList<IAttribute> list, CustomAttributeCollection attributes)
		{
			foreach (CustomAttribute att in attributes) {
				DefaultAttribute a = new DefaultAttribute(CreateType(pc, null, att.Constructor.DeclaringType));
				// Currently Cecil returns string instead of TypeReference for typeof() arguments to attributes
				var parameters = att.Constructor.Parameters;
				for (int i = 0; i < Math.Min(parameters.Count, att.ConstructorParameters.Count); i++) {
					object o = att.ConstructorParameters[i];
					if (parameters[i].ParameterType.FullName == "System.Type" && o is string) {
						try {
							a.PositionalArguments.Add(ReflectionReturnType.Parse(pc, (string)o));
						} catch (ReflectionTypeNameSyntaxError ex) {
							LoggingService.Warn("parsing '" + o + "'", ex);
							a.PositionalArguments.Add(o);
						}
					} else {
						a.PositionalArguments.Add(o);
					}
				}
				foreach (DictionaryEntry entry in att.Properties) {
					a.NamedArguments.Add(entry.Key.ToString(), entry.Value);
				}
				list.Add(a);
			}
		}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Projects,代码行数:25,代码来源:CecilReader.cs

示例4: CreateCompilationUnit

		void CreateCompilationUnit(IProjectContent projectContent, string fileName)
		{
			compilationUnit = new DefaultCompilationUnit(projectContent);
			compilationUnit.FileName = fileName;
			
			CreateUsingScopeForCompilationUnit(fileName);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:PythonAstWalker.cs

示例5: Parse

		public ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent)
		{
			var modelTypeLocater = new RazorCSharpModelTypeLocater(fileContent);
			return new RazorCompilationUnit(projectContent) {
				ModelTypeName = modelTypeLocater.ModelTypeName
			};
		}
开发者ID:GMRyujin,项目名称:SharpDevelop,代码行数:7,代码来源:RazorCSharpParser.cs

示例6: Parse

		public ICompilationUnit Parse(IProjectContent projectContent, string fileName, string fileContent)
		{
			LoggingService.Debug("Parse " + fileName);
			int lineCount = 1;
			foreach (char c in fileContent) {
				if (c == '\n') {
					lineCount++;
				}
			}
			int[] lineLength = new int[lineCount];
			int length = 0;
			int i = 0;
			foreach (char c in fileContent) {
				if (c == '\n') {
					lineLength[i] = length;
					i += 1;
					length = 0;
				} else if (c != '\r') {
					length += 1;
				}
			}
			lineLength[i] = length;
			BooCompiler compiler = new BooCompiler();
			compiler.Parameters.Input.Add(new StringInput(fileName, fileContent));
			ICompilationUnit cu = Parse(projectContent, fileName, lineLength, compiler);
			AddCommentsAndRegions(cu, fileContent, fileName);
			return cu;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:28,代码来源:BooParser.cs

示例7: GetProject

 IProject GetProject(IProjectContent projectContent)
 {
     if (this.project.ProjectContent == projectContent) {
         return project;
     }
     return null;
 }
开发者ID:Rew,项目名称:SharpDevelop,代码行数:7,代码来源:TestableSolutionSnapshot.cs

示例8: ParseInformationEventArgs

		public ParseInformationEventArgs(string fileName, IProjectContent projectContent, ICompilationUnit oldCompilationUnit, ICompilationUnit newCompilationUnit)
		{
			this.fileName = fileName;
			this.projectContent = projectContent;
			this.oldCompilationUnit = oldCompilationUnit;
			this.newCompilationUnit = newCompilationUnit;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:ParseInformationEventHandler.cs

示例9: GetValue

		static object GetValue(IProjectContent pc, IEntity member, CustomAttributeArgument argument)
		{
			if (argument.Value is TypeReference)
				return CreateType(pc, member, (TypeReference)argument.Value);
			else
				return argument.Value;
		}
开发者ID:kleinux,项目名称:SharpDevelop,代码行数:7,代码来源:CecilReader.cs

示例10: GetClassReturnType

		public GetClassReturnType(IProjectContent content, string fullName, int typeArgumentCount, GetClassOptions options)
		{
			this.content = content;
			this.typeArgumentCount = typeArgumentCount;
			SetFullyQualifiedName(fullName);
			this.options = options;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:GetClassReturnType.cs

示例11: GetInfoLocation

		global::EnvDTE.vsCMInfoLocation GetInfoLocation(IProjectContent projectContent, IClass c)
		{
			if (projectContent.Project == c.ProjectContent.Project) {
				return global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationProject;
			}
			return global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal;
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:7,代码来源:CodeType.cs

示例12: VoidClass

		public VoidClass(IProjectContent pc)
			: base(new DefaultCompilationUnit(pc), VoidName)
		{
			this.ClassType = ClassType.Struct;
			this.Modifiers = ModifierEnum.Public | ModifierEnum.Sealed;
			Freeze();
		}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:7,代码来源:SystemTypes.cs

示例13: CodeType

		/// <summary>
		/// Note that projectContent may be different to the IClass.ProjectContent since the class
		/// is retrieved from the namespace contents and could belong to a separate project or
		/// referenced assembly.
		/// </summary>
		public CodeType(IProjectContent projectContent, IClass c)
			: base(c)
		{
			this.Class = c;
			this.ProjectContent = projectContent;
			InfoLocation = GetInfoLocation(projectContent, c);
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:12,代码来源:CodeType.cs

示例14: GetClassIfTypeNameIsNotEmpty

		IClass GetClassIfTypeNameIsNotEmpty(IProjectContent projectContent, string modelTypeName)
		{
			if (!String.IsNullOrEmpty(modelTypeName)) {
				return projectContent.GetClass(modelTypeName, 0);
			}
			return null;
		}
开发者ID:GMRyujin,项目名称:SharpDevelop,代码行数:7,代码来源:RazorCSharpResolver.cs

示例15: CSharpCompletion

        public CSharpCompletion()
        {
            projectContent = new CSharpProjectContent();
            var assemblies = new List<Assembly>
            {
                    typeof(object).Assembly, // mscorlib
                    typeof(Uri).Assembly, // System.dll
                    typeof(Enumerable).Assembly, // System.Core.dll
//					typeof(System.Xml.XmlDocument).Assembly, // System.Xml.dll
//					typeof(System.Drawing.Bitmap).Assembly, // System.Drawing.dll
//					typeof(Form).Assembly, // System.Windows.Forms.dll
//					typeof(ICSharpCode.NRefactory.TypeSystem.IProjectContent).Assembly,
                };

            var unresolvedAssemblies = new IUnresolvedAssembly[assemblies.Count];
            Stopwatch total = Stopwatch.StartNew();
            Parallel.For(
                0, assemblies.Count,
                delegate(int i)
                {
                    var loader = new CecilLoader();
                    var path = assemblies[i].Location;
                    loader.DocumentationProvider = GetXmlDocumentation(assemblies[i].Location);
                    unresolvedAssemblies[i] = loader.LoadAssemblyFile(assemblies[i].Location);
                });
            Debug.WriteLine("Init project content, loading base assemblies: " + total.Elapsed);
            projectContent = projectContent.AddAssemblyReferences((IEnumerable<IUnresolvedAssembly>)unresolvedAssemblies);
        }
开发者ID:uQr,项目名称:NRefactory-Completion-Sample,代码行数:28,代码来源:CSharpCompletion.cs


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