<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-171924705653813582.post7869402381742527143..comments</id><updated>2009-05-22T21:28:41.436+03:00</updated><title type='text'>Comments on It Could Be Done!: Calling Virtual Method of a Class Base to Base Cla...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://couldbedone.blogspot.com/feeds/7869402381742527143/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html'/><author><name>Yuriy Solodkyy</name><uri>http://www.blogger.com/profile/04926659302956943479</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-740805171508675165</id><published>2008-11-26T03:02:00.000+02:00</published><updated>2008-11-26T03:02:00.000+02:00</updated><title type='text'>It is not pretty but using explicit interface impl...</title><content type='html'>It is not pretty but using explicit interface implementation in C# is doable.&lt;BR/&gt;&lt;BR/&gt;using System;&lt;BR/&gt;&lt;BR/&gt;namespace derivedevent&lt;BR/&gt;{&lt;BR/&gt;    internal interface Blah&lt;BR/&gt;    {&lt;BR/&gt;        void Test ();&lt;BR/&gt;    }&lt;BR/&gt;    &lt;BR/&gt;    class Program : Blah&lt;BR/&gt;    {&lt;BR/&gt;        static void Main (string[] args)&lt;BR/&gt;        {&lt;BR/&gt;            new Program3 ().Test ();&lt;BR/&gt;        }&lt;BR/&gt;&lt;BR/&gt;        public virtual void Test ()&lt;BR/&gt;        {&lt;BR/&gt;            ((Blah)this).Test ();&lt;BR/&gt;        }&lt;BR/&gt;&lt;BR/&gt;        void Blah.Test ()&lt;BR/&gt;        {&lt;BR/&gt;            Console.WriteLine ("Program");&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;    class Program2 : Program&lt;BR/&gt;    {&lt;BR/&gt;        public override void Test ()&lt;BR/&gt;        {&lt;BR/&gt;            base.Test ();&lt;BR/&gt;            Console.WriteLine ("Program2");&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;    class Program3: Program2&lt;BR/&gt;    {&lt;BR/&gt;        public override void Test ()&lt;BR/&gt;        {&lt;BR/&gt;            ((Blah)this).Test ();&lt;BR/&gt;            Console.WriteLine ("Program3");&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/740805171508675165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/740805171508675165'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1227661320000#c740805171508675165' title=''/><author><name>Bill</name><uri>http://www.blogger.com/profile/03617441895157063569</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-5189931899396824781</id><published>2008-06-16T13:00:00.000+03:00</published><updated>2008-06-16T13:00:00.000+03:00</updated><title type='text'>Really nice article ...thanks buddy..wat is the ma...</title><content type='html'>Really nice article ...thanks buddy..wat is the magic behind this, could you explain me..&lt;BR/&gt;&lt;BR/&gt;My Name : senthilkumar&lt;BR/&gt;Email :senthil.mailto@gmail.com</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/5189931899396824781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/5189931899396824781'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1213610400000#c5189931899396824781' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-1556985342186253011</id><published>2008-04-30T22:25:00.000+03:00</published><updated>2008-04-30T22:25:00.000+03:00</updated><title type='text'>In VB.Net you can implement a 'helper' method in t...</title><content type='html'>In VB.Net you can implement a 'helper' method in the base class and call it from DerivedFromDerived. It will look something like:&lt;BR/&gt;&lt;BR/&gt;Class CBase&lt;BR/&gt;  ... &lt;BR/&gt;  Public Sub HelperTest(...)&lt;BR/&gt;    MyClass.Test(...)&lt;BR/&gt;  End Sub&lt;BR/&gt;&lt;BR/&gt;End Class&lt;BR/&gt;&lt;BR/&gt;And then do: objDerFromDer.HelperTest()&lt;BR/&gt;&lt;BR/&gt;This capability is not available in C# :(</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/1556985342186253011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/1556985342186253011'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1209583500000#c1556985342186253011' title=''/><author><name>Iassen Assenov</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-2892969034286677141</id><published>2008-04-25T22:38:00.000+03:00</published><updated>2008-04-25T22:38:00.000+03:00</updated><title type='text'>I havn't tried, but I am sure that this requires f...</title><content type='html'>I havn't tried, but I am sure that this requires full trust.  C++  sample woks in partial trust environment.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/2892969034286677141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/2892969034286677141'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1209152280000#c2892969034286677141' title=''/><author><name>Yuriy Solodkyy</name><uri>http://www.blogger.com/profile/04926659302956943479</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03430031748913176409'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-5158120629547759508</id><published>2008-04-25T19:52:00.000+03:00</published><updated>2008-04-25T19:52:00.000+03:00</updated><title type='text'>from http://www.rsdn.ru/forum/?mid=475911using Sys...</title><content type='html'>from http://www.rsdn.ru/forum/?mid=475911&lt;BR/&gt;&lt;BR/&gt;using System;&lt;BR/&gt;using System.Reflection;&lt;BR/&gt;&lt;BR/&gt;namespace ConsoleApplication1 {&lt;BR/&gt;&lt;BR/&gt;    class Class1 {&lt;BR/&gt;&lt;BR/&gt;        [STAThread]&lt;BR/&gt;        static void Main(string[] args) {&lt;BR/&gt;            new C().Test();&lt;BR/&gt;            Console.ReadLine();&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;    public delegate void MD();&lt;BR/&gt;&lt;BR/&gt;    class A {&lt;BR/&gt;        protected virtual void M() {&lt;BR/&gt;            Console.WriteLine("A.M");&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;    class B:A {&lt;BR/&gt;        protected override void M() {&lt;BR/&gt;            Console.WriteLine("B.M");&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;    class C:B {&lt;BR/&gt;        protected override void M() {&lt;BR/&gt;            Console.WriteLine("C.M");&lt;BR/&gt;        }&lt;BR/&gt;        public void Test() {&lt;BR/&gt;            A a = new A();&lt;BR/&gt;            MD am = (MD)Delegate.CreateDelegate(typeof(MD), a, "M");&lt;BR/&gt;            am.GetType().BaseType.BaseType.GetField("_target", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(am, this);&lt;BR/&gt;            am();        }&lt;BR/&gt;&lt;BR/&gt;    }&lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/5158120629547759508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/5158120629547759508'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1209142320000#c5158120629547759508' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-3968091454957463323</id><published>2008-01-29T17:13:00.000+02:00</published><updated>2008-01-29T17:13:00.000+02:00</updated><title type='text'>Unfortunatelly, i have no solution for this in C#....</title><content type='html'>Unfortunatelly, i have no solution for this in C#.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/3968091454957463323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/3968091454957463323'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1201619580000#c3968091454957463323' title=''/><author><name>Yuriy Solodkyy</name><uri>http://www.blogger.com/profile/04926659302956943479</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03430031748913176409'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-171924705653813582.post-1870919359056128362</id><published>2008-01-29T17:05:00.000+02:00</published><updated>2008-01-29T17:05:00.000+02:00</updated><title type='text'>Any chance for porting/using this in C#? Examples ...</title><content type='html'>Any chance for porting/using this in C#? Examples would be appreciated.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/1870919359056128362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/171924705653813582/7869402381742527143/comments/default/1870919359056128362'/><link rel='alternate' type='text/html' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html?showComment=1201619100000#c1870919359056128362' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://couldbedone.blogspot.com/2007/08/calling-virtual-method-of-class-base-to.html' ref='tag:blogger.com,1999:blog-171924705653813582.post-7869402381742527143' source='http://www.blogger.com/feeds/171924705653813582/posts/default/7869402381742527143' type='text/html'/></entry></feed>