I
Ido Samuelson
Hello,
What do you think about the following features:
public class GenericDecorator<T> : T
{
}
can leverage to a few things:
public interface IChannel
{
void Connect();
void Disconnect();
}
public class TcpChannel : IChannel
{
....
}
public class ChannelDescriber<T> : T where T : IChannel, class
{
public string ChannelName {get; set;}
}
another more complicated example:
public class Extender<T,K> : T
{
public K Data {get;set;}
}
which can be use to :
Extender<EventArgs,string> extender;
extender.Data (give the same ability as EventArgs<T> but more generic which can leverage other types that do not support generics.
Last is for delegates aka
delegate void extendDelegate<T,K>(K t) : T where T : delegate
// K should be added as first parameter.
and usage:
extendDelegate<ThreadStart,string> Start;
Start("hello world");
which means that even further we can do this:
System.Threading.Thread.Start(Start("ido",null)); // anonymous delegates feature
void Start(string name, object state);
you can vote for the feature in the following like:
https://connect.microsoft.com/Visua...Feedback.aspx?FeedbackID=299676&wa=wsignin1.0
What do you think about the following features:
public class GenericDecorator<T> : T
{
}
can leverage to a few things:
public interface IChannel
{
void Connect();
void Disconnect();
}
public class TcpChannel : IChannel
{
....
}
public class ChannelDescriber<T> : T where T : IChannel, class
{
public string ChannelName {get; set;}
}
another more complicated example:
public class Extender<T,K> : T
{
public K Data {get;set;}
}
which can be use to :
Extender<EventArgs,string> extender;
extender.Data (give the same ability as EventArgs<T> but more generic which can leverage other types that do not support generics.
Last is for delegates aka
delegate void extendDelegate<T,K>(K t) : T where T : delegate
// K should be added as first parameter.
and usage:
extendDelegate<ThreadStart,string> Start;
Start("hello world");
which means that even further we can do this:
System.Threading.Thread.Start(Start("ido",null)); // anonymous delegates feature
void Start(string name, object state);
you can vote for the feature in the following like:
https://connect.microsoft.com/Visua...Feedback.aspx?FeedbackID=299676&wa=wsignin1.0