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

C# CSharp.EventProperty类代码示例

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

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



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

示例1: RemoveDelegateMethod

			public RemoveDelegateMethod (EventProperty method, Attributes attrs, Location loc)
				: base (method, RemovePrefix, attrs, loc)
			{
			}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:4,代码来源:property.cs


示例2: Visit

			public override void Visit (EventProperty ep)
			{
				EventDeclaration newEvent = new EventDeclaration ();
				
				var location = LocationsBag.GetMemberLocation (ep);
				AddModifiers (newEvent, location);
				
				if (location != null)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[0]), "event".Length), EventDeclaration.Roles.Keyword);
				newEvent.AddChild ((INode)ep.TypeName.Accept (this), EventDeclaration.Roles.ReturnType);
				newEvent.AddChild (new Identifier (ep.MemberName.Name, Convert (ep.MemberName.Location)), EventDeclaration.Roles.Identifier);
				if (location != null)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[1]), 1), EventDeclaration.Roles.LBrace);
				
				if (ep.Add != null) {
					MonoDevelop.CSharp.Dom.Accessor addAccessor = new MonoDevelop.CSharp.Dom.Accessor ();
					var addLocation = LocationsBag.GetMemberLocation (ep.Add);
					AddModifiers (addAccessor, addLocation);
					addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location), "add".Length), EventDeclaration.Roles.Keyword);
					if (ep.Add.Block != null)
						addAccessor.AddChild ((INode)ep.Add.Block.Accept (this), EventDeclaration.Roles.Body);
					newEvent.AddChild (addAccessor, EventDeclaration.EventAddRole);
				}
				
				if (ep.Remove != null) {
					MonoDevelop.CSharp.Dom.Accessor removeAccessor = new MonoDevelop.CSharp.Dom.Accessor ();
					var removeLocation = LocationsBag.GetMemberLocation (ep.Remove);
					AddModifiers (removeAccessor, removeLocation);
					removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location), "remove".Length), EventDeclaration.Roles.Keyword);
					
					if (ep.Remove.Block != null)
						removeAccessor.AddChild ((INode)ep.Remove.Block.Accept (this), EventDeclaration.Roles.Body);
					newEvent.AddChild (removeAccessor, EventDeclaration.EventRemoveRole);
				}
				if (location != null)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[2]), 1), EventDeclaration.Roles.RBrace);
				
				typeStack.Peek ().AddChild (newEvent, TypeDeclaration.Roles.Member);
			}
开发者ID:pgoron,项目名称:monodevelop,代码行数:39,代码来源:CSharpParser.cs


示例3: Visit

			public override void Visit(EventProperty ep)
			{
				var newEvent = new CustomEventDeclaration();
				AddAttributeSection(newEvent, ep);
				var location = LocationsBag.GetMemberLocation(ep);
				AddModifiers(newEvent, location);
				
				if (location != null && location.Count > 0)
					newEvent.AddChild(new CSharpTokenNode(Convert(location [0]), CustomEventDeclaration.EventKeywordRole), CustomEventDeclaration.EventKeywordRole);
				newEvent.AddChild(ConvertToType(ep.TypeExpression), Roles.Type);
				
				AddExplicitInterface(newEvent, ep.MemberName);
				
				newEvent.AddChild(Identifier.Create(ep.MemberName.Name, Convert(ep.Location)), Roles.Identifier);

				if (location != null && location.Count >= 2)
					newEvent.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LBrace), Roles.LBrace);
				
				if (ep.Add != null) {
					var addAccessor = new Accessor();
					AddAttributeSection(addAccessor, ep.Add);
					var addLocation = LocationsBag.GetMemberLocation(ep.Add);
					AddModifiers(addAccessor, addLocation);
					addAccessor.AddChild(new CSharpTokenNode(Convert(ep.Add.Location), CustomEventDeclaration.AddKeywordRole), CustomEventDeclaration.AddKeywordRole);
					if (ep.Add.Block != null)
						addAccessor.AddChild((BlockStatement)ep.Add.Block.Accept(this), Roles.Body);
					newEvent.AddChild(addAccessor, CustomEventDeclaration.AddAccessorRole);
				}
				
				if (ep.Remove != null) {
					var removeAccessor = new Accessor();
					AddAttributeSection(removeAccessor, ep.Remove);
					var removeLocation = LocationsBag.GetMemberLocation(ep.Remove);
					AddModifiers(removeAccessor, removeLocation);
					removeAccessor.AddChild(new CSharpTokenNode(Convert(ep.Remove.Location), CustomEventDeclaration.RemoveKeywordRole), CustomEventDeclaration.RemoveKeywordRole);
					
					if (ep.Remove.Block != null)
						removeAccessor.AddChild((BlockStatement)ep.Remove.Block.Accept(this), Roles.Body);
					newEvent.AddChild(removeAccessor, CustomEventDeclaration.RemoveAccessorRole);
				}
				if (location != null && location.Count >= 3) {
					newEvent.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RBrace), Roles.RBrace);
				} else {
					// parser error, set end node to max value.
					newEvent.AddChild(new ErrorNode(), Roles.Error);
				}
				
				typeStack.Peek().AddChild(newEvent, Roles.TypeMemberRole);
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:49,代码来源:CSharpParser.cs


示例4: AEventPropertyAccessor

			protected AEventPropertyAccessor (EventProperty method, string prefix, Attributes attrs, Location loc)
				: base (method, prefix, attrs, loc)
			{
			}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:4,代码来源:property.cs


示例5: Visit

			public override void Visit (EventProperty ep)
			{
				CustomEventDeclaration newEvent = new CustomEventDeclaration ();
				AddAttributeSection (newEvent, ep);
				var location = LocationsBag.GetMemberLocation (ep);
				AddModifiers (newEvent, location);
				
				if (location != null)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[0]), "event".Length), CustomEventDeclaration.Roles.Keyword);
				newEvent.AddChild (ConvertToType (ep.TypeName), CustomEventDeclaration.Roles.Type);
				if (ep.MemberName.Left != null) {
					newEvent.AddChild (ConvertToType (ep.MemberName.Left), CustomEventDeclaration.PrivateImplementationTypeRole);
					var privateImplTypeLoc = LocationsBag.GetLocations (ep.MemberName.Left);
					if (privateImplTypeLoc != null)
						newEvent.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc[0]), 1), MethodDeclaration.Roles.Dot);
				}
				
				newEvent.AddChild (Identifier.Create (ep.MemberName.Name, Convert (ep.Location)), CustomEventDeclaration.Roles.Identifier);

				if (location != null && location.Count >= 2)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CustomEventDeclaration.Roles.LBrace);
				
				if (ep.Add != null) {
					Accessor addAccessor = new Accessor ();
					AddAttributeSection (addAccessor, ep.Add);
					var addLocation = LocationsBag.GetMemberLocation (ep.Add);
					AddModifiers (addAccessor, addLocation);
					addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location), "add".Length), CustomEventDeclaration.Roles.Keyword);
					if (ep.Add.Block != null)
						addAccessor.AddChild ((BlockStatement)ep.Add.Block.Accept (this), CustomEventDeclaration.Roles.Body);
					newEvent.AddChild (addAccessor, CustomEventDeclaration.AddAccessorRole);
				}
				
				if (ep.Remove != null) {
					Accessor removeAccessor = new Accessor ();
					AddAttributeSection (removeAccessor, ep.Remove);
					var removeLocation = LocationsBag.GetMemberLocation (ep.Remove);
					AddModifiers (removeAccessor, removeLocation);
					removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location), "remove".Length), CustomEventDeclaration.Roles.Keyword);
					
					if (ep.Remove.Block != null)
						removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), CustomEventDeclaration.Roles.Body);
					newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole);
				}
				if (location != null && location.Count >= 3) {
					newEvent.AddChild (new CSharpTokenNode (Convert (location[2]), 1), CustomEventDeclaration.Roles.RBrace);
				} else {
					// parser error, set end node to max value.
					newEvent.AddChild (new ErrorNode (), AstNode.Roles.Error);
				}
				
				typeStack.Peek ().AddChild (newEvent, TypeDeclaration.MemberRole);
			}
开发者ID:N3X15,项目名称:ILSpy,代码行数:53,代码来源:CSharpParser.cs


示例6: Visit

			public override void Visit (EventProperty e)
			{
				DomEvent evt = new DomEvent ();
				evt.Name = ConvertQuoted (e.MemberName.Name);
				evt.Documentation = RetrieveDocumentation (e.Location.Row);
				evt.Location = Convert (e.MemberName.Location);
				evt.Modifiers = ConvertModifiers (e.ModFlags);
				evt.ReturnType = ConvertReturnType (e.TypeName);
				var location = LocationsBag.GetMemberLocation (e);
				if (location != null)
					evt.BodyRegion = ConvertRegion (location[1], location[location.Count - 1]);
				
				AddAttributes (evt, e.OptAttributes, e);
				AddExplicitInterfaces (evt, e);
				
				evt.DeclaringType = typeStack.Peek ();
				typeStack.Peek ().Add (evt);
			}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:18,代码来源:McsParser.cs


示例7: Visit

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


示例8: Visit

			public override void Visit (EventProperty e)
			{
				DomEvent evt = new DomEvent ();
				evt.Name = e.MemberName.Name;
				evt.Documentation = RetrieveDocumentation (e.Location.Row);
				evt.Location = Convert (e.MemberName.Location);
				evt.Modifiers = ConvertModifiers (e.ModFlags);
				evt.ReturnType = ConvertReturnType (e.TypeName);
				var location = LocationsBag.GetMemberLocation (e);
				if (location != null)
					evt.BodyRegion = ConvertRegion (location[0], location[1]);
				
//				if (e.Add != null) {
//					property.GetterModifier = ConvertModifiers (p.Get.ModFlags);
//					if (p.Get.Block != null)
//						property.GetRegion = ConvertRegion (p.Get.Location, p.Get.Block.EndLocation);
//				}
//				
//				if (e.Remove != null) {
//					property.GetterModifier = ConvertModifiers (p.Get.ModFlags);
//					if (p.Get.Block != null)
//						property.GetRegion = ConvertRegion (p.Get.Location, p.Get.Block.EndLocation);
//				}
				
				AddAttributes (evt, e.OptAttributes);
				AddExplicitInterfaces (evt, e);
				
				evt.DeclaringType = typeStack.Peek ();
				typeStack.Peek ().Add (evt);
			}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:30,代码来源:McsParser.cs


示例9: yyparse


//.........这里部分代码省略.........
		current_local_parameters = new ParametersCompiled (compiler,
			new Parameter (implicit_value_parameter_type, "value", 
			Parameter.Modifier.NONE, null, GetLocation (yyVals[-3+yyTop])));

		lexer.EventParsing = true;
	  }
  break;
case 293:
#line 2286 "cs-parser.jay"
  {
		lexer.EventParsing = false;  
	  }
  break;
case 294:
#line 2290 "cs-parser.jay"
  {
		MemberName name = (MemberName) yyVals[-5+yyTop];
		
		if (current_container.Kind == MemberKind.Interface) {
			Report.Error (69, GetLocation (yyVals[-7+yyTop]), "Event in interface cannot have add or remove accessors");
			yyVals[-2+yyTop] = new Accessors (null, null);
		} else if (yyVals[-2+yyTop] == null) {
			Report.Error (65, GetLocation (yyVals[-7+yyTop]), "`{0}.{1}': event property must have both add and remove accessors",
				current_container.GetSignatureForError (), name.GetSignatureForError ());
			yyVals[-2+yyTop] = new Accessors (null, null);
		}
		
		Accessors accessors = (Accessors) yyVals[-2+yyTop];

		if (accessors.get_or_add == null || accessors.set_or_remove == null)
			/* CS0073 is already reported, so no CS0065 here.*/
			yyVal = null;
		else {
			Event e = new EventProperty (
				current_class, (FullNamedExpression) yyVals[-6+yyTop], (Modifiers) yyVals[-8+yyTop], name,
				(Attributes) yyVals[-9+yyTop], accessors.get_or_add, accessors.set_or_remove);
			if (RootContext.Documentation != null) {
				e.DocComment = Lexer.consume_doc_comment ();
				Lexer.doc_state = XmlCommentState.Allowed;
			}

			current_container.AddEvent (e);
			implicit_value_parameter_type = null;
		}
		current_local_parameters = null;
	  }
  break;
case 295:
#line 2322 "cs-parser.jay"
  {
		MemberName mn = (MemberName) yyVals[-1+yyTop];
		if (mn.Left != null)
			Report.Error (71, mn.Location, "An explicit interface implementation of an event must use property syntax");

		if (RootContext.Documentation != null)
			Lexer.doc_state = XmlCommentState.Allowed;

		Error_SyntaxError (yyToken);
		yyVal = null;
	  }
  break;
case 296:
#line 2337 "cs-parser.jay"
  {
		yyVal = new Accessors ((Accessor) yyVals[-1+yyTop], (Accessor) yyVals[0+yyTop]);
	  }
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs


示例10: Visit

			public override void Visit (EventProperty ep)
			{
				CustomEventDeclaration newEvent = new CustomEventDeclaration ();
				
				var location = LocationsBag.GetMemberLocation (ep);
				AddModifiers (newEvent, location);
				
				if (location != null)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[0]), "event".Length), CustomEventDeclaration.Roles.Keyword);
				newEvent.AddChild (ConvertToType (ep.TypeName), CustomEventDeclaration.Roles.Type);
				newEvent.AddChild (new Identifier (ep.MemberName.Name, Convert (ep.MemberName.Location)), CustomEventDeclaration.Roles.Identifier);
				if (location != null && location.Count >= 2)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CustomEventDeclaration.Roles.LBrace);
				
				if (ep.Add != null) {
					Accessor addAccessor = new Accessor ();
					var addLocation = LocationsBag.GetMemberLocation (ep.Add);
					AddModifiers (addAccessor, addLocation);
					addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location), "add".Length), CustomEventDeclaration.Roles.Keyword);
					if (ep.Add.Block != null)
						addAccessor.AddChild ((BlockStatement)ep.Add.Block.Accept (this), CustomEventDeclaration.Roles.Body);
					newEvent.AddChild (addAccessor, CustomEventDeclaration.AddAccessorRole);
				}
				
				if (ep.Remove != null) {
					Accessor removeAccessor = new Accessor ();
					var removeLocation = LocationsBag.GetMemberLocation (ep.Remove);
					AddModifiers (removeAccessor, removeLocation);
					removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location), "remove".Length), CustomEventDeclaration.Roles.Keyword);
					
					if (ep.Remove.Block != null)
						removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), CustomEventDeclaration.Roles.Body);
					newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole);
				}
				if (location != null && location.Count >= 3)
					newEvent.AddChild (new CSharpTokenNode (Convert (location[2]), 1), CustomEventDeclaration.Roles.RBrace);
				
				typeStack.Peek ().AddChild (newEvent, TypeDeclaration.MemberRole);
			}
开发者ID:madkat,项目名称:NRefactory,代码行数:39,代码来源:CSharpParser.cs


示例11: RemoveDelegateMethod

 public RemoveDelegateMethod(EventProperty method, Accessor accessor)
     : base(method, accessor, RemovePrefix)
 {
 }
开发者ID:speier,项目名称:shake,代码行数:4,代码来源:property.cs


示例12: AEventPropertyAccessor

 protected AEventPropertyAccessor(EventProperty method, Accessor accessor, string prefix)
     : base(method, accessor, prefix)
 {
 }
开发者ID:speier,项目名称:shake,代码行数:4,代码来源:property.cs


示例13: AddDelegateMethod

 public AddDelegateMethod(EventProperty method, Accessor accessor)
     : base(method, accessor, AddPrefix)
 {
 }
开发者ID:speier,项目名称:shake,代码行数:4,代码来源:property.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CSharp.ExplicitBlock类代码示例发布时间:2022-05-26
下一篇:
C# CSharp.EventField类代码示例发布时间: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