AcUtils
A high performance abstraction layer for AccuRev
PrncplTypeDescriptor.cs
Go to the documentation of this file.
1 
16 using System;
17 using System.ComponentModel;
18 
19 namespace AcUtils
20 {
24  [Serializable]
25  class PrncplTypeDescriptor : CustomTypeDescriptor
26  {
27  public PrncplTypeDescriptor(ICustomTypeDescriptor parent)
28  : base(parent)
29  {
30  }
31 
32  public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
33  {
34  PropertyDescriptorCollection cols = base.GetProperties();
35  PropertyDescriptor prncpl = cols["Principal"];
36  PropertyDescriptorCollection prncpl_child = prncpl.GetChildProperties();
37  PropertyDescriptor[] arr = new PropertyDescriptor[cols.Count + 4];
38  cols.CopyTo(arr, 0);
39  arr[cols.Count] = new SubPropertyDescriptor(prncpl, prncpl_child["ID"], "Principal_ID");
40  arr[cols.Count + 1] = new SubPropertyDescriptor(prncpl, prncpl_child["Name"], "Principal_Name");
41  arr[cols.Count + 2] = new SubPropertyDescriptor(prncpl, prncpl_child["Status"], "Principal_Status");
42  arr[cols.Count + 3] = new SubPropertyDescriptor(prncpl, prncpl_child["Members"], "Principal_Members");
43  PropertyDescriptorCollection newcols = new PropertyDescriptorCollection(arr);
44  return newcols;
45  }
46  }
47 }
Support TypeDescriptionProvider attribute on AcUser.
Support TypeDescriptionProvider attribute on AcUser.