{"id":226,"date":"2016-02-21T18:20:03","date_gmt":"2016-02-21T17:20:03","guid":{"rendered":"http:\/\/www.riedmann.it\/blog\/?p=226"},"modified":"2016-02-21T18:21:21","modified_gmt":"2016-02-21T17:21:21","slug":"event-sample","status":"publish","type":"post","link":"https:\/\/blog.riedmann.it\/?p=226","title":{"rendered":"Event sample"},"content":{"rendered":"<p>Today, trying to understand also events in Vulcan.NET\/X#, I wrote the following sample that should give an idea how events work in Vulcan.NET and X#.<\/p>\n<blockquote><p>\n#using EventSample<\/p>\n<p>begin namespace EventSample<\/p>\n<p>function Start( ) as void<br \/>\n&nbsp;&nbsp;local oClass2 as Sample2Class<\/p>\n<p>&nbsp;&nbsp;System.Console.WriteLine(&#8220;Start of the SampleEvent application&#8221;)  <\/p>\n<p>&nbsp;&nbsp;oClass2 := Sample2Class{}<br \/>\n&nbsp;&nbsp;oClass2:RegisterEvent()<\/p>\n<p>return                     <\/p>\n<p>public delegate SampleHandle( cParameter as string ) as void<\/p>\n<p>class SampleClass<br \/>\n&nbsp;&nbsp;public event oSampleEvent as SampleHandle<\/p>\n<p>constructor()<\/p>\n<p>&nbsp;&nbsp;return<\/p>\n<p>method CallSampleEvent() as void<\/p>\n<p>&nbsp;&nbsp;oSampleEvent( &#8220;Hi there&#8221; )<\/p>\n<p>&nbsp;&nbsp;return\t<\/p>\n<p>end class<\/p>\n<p>class Sample2Class<\/p>\n<p>constructor()       <\/p>\n<p>&nbsp;&nbsp;return              <\/p>\n<p>method RegisterEvent() as void<br \/>\n&nbsp;&nbsp;local oClass as SampleClass<\/p>\n<p>&nbsp;&nbsp;oClass := SampleClass{}<br \/>\n&nbsp;&nbsp;oClass:oSampleEvent += self:method2<br \/>\n&nbsp;&nbsp;oClass:CallSampleEvent()<\/p>\n<p>&nbsp;&nbsp;return              <\/p>\n<p>public method method2( cParameter as string ) as void<\/p>\n<p>&nbsp;&nbsp;System.Console.WriteLine( &#8220;method2:&#8221; + cParameter )\t<\/p>\n<p>&nbsp;&nbsp;return<\/p>\n<p>end class<\/p>\n<p>end namespace\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Today, trying to understand also events in Vulcan.NET\/X#, I wrote the following sample that should give an idea how events work in Vulcan.NET and X#. #using EventSample begin namespace EventSample function Start( ) as void &nbsp;&nbsp;local oClass2 as Sample2Class &nbsp;&nbsp;System.Console.WriteLine(&#8220;Start of the SampleEvent application&#8221;) &nbsp;&nbsp;oClass2 := Sample2Class{} &nbsp;&nbsp;oClass2:RegisterEvent() return public delegate SampleHandle( cParameter as string [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,23],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-vulcan-net-programming","category-x-programming"],"_links":{"self":[{"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226"}],"version-history":[{"count":2,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":228,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions\/228"}],"wp:attachment":[{"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.riedmann.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}