Click here to Skip to main content
15,896,153 members
Home / Discussions / C#
   

C#

 
GeneralMy EllipseLabel - wrapping text question Pin
Anonymous4-May-05 5:25
Anonymous4-May-05 5:25 
GeneralRe: My EllipseLabel - wrapping text question Pin
keith maddox4-May-05 9:56
keith maddox4-May-05 9:56 
GeneralRe: My EllipseLabel - wrapping text question Pin
ICustomTypeDescriptor4-May-05 11:00
ICustomTypeDescriptor4-May-05 11:00 
GeneralSMS from a website Pin
Trance Junkie4-May-05 4:15
Trance Junkie4-May-05 4:15 
GeneralRe: SMS from a website Pin
Judah Gabriel Himango4-May-05 8:17
sponsorJudah Gabriel Himango4-May-05 8:17 
GeneralRe: SMS from a website Pin
Shashidharreddy6-May-05 23:15
Shashidharreddy6-May-05 23:15 
GeneralICustomTypeDescriptor - implementation Pin
Anonymous4-May-05 3:45
Anonymous4-May-05 3:45 
GeneralRe: ICustomTypeDescriptor - implementation Pin
Anonymous4-May-05 4:48
Anonymous4-May-05 4:48 
Is there another way?

Not that I'm aware of

If not, could anyone post some piece of code which implements the GetProperties method?

public class MyDescriptor : ICustomTypeDescriptor<br />
{<br />
  public TypeConverter GetConverter()<br />
  {<br />
    return TypeDescriptor.GetConverter(this, true);<br />
  }<br />
<br />
  public EventDescriptorCollection GetEvents(Attribute[] attributes)<br />
  {<br />
    return TypeDescriptor.GetEvents(this, attributes, true);<br />
  }<br />
<br />
  EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents()<br />
  {<br />
    return TypeDescriptor.GetEvents(this, true);<br />
  }<br />
<br />
  public string GetComponentName()<br />
  {<br />
    return TypeDescriptor.GetComponentName(this, true);<br />
  }<br />
<br />
  public object GetPropertyOwner(PropertyDescriptor pd)<br />
  {<br />
    return this;<br />
  }<br />
<br />
  public AttributeCollection GetAttributes()<br />
  {<br />
    return TypeDescriptor.GetAttributes(this, true);<br />
  }<br />
<br />
  public PropertyDescriptorCollection GetProperties(Attribute[] attributes)<br />
  {<br />
     PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(this, attributes, true);<br />
			<br />
     PropertyDescriptor[] pd = new PropertyDescriptor[x];<br />
			<br />
    for (int i=0; i<pdc.Count; i++)<br />
    {<br />
      if (pdc[i].Name.Equals("Property1"))<br />
      {<br />
        pd[0] = pdc[i];<br />
      }<br />
      else if (pdc[i].Name.Equals("Property2"))<br />
      {<br />
        pd[1] = pdc[i];<br />
      }<br />
      ...<br />
    }<br />
<br />
    return new PropertyDescriptorCollection(pd);<br />
  }<br />
<br />
   PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties()<br />
  {<br />
    return ((ICustomTypeDescriptor) this).GetProperties(new Attribute[0]);<br />
  }<br />
<br />
  public object GetEditor(Type editorBaseType)<br />
  {<br />
    return TypeDescriptor.GetEditor(this, editorBaseType, true);<br />
  }<br />
<br />
  public PropertyDescriptor GetDefaultProperty()<br />
  {<br />
    return TypeDescriptor.GetDefaultProperty(this, true);<br />
  }<br />
<br />
  public EventDescriptor GetDefaultEvent()<br />
  {<br />
    return TypeDescriptor.GetDefaultEvent(this, true);<br />
  }<br />
<br />
  public string GetClassName()<br />
  {<br />
    return TypeDescriptor.GetClassName(this, true);<br />
  }<br />
}<br />

GeneralRe: ICustomTypeDescriptor - implementation Pin
Anonymous4-May-05 5:10
Anonymous4-May-05 5:10 
GeneralRe: ICustomTypeDescriptor - implementation Pin
Mathew Hall4-May-05 15:48
Mathew Hall4-May-05 15:48 
Questionhow to convert text inro rtf and display the same in a richtextbox?? Pin
reachme_saurabh4-May-05 3:27
reachme_saurabh4-May-05 3:27 
AnswerRe: how to convert text inro rtf and display the same in a richtextbox?? Pin
Judah Gabriel Himango4-May-05 4:33
sponsorJudah Gabriel Himango4-May-05 4:33 
GeneralRe: how to convert text inro rtf and display the same in a richtextbox?? Pin
Anonymous4-May-05 20:18
Anonymous4-May-05 20:18 
GeneralRe: how to convert text inro rtf and display the same in a richtextbox?? Pin
Judah Gabriel Himango5-May-05 4:06
sponsorJudah Gabriel Himango5-May-05 4:06 
GeneralDirectShow with C# Pin
rajshukla1234-May-05 3:18
rajshukla1234-May-05 3:18 
GeneralRe: DirectShow with C# Pin
MoustafaS4-May-05 4:09
MoustafaS4-May-05 4:09 
GeneralRe: DirectShow with C# Pin
Judah Gabriel Himango4-May-05 4:32
sponsorJudah Gabriel Himango4-May-05 4:32 
GeneralCustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 2:46
Anonymous4-May-05 2:46 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
MoustafaS4-May-05 2:59
MoustafaS4-May-05 2:59 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 3:08
Anonymous4-May-05 3:08 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
keith maddox4-May-05 9:41
keith maddox4-May-05 9:41 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
leppie4-May-05 3:27
leppie4-May-05 3:27 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 3:37
Anonymous4-May-05 3:37 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
leppie4-May-05 3:52
leppie4-May-05 3:52 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 4:16
Anonymous4-May-05 4:16 

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.