Click here to Skip to main content
15,905,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: dropdown controls Pin
MoustafaS4-May-05 13:01
MoustafaS4-May-05 13:01 
GeneralRe: dropdown controls Pin
leesamanth4-May-05 19:26
leesamanth4-May-05 19:26 
GeneralRe: dropdown controls Pin
MoustafaS5-May-05 1:21
MoustafaS5-May-05 1:21 
GeneralRe: dropdown controls Pin
leesamanth5-May-05 7:43
leesamanth5-May-05 7:43 
GeneralC# IDE question Pin
hongheo764-May-05 11:11
hongheo764-May-05 11:11 
GeneralRe: C# IDE question Pin
MoustafaS4-May-05 13:54
MoustafaS4-May-05 13:54 
GeneralUpload file Pin
vuthaianh4-May-05 7:38
vuthaianh4-May-05 7:38 
GeneralRe: Upload file Pin
Polis Pilavas4-May-05 10:59
Polis Pilavas4-May-05 10:59 
GeneralTableLayoutPanel (Whidbey) Pin
Gregory Bush4-May-05 7:18
Gregory Bush4-May-05 7:18 
GeneralRe: TableLayoutPanel (Whidbey) Pin
Judah Gabriel Himango4-May-05 8:14
sponsorJudah Gabriel Himango4-May-05 8:14 
GeneralAppDomain Pin
pgoel764-May-05 6:04
pgoel764-May-05 6:04 
Generalgetting the ONLY the Filename from FileInfo Pin
Green Fuze4-May-05 5:43
Green Fuze4-May-05 5:43 
GeneralRe: getting the ONLY the Filename from FileInfo Pin
Claudio Grazioli4-May-05 5:56
Claudio Grazioli4-May-05 5:56 
GeneralRe: getting the ONLY the Filename from FileInfo Pin
Green Fuze4-May-05 11:32
Green Fuze4-May-05 11:32 
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 

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.