public void Reset() { if (this.m_Picker != null) { Gumps.Destroy(this.m_Picker); } this.m_Picker = null; }
protected internal override void OnMouseUp(int X, int Y, MouseButtons mb) { if (mb == MouseButtons.Left) { ((GEditorPanel)base.Parent.Parent).Reset(); object obj2 = this.m_Entry.Property.GetValue(this.m_Object, null); if (obj2 is bool) { this.SetValue(!((bool)obj2)); } else if ((obj2 is Item) || (this.m_Entry.Property.PropertyType == typeof(Item))) { Engine.TargetHandler = new SetItemPropertyTarget(this); } else if (obj2 is Enum) { Array values = Enum.GetValues(obj2.GetType()); for (int i = 0; i < values.Length; i++) { if (values.GetValue(i).Equals(obj2)) { this.SetValue(values.GetValue((int)((i + 1) % values.Length))); break; } } } else if (this.m_Entry.Hue != null) { if (this.m_Picker == null) { GPropertyHuePicker toAdd = this.m_Picker = new GPropertyHuePicker(this); toAdd.X = this.Width - 1; toAdd.Y = 0; base.m_Children.Add(toAdd); } } else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true)) { Gumps.Destroy(base.Parent.Parent.Parent.Parent); GMacroEditorForm.Open(); } } }
protected internal override void OnMouseUp(int X, int Y, MouseButtons mb) { if (mb == MouseButtons.Left) { ((GEditorPanel) base.Parent.Parent).Reset(); object obj2 = this.m_Entry.Property.GetValue(this.m_Object, null); if (obj2 is bool) { this.SetValue(!((bool) obj2)); } else if ((obj2 is Item) || (this.m_Entry.Property.PropertyType == typeof(Item))) { Engine.TargetHandler = new SetItemPropertyTarget(this); } else if (obj2 is Enum) { Array values = Enum.GetValues(obj2.GetType()); for (int i = 0; i < values.Length; i++) { if (values.GetValue(i).Equals(obj2)) { this.SetValue(values.GetValue((int) ((i + 1) % values.Length))); break; } } } else if (this.m_Entry.Hue != null) { if (this.m_Picker == null) { GPropertyHuePicker toAdd = this.m_Picker = new GPropertyHuePicker(this); toAdd.X = this.Width - 1; toAdd.Y = 0; base.m_Children.Add(toAdd); } } else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true)) { Gumps.Destroy(base.Parent.Parent.Parent.Parent); GMacroEditorForm.Open(); } } }