Ejemplo n.º 1
0
        private void SettingsDialogBox_Load(object sender, EventArgs e)
        {
            PropertiesListView.CanExpandGetter = delegate(Object x)
            {
                return(x is SettingsPanelClass);   // ((SettingsTableEntryClass)x).IsPanel;
            };
            PropertiesListView.ChildrenGetter = delegate(Object x)
            {
                return(((SettingsPanelClass)x).Properties);
            };
            PropertiesListView.SetObjects(PanelList);

            ValueColumn.AspectPutter = delegate(Object x, object newValue)
            {
                if (x is SettingsTableEntryClass)
                {
                    SettingsTableEntryClass y = ((SettingsTableEntryClass)x);
                    if (y.CanChange)
                    {
                        y.Value = (double)newValue;
                        Implementation.TreatSettingsChange(y);

                        // ((SettingsTableEntryClass)x).Range = newValue.ToString();
                        //     var item = PanelList.FirstOrDefault(o => o.Name == ((SettingsTableEntryClass)x).ParentName);
                        //     item.Range = newValue.ToString();
                    }
                }
                else
                {
                    ((SettingsPanelClass)x).Value = "";
                    ((SettingsPanelClass)x).Range = "";
                };
            };
        } // SettingsDialogBox_Load
Ejemplo n.º 2
0
 public SettingsTableEntryClass(SettingsTableEntryClass Old)
 {
     this.Name       = Old.Name;
     this.Value      = Old.Value;
     this.Range      = Old.Range;
     this.ParentName = Old.ParentName;
     this.IsPanel    = Old.IsPanel;
     this.CanChange  = Old.CanChange;
 }
Ejemplo n.º 3
0
        public bool SetSettingsRange(string PanelName, string ItemName, string range)
        {
            SettingsTableEntryClass item = GetSettingsItem(PanelName, ItemName);

            if (item != null)
            {
                ((SettingsTableEntryClass)item).Range = range;
            }
            return(item == null);
        }
Ejemplo n.º 4
0
        public bool SetSettingsValue(string PanelName, string ItemName, double value)
        {
            SettingsTableEntryClass item = GetSettingsItem(PanelName, ItemName);

            if (item != null)
            {
                ((SettingsTableEntryClass)item).Value = value;
                Implementation.TreatSettingsChange(item);
            }
            return(item == null);
        }
Ejemplo n.º 5
0
        public bool GetSettingsCanChange(string PanelName, string ItemName)
        {
            SettingsTableEntryClass item = GetSettingsItem(PanelName, ItemName);

            return(((SettingsTableEntryClass)item).CanChange);
        }
Ejemplo n.º 6
0
        public string GetSettingsRange(string PanelName, string ItemName)
        {
            SettingsTableEntryClass item = GetSettingsItem(PanelName, ItemName);

            return(((SettingsTableEntryClass)item).Range);
        }
Ejemplo n.º 7
0
        } //GetSettingsItem

        public double GetSettingsValue(string PanelName, string ItemName)
        {
            SettingsTableEntryClass item = GetSettingsItem(PanelName, ItemName);

            return(((SettingsTableEntryClass)item).Value);
        }