private static void propertyGrid_PropertyValueChanged(object sender,
                                                              PropertyValueChangedEventArgs e)
        {
            PropertyGrid   grid           = sender as PropertyGrid;
            CollectionForm collectionForm = (CollectionForm)grid.Parent.Parent;

            NamedCollection <T> items           = collectionForm.EditValue as NamedCollection <T>;
            GridItem            changedGridItem = e.ChangedItem;

            while (changedGridItem.GridItemType != GridItemType.Root)
            {
                changedGridItem = changedGridItem.Parent;
            }

            T changedItem = (T)changedGridItem.Value;

            if (e.ChangedItem.PropertyDescriptor.Name == "Name")
            {
                foreach (T item in items)
                {
                    if (item.Equals(changedItem))
                    {
                        continue;
                    }

                    if (String.Equals(item.Name, changedItem.Name))
                    {
                        changedItem.Name = e.OldValue as string;
                    }
                }
            }
        }
 public HGAProductSetting()
 {
     HGAProduct = new NamedCollection <HGAProductType>();
 }
 public NamedCollectionPropertyDescriptor(NamedCollection <T> collection, int index)
     : base("#" + index.ToString(), null)
 {
     this._collection = collection;
     this._index      = index;
 }
 public SimulatedPartSettings()
 {
     Carriers = new NamedCollection <CarrierSettings>();
 }
Esempio n. 5
0
 public MeasurementTestSettings()
 {
     TestProbeTypes = new NamedCollection <TestProbeType>();
 }
Esempio n. 6
0
 public UserAccessSettings()
 {
     Users = new NamedCollection <User>();
 }