示例#1
0
 /// <summary>
 /// This member overrides PropertyBag.OnSetValue.
 /// </summary>
 protected override void OnSetValue(PropertySpecEventArgs e)
 {
     propValues[e.Property.Name] = e.Value;
     base.OnSetValue(e);
 }
示例#2
0
        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");
            }
        }
示例#3
0
            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);
            }
示例#4
0
 /// <summary>
 /// This member overrides PropertyBag.OnGetValue.
 /// </summary>
 protected override void OnGetValue(PropertySpecEventArgs e)
 {
     e.Value = propValues[e.Property.Name];
     base.OnGetValue(e);
 }
示例#5
0
            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;
            }
示例#6
0
 /// <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);
 }
示例#7
0
 /// <summary>
 /// This member overrides PropertyBag.OnSetValue.
 /// </summary>
 protected override void OnSetValue(PropertySpecEventArgs e)
 {
     propValues[e.Property.Name] = e.Value;
     base.OnSetValue(e);
 }
示例#8
0
 /// <summary>
 /// This member overrides PropertyBag.OnGetValue.
 /// </summary>
 protected override void OnGetValue(PropertySpecEventArgs e)
 {
     e.Value = propValues[e.Property.Name];
     base.OnGetValue(e);
 }
示例#9
0
文件: options.cs 项目: Zhangerr/pulse
 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");
     }
 }