public void Test_Event()
 => TestEventSignature(typeof(SomeClass),
                       "function onAppMemoryUsageIncreased(eventArgs) { /* Your code */ }" + MemberFormatter.GetLineEnding() +
                       "someClass.addEventListener(\"appmemoryusageincreased\", onAppMemoryUsageIncreased);" + MemberFormatter.GetLineEnding() +
                       "someClass.removeEventListener(\"appmemoryusageincreased\", onAppMemoryUsageIncreased);" + MemberFormatter.GetLineEnding() +
                       "- or -" + MemberFormatter.GetLineEnding() +
                       "someClass.onappmemoryusageincreased = onAppMemoryUsageIncreased;",
                       nameof(SomeClass.AppMemoryUsageIncreased));
 public void Test_StaticEvent()
 => TestEventSignature(typeof(SomeClass),
                       "function onStaticEvent(eventArgs) { /* Your code */ }" + MemberFormatter.GetLineEnding() +
                       "mdoc.Test.SampleClasses.SomeClass.addEventListener(\"staticevent\", onStaticEvent);" + MemberFormatter.GetLineEnding() +
                       "mdoc.Test.SampleClasses.SomeClass.removeEventListener(\"staticevent\", onStaticEvent);" + MemberFormatter.GetLineEnding() +
                       "- or -" + MemberFormatter.GetLineEnding() +
                       "mdoc.Test.SampleClasses.SomeClass.onstaticevent = onStaticEvent;",
                       nameof(SomeClass.StaticEvent));
Example #3
0
 protected static string FormatEndings(string s)
 {
     return(s?.Replace("\r\n", MemberFormatter.GetLineEnding()));
 }