subscribing an event to a class object before initializing it
<p>I have two classes class A and B.I have a delegate n event published in class B.The class B object is declared in class A.All he functionality dependes on the parameterised constru ctor of class B. Before initializing the object of class B i need to subscibe the event for it.how to do it?
e.g </p>

<pre><code>public class B
{
  public delegate void myDel(string);
  public event myDel myEvent;

 B(object obj)
   {
           -----------------
           ------------------
    }
}


class A
{
   A objA;
   class XYZ objXYZ;

   void func()
    {
       objA.myEvent+=new myDel();
       objA=new A(objXYZ);   //     hw to attain this?              

    }
}
</code></pre>
