How to call a C# object method/ change a field through an object pointer?
<p>Here is an easy question (C# noob here) and I can't find how to do this (I have C# 4.0 reference from Schildt but not sure what I am looking for yet).</p>

<p>Say I have two objects created by two different classes, but have fields and/or methods with the same name. For example:</p>

<pre><code>public class Object1 {
  bool enable;
  public void Reset(){
    enable = false;
  }
}

public class Object2 {
  bool enable;
  public void Reset(){
    enable = false;
  }
}
</code></pre>

<p>Objects are very dissimilar, justifying the creation of two different objects. However, I have many objects with the common 'enable' field and 'Reset()' method.</p>

<p>So here is what I would like to do (in pseudocode or whatever this is):</p>

<pre><code>void Manipulate(ref object pObj){
  (pObj).enable = true;
  (pObj).Reset();
}

void Main(){
  Manipulate(obj1);
  Manipulate(obj2);
}
</code></pre>

<p>How can I do this? I am not sure how to create an object that can point to objects from different classes.</p>

<p>Thanks!</p>

<hr>

<p>Thanks to all the answers. I went through interfaces and understood them as an 'alias' and couldn't figure out what was the usefulness of them.</p>
