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


C# CSharp.NamespaceContainer类代码示例

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


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

示例1: Enum

        public Enum(NamespaceContainer ns, DeclSpace parent, TypeExpression type,
			     Modifiers mod_flags, MemberName name, Attributes attrs)
            : base(ns, parent, name, attrs, MemberKind.Enum)
        {
            underlying_type_expr = type;
            var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
            ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
            spec = new EnumSpec (null, this, null, null, ModFlags);
        }
开发者ID:tapenjoyGame,项目名称:ILSpy,代码行数:9,代码来源:enum.cs

示例2: Delegate

 		public Delegate (NamespaceContainer ns, TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
				 Attributes attrs)
			: base (ns, parent, name, attrs, MemberKind.Delegate)

		{
			this.ReturnType = type;
			ModFlags        = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
							   IsTopLevel ? Modifiers.INTERNAL :
							   Modifiers.PRIVATE, name.Location, Report);
			parameters      = param_list;
			spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:12,代码来源:delegate.cs

示例3: TypeContainer

		public TypeContainer (NamespaceContainer ns, DeclSpace parent, MemberName name,
				      Attributes attrs, MemberKind kind)
			: base (ns, parent, name, attrs)
		{
			if (parent != null && parent.NamespaceEntry != ns)
				throw new InternalErrorException ("A nested type should be in the same NamespaceEntry as its enclosing class");

			this.Kind = kind;
			this.PartialContainer = this;
		}
开发者ID:jordanbtucker,项目名称:mono,代码行数:10,代码来源:class.cs

示例4: Visit

			public override void Visit(NamespaceContainer ns)
			{
				NamespaceDeclaration nDecl = null;
				var loc = LocationsBag.GetLocations(ns);
				// <invalid> is caused by the parser - see Bug 12383 - [AST] Non existing namespaces generated
				if (ns.NS != null && !string.IsNullOrEmpty(ns.NS.Name) && !ns.NS.Name.EndsWith("<invalid>", StringComparison.Ordinal)) {
					nDecl = new NamespaceDeclaration();
					if (loc != null) {
						nDecl.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword);
					}
					nDecl.AddChild(ConvertNamespaceName(ns.RealMemberName), NamespaceDeclaration.NamespaceNameRole);
					if (loc != null && loc.Count > 1) {
						nDecl.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.LBrace), Roles.LBrace);
					}

					AddToNamespace(nDecl);
					namespaceStack.Push(nDecl);
				}
				
				if (ns.Usings != null) {
					foreach (var us in ns.Usings) {
						us.Accept(this);
					}
				}
				
				if (ns.Containers != null) {
					foreach (var container in ns.Containers) {
						container.Accept(this);
					}
				}
				
				if (nDecl != null) {
					AddAttributeSection(nDecl, ns.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);
					if (loc != null && loc.Count > 2)
						nDecl.AddChild(new CSharpTokenNode(Convert(loc [2]), Roles.RBrace), Roles.RBrace);
					if (loc != null && loc.Count > 3)
						nDecl.AddChild(new CSharpTokenNode(Convert(loc [3]), Roles.Semicolon), Roles.Semicolon);
					
					namespaceStack.Pop();
				}
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:41,代码来源:CSharpParser.cs

示例5: Define

        public override void Define(NamespaceContainer ctx)
        {
            base.Define (ctx);

            if (resolved == null)
                return;

            var ns = resolved as NamespaceExpression;
            if (ns != null) {
                var compiler = ctx.Module.Compiler;
                compiler.Report.Error (7007, Location,
                    "A 'using static' directive can only be applied to types but `{0}' denotes a namespace. Consider using a `using' directive instead",
                    ns.GetSignatureForError ());
                return;
            }

            // TODO: Need to move it to post_process_using_aliases
            //ObsoleteAttribute obsolete_attr = resolved.Type.GetAttributeObsolete ();
            //if (obsolete_attr != null) {
            //	AttributeTester.Report_ObsoleteMessage (obsolete_attr, resolved.GetSignatureForError (), Location, ctx.Compiler.Report);
            //}
        }
开发者ID:exodrifter,项目名称:mcs-ICodeCompiler,代码行数:22,代码来源:namespace.cs

示例6: AliasContext

 public AliasContext(NamespaceContainer ns)
 {
     this.ns = ns;
 }
开发者ID:exodrifter,项目名称:mcs-ICodeCompiler,代码行数:4,代码来源:namespace.cs

示例7: Define

		public virtual void Define (NamespaceContainer ctx)
		{
			resolved = expr.ResolveAsTypeOrNamespace (ctx);
			var ns = resolved as Namespace;
			if (ns == null) {
				if (resolved != null) {
					ctx.Module.Compiler.Report.SymbolRelatedToPreviousError (resolved.Type);
					ctx.Module.Compiler.Report.Error (138, Location,
						"`{0}' is a type not a namespace. A using namespace directive can only be applied to namespaces",
						GetSignatureForError ());
				}
			}
		}
开发者ID:GirlD,项目名称:mono,代码行数:13,代码来源:namespace.cs

示例8: case_21

void case_21()
#line 501 "cs-parser.jay"
{
		Attributes attrs = (Attributes) yyVals[-2+yyTop];
		var name = (MemberName) yyVals[0+yyTop];
		if (attrs != null) {
			bool valid_global_attrs = true;
			if ((current_namespace.DeclarationFound || current_namespace != file)) {
				valid_global_attrs = false;
			} else {
				foreach (var a in attrs.Attrs) {
					if (a.ExplicitTarget == "assembly" || a.ExplicitTarget == "module")
						continue;
						
					valid_global_attrs = false;
					break;
				}
			}
			
			if (!valid_global_attrs)
				report.Error (1671, name.Location, "A namespace declaration cannot have modifiers or attributes");
		}
	
		module.AddAttributes (attrs, current_namespace);
		
		var ns = new NamespaceContainer (name, current_namespace);
		current_namespace.AddTypeContainer (ns);
		current_container = current_namespace = ns;
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:29,代码来源:cs-parser.cs

示例9: Visit

		public virtual void Visit (NamespaceContainer ns)
		{
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:3,代码来源:visit.cs

示例10: LookupExtensionMethod

		//
		// Does extension methods look up to find a method which matches name and extensionType.
		// Search starts from this namespace and continues hierarchically up to top level.
		//
		public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
		{
			List<MethodSpec> candidates = null;
			foreach (Namespace n in GetUsingTable ()) {
				var a = n.LookupExtensionMethod (this, extensionType, name, arity);
				if (a == null)
					continue;

				if (candidates == null)
					candidates = a;
				else
					candidates.AddRange (a);
			}

			scope = parent;
			if (candidates != null)
				return candidates;

			if (parent == null)
				return null;

			//
			// Inspect parent namespaces in namespace expression
			//
			Namespace parent_ns = ns.Parent;
			do {
				candidates = parent_ns.LookupExtensionMethod (this, extensionType, name, arity);
				if (candidates != null)
					return candidates;

				parent_ns = parent_ns.Parent;
			} while (parent_ns != null);

			//
			// Continue in parent scope
			//
			return parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:42,代码来源:namespace.cs

示例11: NamespaceContainer

		private NamespaceContainer (ModuleContainer module, NamespaceContainer parent, CompilationSourceFile file, Namespace ns, bool slave)
		{
			this.module = module;
			this.parent = parent;
			this.file = file;
			this.IsImplicit = true;
			this.ns = ns;
			this.SlaveDeclSpace = slave ? new RootDeclSpace (module, this) : null;
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:9,代码来源:namespace.cs

示例12: Visit

		public virtual void Visit (NamespaceContainer ns)
		{
			if (!AutoVisit)
				VisitTypeContainer (ns);
		}
开发者ID:rlfqudxo,项目名称:playscript-mono,代码行数:5,代码来源:visit.cs

示例13: LookupExtensionMethod

			public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
			{
				return null;
			}
开发者ID:ngraziano,项目名称:mono,代码行数:4,代码来源:class.cs

示例14: case_24

void case_24()
#line 543 "cs-parser.jay"
{
		report.Error (1514, lexer.Location, "Unexpected symbol `{0}', expecting `.' or `{{'", GetSymbolName (yyToken));

		var name = (MemberName) yyVals[0+yyTop];		
		var ns = new NamespaceContainer (name, current_namespace);
		lbag.AddLocation (ns, GetLocation (yyVals[-1+yyTop]));
		current_namespace.AddTypeContainer (ns);
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:10,代码来源:cs-parser.cs

示例15: DeclSpace

		public DeclSpace (NamespaceContainer ns, DeclSpace parent, MemberName name,
				  Attributes attrs)
			: base (parent, name, attrs)
		{
			NamespaceEntry = ns;
			Basename = name.Basename;
			defined_names = new Dictionary<string, MemberCore> ();
			PartialContainer = null;
			if (name.TypeArguments != null) {
				is_generic = true;
				count_type_params = name.TypeArguments.Count;
			}
			if (parent != null)
				count_type_params += parent.count_type_params;
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:15,代码来源:decl.cs


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