text: Q:
  
  C# TcpClient extension, base class upconversion
  
  I am currently writing a little Tcp class capable of multithreaded client handling and so on. Therefore, I have to extend the TcpClient in System.Net.Sockets for added functionality such as directly writing a string and so on. Now I am a little stuck when it comes to upconverting a TcpClient base class into the TCP_ModifiedClient (the extended class).
  Currently, I am trying to copy all Properties as follows, however, I am getting the error, that a socket can only be assigned when it is not connected.
  The TcpClient that has to be upconverted is connected by design.
  The Code for Property-Copying:
  PropertyDescriptorCollection sp = TypeDescriptor.GetProperties(new TcpClient());
  PropertyDescriptorCollection tp = TypeDescriptor.GetProperties(new TCP_ModifiedClient());
  foreach (PropertyDescriptor pdt in tp)
      foreach (PropertyDescriptor pds in sp)
          if (pdt.Name == pds.Name)
              pdt.SetValue(this, pds.GetValue(client));
  
  Is there any elegant solution to this? In the worst case szenario, I would add a private variable of type TcpClient to the TCP_ModifiedClient class whilst implementing all public methods of TcpClient, however I was hoping to get the extension sorted via inheritance.
  I sincerely hope somebody is capable of helping.
  * EDIT *
  Okay. I may have not expressed myself precisely. 
  As previously mentioned, I am writing a little class capable of providing a convenient way of doing server/client applications. For this, I am implementing a TcpClient replacement class adding functionality such as in-class writing/reading to/from the TcpClient's base stream, automatic establishing of a AES secured connection and so on. Currently, this replacement class TCP_ModifiedClient inherits from TcpClient. Since the .NET network functions use TcpClient, I must implement a conversion method from TcpClient to TCP_ModifiedClient. Since my current implementation of TCP_ModifiedClient is inheriting from TcpClient, I originally intended to add a constructor to TCP_ModifiedClient accepting a TcpClient as parameter and then assining this as the base class of TCP_ModifiedClient. This obviously does not work, therefore, in my above given code, I tried to assign all properties from TcpClient to TCP_ModifiedClient.
  Hopefully, this was a little clearer. It's currently 1:15AM, so sorry for any repetition/mind-blockedness.
  
  A:
  
  This is an interesting question because it is not clear what the misunderstanding is. It seems you want to create a class that kind of looks like a TcpClient but that does things differently. The way to do this is to write such a class yourself and implement it. You might wrap a TcpClient doing that.
  It is not possible in .NET to copy properties to mimic another object. (Are you a JavaScript developer?) Type members in .NET are statically defined and not changeable. Since TcpClient does not look like it is made to be inherited from you cannot achieve your goal using inheritance either. You must implement a fresh class.
  This is the right way to do it. Composition is preferred over inheritance if inheritance would just be a way to share code and type less. Don't pull in all TcpClient members. Just expose the members that you need and that make sense to expose. "In the worst case szenario" turns out this worst case scenario is the best case from a design standpoint.
  
  