Click here to Skip to main content
15,888,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: windows application Pin
_mubashir30-Apr-06 23:57
_mubashir30-Apr-06 23:57 
AnswerRe: windows application Pin
Colin Angus Mackay30-Apr-06 21:02
Colin Angus Mackay30-Apr-06 21:02 
QuestionNeed help....! Pin
samjlk30-Apr-06 19:53
samjlk30-Apr-06 19:53 
AnswerRe: Need help....! Pin
Robert Rohde30-Apr-06 21:52
Robert Rohde30-Apr-06 21:52 
GeneralRe: Need help....! Pin
samjlk30-Apr-06 22:32
samjlk30-Apr-06 22:32 
QuestionTwo Questions About Web UI Automation Pin
WaleedH30-Apr-06 19:31
WaleedH30-Apr-06 19:31 
QuestionProblem with Designer Serialization Pin
kamran6553630-Apr-06 16:57
kamran6553630-Apr-06 16:57 
AnswerRe: Problem with Designer Serialization Pin
Robert Rohde30-Apr-06 21:59
Robert Rohde30-Apr-06 21:59 
Hi,

here is some code from one of my projects (hopefully becoming an article soon) where I had the same problem. ProgressStep is in this case the class the designer didn't hadnle nicely:
[TypeConverter(typeof(ProgressStepConverter))]
public class ProgressStep
{
   public ProgressStep(Image image, string name, string description)
   {
      //...
   }

   //...
}

public class ProgressStepConverter : ExpandableObjectConverter
{	
   public override bool CanConvertTo(ITypeDescriptorContext context, Type destType) 
   {
      if (destType == typeof(InstanceDescriptor)) 
         return true;
      return base.CanConvertTo(context, destType);
   }

   public override object ConvertTo(ITypeDescriptorContext context, CultureInfo info, 
      object value, Type destType )
   {
      if (destType == typeof(InstanceDescriptor)) 
      {
         ProgressStep step = (ProgressStep)value;
         Type[] ctorTypes = new Type[] { typeof(Image), typeof(string), typeof(string) };
         object[] ctorParams = new object[] { step.Image, step.Name, step.Description };
         return new InstanceDescriptor(typeof(ProgressStep).GetConstructor(ctorTypes),
            ctorParams, true);
      }

      return base.ConvertTo(context, info, value, destType);
   }
}

GeneralRe: Problem with Designer Serialization Pin
kamran655361-May-06 2:59
kamran655361-May-06 2:59 
GeneralRe: Problem with Designer Serialization Pin
Robert Rohde1-May-06 3:32
Robert Rohde1-May-06 3:32 
GeneralRe: Problem with Designer Serialization Pin
kamran655362-May-06 3:43
kamran655362-May-06 3:43 
GeneralRe: Problem with Designer Serialization Pin
kamran655362-May-06 3:28
kamran655362-May-06 3:28 
GeneralRe: Problem with Designer Serialization Pin
kamran655362-May-06 3:33
kamran655362-May-06 3:33 
QuestionSelect Section of Image Pin
smarttom9930-Apr-06 15:37
smarttom9930-Apr-06 15:37 
AnswerRe: Select Section of Image Pin
Robert Rohde30-Apr-06 22:04
Robert Rohde30-Apr-06 22:04 
GeneralRe: Select Section of Image Pin
smarttom991-May-06 4:31
smarttom991-May-06 4:31 
QuestionList Box Pin
Sean8930-Apr-06 14:58
Sean8930-Apr-06 14:58 
AnswerRe: List Box Pin
Kuira30-Apr-06 16:56
Kuira30-Apr-06 16:56 
GeneralRe: List Box Pin
Sean891-May-06 9:10
Sean891-May-06 9:10 
GeneralRe: List Box Pin
Kuira1-May-06 13:33
Kuira1-May-06 13:33 
QuestionPersistent Button Pin
IceWater4230-Apr-06 13:35
IceWater4230-Apr-06 13:35 
AnswerRe: Persistent Button Pin
Stanciu Vlad30-Apr-06 21:54
Stanciu Vlad30-Apr-06 21:54 
GeneralRe: Persistent Button Pin
IceWater421-May-06 5:02
IceWater421-May-06 5:02 
GeneralRe: Persistent Button Pin
Stanciu Vlad1-May-06 7:13
Stanciu Vlad1-May-06 7:13 
GeneralRe: Persistent Button Pin
IceWater421-May-06 8:08
IceWater421-May-06 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.