Ejemplo n.º 1
0
        void PropGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
        {
            try
            {
                var changedProperty = e.ChangedItem.PropertyDescriptor.Name;
                if (PropGrid.SelectedObject != null && PropGrid.SelectedObjects.Length == 1)
                {
                    var unit = PropGrid.SelectedObject as ComputationUnit;
                    PropertyValueChanged(unit, changedProperty);
                }
                else if (PropGrid.SelectedObjects != null)
                {
                    PropGrid.SelectedObjects.ForEach(x =>
                    {
                        var unit = x as ComputationUnit;
                        PropertyValueChanged(unit, changedProperty);
                    });
                    PropGrid.SelectedObjects = PropGrid.SelectedObjects;
                }

                if (changedProperty == "Type")
                {
                    Demo.ShowTypeTheme();
                }
                PropGrid.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERROR");
            }
        }
Ejemplo n.º 2
0
        void ILanguageSwitcher.RefreshLanguage()
        {
            string format = LocalizationHelper.GetString("PropertyDetails") + "({0})...";
            int    length = (_objs == null) ? 0 : _objs.Length;

            EditButton.Content = string.Format(format, length);
            PropGrid.Refresh();
        }
Ejemplo n.º 3
0
        public void SwitchBuildingParcel()
        {
            if (_objs != null)
            {
                foreach (var o in _objs)
                {
                    ComputationUnit unit = o as ComputationUnit;
                    unit.UpdateResult();
                    unit.UpdateFeature();
                }

                PropGrid.Refresh();
            }
        }
Ejemplo n.º 4
0
        public void RefreshComputation()
        {
            if (_objs != null)
            {
                foreach (var o in _objs)
                {
                    ComputationUnit unit = o as ComputationUnit;
                    unit.UpdatePopulation();
                    unit.UpdateResult();
                    unit.UpdateFeature();
                }

                PropGrid.Refresh();
            }
        }
Ejemplo n.º 5
0
        public void SetObjects(params object[] objs)
        {
            _objs = objs;
            string format = LocalizationHelper.GetString("PropertyDetails") + "({0})...";

            EditButton.Content = string.Format(format, _objs.Length);
            switch (_objs.Length)
            {
            case 0:
                PropGrid.SelectedObject = null;
                break;

            case 1:
                PropGrid.SelectedObject = _objs[0];
                break;

            default:
                PropGrid.SelectedObjects = _objs;
                break;
            }
            PropGrid.Refresh();
        }