public PropertyWrapper(object owner) { m_dctd = ProviderInstaller.Install(this); m_owner = owner; CustomPropertyDescriptor cpd = m_dctd.GetProperty("SelectedProperty"); foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties(owner)) { StandardValueAttribute sva = new StandardValueAttribute(pd); sva.DisplayName = pd.DisplayName; sva.Description = pd.Description; cpd.StatandardValues.Add(sva); } SelectedProperty = (cpd.StatandardValues.ToArray( )[0].Value) as CustomPropertyDescriptor; m_dctd.CategorySortOrder = CustomSortOrder.None; m_dctd.PropertySortOrder = CustomSortOrder.None; this.PropertyFlags = m_cpd.PropertyFlags; }
private void PopululateDropDownListFromDatabaseSource(CustomPropertyDescriptor cpd) { // we actually don't have any data source in this sample. // we will simply add some hard coded data here. // we will make customer names and id. if (cpd.StatandardValues.IsReadOnly) // we cannot modifiy standard values for enum type { return; } cpd.StatandardValues.Clear( ); string[] arrNames = { "Adam", "Brian", "Russel", "Jones", "Jakob" }; for (int i = 101; i < 106; i++) { StandardValueAttribute sva = new StandardValueAttribute(i, arrNames[i - 101]); sva.Description = "Description of " + sva.DisplayName + "."; cpd.StatandardValues.Add(sva); } }
public TagItem(StandardValueAttribute item) { Item = item; }