Ejemplo n.º 1
0
        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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public HGAProductSetting()
 {
     HGAProduct = new NamedCollection <HGAProductType>();
 }
Ejemplo n.º 3
0
 public NamedCollectionPropertyDescriptor(NamedCollection <T> collection, int index)
     : base("#" + index.ToString(), null)
 {
     this._collection = collection;
     this._index      = index;
 }
 public SimulatedPartSettings()
 {
     Carriers = new NamedCollection <CarrierSettings>();
 }
Ejemplo n.º 5
0
 public MeasurementTestSettings()
 {
     TestProbeTypes = new NamedCollection <TestProbeType>();
 }
Ejemplo n.º 6
0
 public UserAccessSettings()
 {
     Users = new NamedCollection <User>();
 }