Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
GeneralDataGrid alterations... Pin
james-cxx3-Sep-03 13:11
james-cxx3-Sep-03 13:11 
GeneralRe: DataGrid alterations... Pin
A.Wegierski3-Sep-03 19:21
A.Wegierski3-Sep-03 19:21 
GeneralRe: DataGrid alterations... Pin
Braulio Dez3-Sep-03 23:58
Braulio Dez3-Sep-03 23:58 
GeneralRe: DataGrid alterations... Pin
james-cxx4-Sep-03 7:10
james-cxx4-Sep-03 7:10 
GeneralListViews: Sort ascending/descending Pin
tsigo3-Sep-03 10:36
tsigo3-Sep-03 10:36 
GeneralRe: ListViews: Sort ascending/descending Pin
Furty3-Sep-03 20:08
Furty3-Sep-03 20:08 
GeneralRe: ListViews: Sort ascending/descending Pin
tsigo6-Sep-03 11:00
tsigo6-Sep-03 11:00 
GeneralObtaining Caller of a Method in C# Pin
TheLastBastion3-Sep-03 9:21
TheLastBastion3-Sep-03 9:21 
I was wondering if there is any (preferably relatively straighforward) way for a method in C# to obtain the object which made the call. For example...
namespace Example
{
   public class A
   {

      private B b;

      public A()
      {
         b = new B();
         b.Call();
      }
   }

   public class B
   {
      public B()
      {
      }
  
      public void Call()
      {
        //So, who called this function?
        object caller = null;   // Replace null with what so that
                                // we get the instance of A making
                                // the call.
      }

   }

}

I hope this makes some sense. Any hints / tips are much appreciated.

--
The Last Bastion
GeneralRe: Obtaining Caller of a Method in C# Pin
leppie3-Sep-03 10:16
leppie3-Sep-03 10:16 
GeneralRe: Obtaining Caller of a Method in C# Pin
James Simpson3-Sep-03 10:28
James Simpson3-Sep-03 10:28 
GeneralRe: Obtaining Caller of a Method in C# Pin
leppie3-Sep-03 13:33
leppie3-Sep-03 13:33 
GeneralRe: Obtaining Caller of a Method in C# Pin
James T. Johnson3-Sep-03 14:32
James T. Johnson3-Sep-03 14:32 
GeneralRe: Obtaining Caller of a Method in C# Pin
Jerry Dennany3-Sep-03 14:34
Jerry Dennany3-Sep-03 14:34 
GeneralPInvoke Pin
Anonymous3-Sep-03 9:17
Anonymous3-Sep-03 9:17 
GeneralDesign Patterns - on a mission. Pin
Aroogala3-Sep-03 6:58
Aroogala3-Sep-03 6:58 
GeneralRe: Design Patterns - on a mission. Pin
Anonymous3-Sep-03 7:37
Anonymous3-Sep-03 7:37 
GeneralRe: Design Patterns - on a mission. Pin
Jim Stewart4-Sep-03 3:27
Jim Stewart4-Sep-03 3:27 
GeneralOleDbException: Multiple-step OLE DB operation generated errors. Pin
mikemilano3-Sep-03 6:41
mikemilano3-Sep-03 6:41 
GeneralVB script to C# Pin
Majid Shahabfar3-Sep-03 4:35
Majid Shahabfar3-Sep-03 4:35 
GeneralRe: VB script to C# Pin
Alvaro Mendez3-Sep-03 6:29
Alvaro Mendez3-Sep-03 6:29 
GeneralRe: VB script to C# Pin
Majid Shahabfar3-Sep-03 19:03
Majid Shahabfar3-Sep-03 19:03 
GeneralRe: VB script to C# Pin
Corinna John4-Sep-03 2:00
Corinna John4-Sep-03 2:00 
GeneralRe: VB script to C# Pin
Majid Shahabfar6-Sep-03 3:42
Majid Shahabfar6-Sep-03 3:42 
GeneralRe: VB script to C# Pin
Richard Deeming5-Sep-03 8:05
mveRichard Deeming5-Sep-03 8:05 
GeneralRe: VB script to C# Pin
Majid Shahabfar6-Sep-03 3:43
Majid Shahabfar6-Sep-03 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.