using System;
using System.Collections.Generic;
using System.Text;

namespace CSharpBuch
{
   public class MyCom
   {
      object sender = null;

      public MyCom(object sender)
      {
         this.sender = sender;
      }

      public string DoSomething(string parameter)
      {
         ExecuteNotes();

         //little Businesslogic ;-)
         return parameter.ToUpper();
      }

      private void ExecuteNotes()
      {
         if (this.sender.GetType().IsClass)
         {
            switch (this.sender.GetType().BaseType.ToString())
            {
               case "System.Windows.Forms.Form":
                  Developer attribute = (Developer)Attribute.GetCustomAttribute
                  (this.sender.GetType(), typeof(Developer));

                  System.Diagnostics.EventLog.WriteEntry
                     (
                        this.sender.GetType().AssemblyQualifiedName.ToString(),
                        "Fehler sind aufgetreten:" + attribute.Entwickler + " " +
                        attribute.Abteilung + " " + attribute.Email
                     );

                  break;
            }
         }      
      }
   }
}


