public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); for (int i = 0; i < ((Dictionary <string, object>)value).Count; i++) { CollectionPropertyDescriptor pd = new CollectionPropertyDescriptor(((Dictionary <string, object>)value), i); pds.Add(pd); } return(pds); }
public PropertyDescriptorCollection GetProperties() { PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); Dictionary <string, object> d = new Dictionary <string, object>(); for (int i = 0; i < this.List.Count; i++) { string n = this.List[i].GetType().Name; switch (this.List[i].GetType().Name) { case "Behavior": Behavior b = (Behavior)this.List[i]; if (b.script != null) { n = b.script.name; } break; case "BlueprintBehavior": BlueprintBehavior bb = (BlueprintBehavior)this.List[i]; if (bb.blueprint != null) { n = bb.blueprint.name; } break; } int it = 0; foreach (string k in d.Keys) { if (k.Equals(n) || k.Equals(n + " (" + it.ToString() + ")")) { it += 1; } } if (it > 0) { n += " (" + it.ToString() + ")"; } d.Add(n, this.List[i]); CollectionPropertyDescriptor pd = new CollectionPropertyDescriptor(d, i); pds.Add(pd); } return(pds); }
public PropertyDescriptorCollection GetProperties() { PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); Dictionary<string, object> d = new Dictionary<string, object>(); for (int i = 0; i < this.List.Count; i++) { string n = this.List[i].GetType().Name; switch (this.List[i].GetType().Name) { case "Behavior": Behavior b = (Behavior)this.List[i]; if (b.script != null) n = b.script.name; break; case "BlueprintBehavior": BlueprintBehavior bb = (BlueprintBehavior)this.List[i]; if (bb.blueprint != null) n = bb.blueprint.name; break; } int it = 0; foreach (string k in d.Keys) { if (k.Equals(n) || k.Equals(n + " (" + it.ToString() + ")")) it += 1; } if (it > 0) n += " (" + it.ToString() + ")"; d.Add(n, this.List[i]); CollectionPropertyDescriptor pd = new CollectionPropertyDescriptor(d, i); pds.Add(pd); } return pds; }
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); for (int i = 0; i < ((Dictionary<string, object>)value).Count; i++) { CollectionPropertyDescriptor pd = new CollectionPropertyDescriptor(((Dictionary<string, object>)value), i); pds.Add(pd); } return pds; }