title: Override a method in the third party
body: <p>I have a third party party class say <code>Log</code>. It contains the methods</p>
  
  <pre><code>public void Write(string s, params object[] args)
  {
              Monitor.Enter(this);
              try
              {
                              string logEntry = string.Format(s, args);
                              this.Write(logEntry);
              }
              finally
              {
                              Monitor.Exit(this);
              }
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public void Write(string LogEntry)
  {
      this.Write(0, LogEntry);
  }
  </code></pre>
  
  <p>I defined a property <code>outLog</code> in my own class</p>
  
  <pre><code>public static Log OutLog  {get;set;}
  </code></pre>
  
  <p>I want to use the feature "CallerMemberNameAttribute" etc. in .net 4.5 and override the <code>Write</code> method as something like:</p>
  
  <pre><code>public void Write(string s,
      [CallerMemberName] string memberName = "",
      [CallerFilePath] string sourceFilePath = "",
      [CallerLineNumber] int sourceLineNumber = 0)
      {
          Monitor.Enter(this);
          try
          {
              string logEntry = string.Format(s, memberName, sourceFilePath, sourceLineNumber);
              this.Write(logEntry);
          }
          finally
          {
              Monitor.Exit(this);
          }
      }
  </code></pre>
  
  <p>So I can call it in my class:</p>
  
  <pre><code>outLog.Write(...);
  </code></pre>
  
  <p>Not sure how?</p>