/// <summary> /// This member overrides PropertyBag.OnSetValue. /// </summary> protected override void OnSetValue(PropertySpecEventArgs e) { propValues[e.Property.Name] = e.Value; base.OnSetValue(e); }
void pt_SetValue(object sender, PropertySpecEventArgs e) { Console.WriteLine(e.Property.Name); Console.WriteLine(e.Value); try { switch (e.Property.Name) { case "Waveform": Config.Waveform = (bool)e.Value; break; case "Edit middle": Config.EditMiddle = (bool)e.Value; break; case "Width": Config.ClientWidth = (int)e.Value; // if (Game.game != null) { Game.game.Bounds = new Rectangle(Game.game.Bounds.X, Game.game.Bounds.Y, Config.ClientWidth, Config.ClientHeight); } break; case "Height": Config.ClientHeight = (int)e.Value; // if (Game.game != null) { Game.game.Bounds = new Rectangle(Game.game.Bounds.X, Game.game.Bounds.Y, Config.ClientWidth, Config.ClientHeight); } break; case "VSync": Config.Vsync = (bool)e.Value; break; case "Fullscreen": Config.Fullscreen = (bool)e.Value; break; case "Offset": Config.Offset = (int)e.Value; break; case "Display FPS": Config.DisplayFps = (bool)e.Value; break; case "FPS Limit": Config.Fps = (int)e.Value; break; case "Volume": Config.Volume = (int)e.Value; break; case "Skin Folder": Config.SkinFolder = (String)e.Value; break; case "Hitsound Volume": Config.HitVolume = (int)e.Value; break; case "Hold hitsounds": Config.HoldHitsounds = (bool)e.Value; break; case "Disable mousewheel": Config.DisableMousewheel = (bool)e.Value; break; case "Widescreen": Config.WideScreen = (bool)e.Value; break; case "Chatsounds": Config.ChatSounds = (bool)e.Value; break; case "Restart key": Config.RestartKey = (Key)e.Value; break; case "Skip key": Config.SkipKey = (Key)e.Value; break; } for (int x = 0; x < 8; x++) { if (e.Property.Name.Equals("5K Key " + (x + 1))) { Config.keys[0][x] = (OpenTK.Input.Key)e.Value; } if (e.Property.Name.Equals("6K Key " + (x + 1))) { Config.keys[1][x] = (OpenTK.Input.Key)e.Value; } if (e.Property.Name.Equals("7K Key " + (x + 1))) { Config.keys[2][x] = (OpenTK.Input.Key)e.Value; } if (e.Property.Name.Equals("8K Key " + (x + 1))) { Config.keys[3][x] = (OpenTK.Input.Key)e.Value; } } } catch (Exception) { //MessageBox.Show("pls enter valid values"); } }
public override void SetValue(object component, object value) { // Have the property bag raise an event to set the current value // of the property. PropertySpecEventArgs e = new PropertySpecEventArgs(item, value); bag.OnSetValue(e); }
/// <summary> /// This member overrides PropertyBag.OnGetValue. /// </summary> protected override void OnGetValue(PropertySpecEventArgs e) { e.Value = propValues[e.Property.Name]; base.OnGetValue(e); }
public override object GetValue(object component) { // Have the property bag raise an event to get the current value // of the property. PropertySpecEventArgs e = new PropertySpecEventArgs(item, null); bag.OnGetValue(e); return e.Value; }
/// <summary> /// Raises the SetValue event. /// </summary> /// <param name="e">A PropertySpecEventArgs that contains the event data.</param> protected virtual void OnSetValue(PropertySpecEventArgs e) { if(SetValue != null) SetValue(this, e); }