示例#1
0
文件: CsToTs.cs 项目: RReverser/Netjs
				public override void VisitEventDeclaration (EventDeclaration eventDeclaration)
				{
					base.VisitEventDeclaration (eventDeclaration);

					var fd = new FieldDeclaration {
						Name = eventDeclaration.Name,
						ReturnType = new SimpleType ("NEvent", eventDeclaration.ReturnType.Clone ()),
					};
					foreach (var v in eventDeclaration.Variables) {
						fd.Variables.Add (new VariableInitializer (
							v.Name,
							IsInterface (eventDeclaration.GetParent<TypeDeclaration> ()) ? null : new ObjectCreateExpression (new SimpleType ("NEvent", eventDeclaration.ReturnType.Clone ()))));

					}

					eventDeclaration.ReplaceWith (fd);
				}